Sign inSign up

hisptanzania/chat-bot

By hisptanzania

•Updated over 2 years ago

Chat-bot implementation using decision tree

Image
1

480

hisptanzania/chat-bot repository overview

⁠Chat bot Engine

⁠Introduction

A simple server that uses decision tree based algorithm to perform different actions based on the user selection

⁠Getting started

To set up the server, download the latest release⁠. Then create copy the .env.example file to .env and change the required environment variables.

⁠Environment variables
  • DATABASE_URL: The postgres database url for the server with the format postgres://user:password@server_name:port/db_name
  • POSTGRES_PASSWORD: The database password (Only applies to docker compose setup)
  • POSTGRES_USER: The database user (Only applies to docker compose setup)
  • PORT: The port where the server should run on.
  • API_MOUNT_POINT: The endpoint on which the server API will be accessible
  • API_KEY_ADMIN: An API key that every request must set in the header as x-api-key
  • CORS_WHITELIST: A list of whitelisted urls separated by comma e.g http://dev.hisptz.com,http://dhis2.org
⁠Using node

This requires at least Node version 16.x.

Run

 yarn install --prod

To get required dependencies and run the app using the command:

yarn start

This requires at least Docker Engine version 23.0.5 and Docker Compose Plugin version v2.15.1. To run the app using docker there are 2 ways:

⁠Docker build

First, build the docker image

docker build . <image_name>:<app-version>

And then run the app container using:

docker run <image_name>:<app-version> --port 3000:<port>

Make sure the DATABASE_URL points to an existing Postgres database

⁠Docker compose

This is recommended if you don't have an external Postgres database. To run the app use:

docker compose up -d --build

⁠Development

You can set up the project by cloning into your local machine.

⁠Get dependencies

Get the required dependencies by running:

yarn install
⁠Environment

Copy .env.example to .env file and change the variables as required.

⁠Run in development mode

To run the server in development mode use:

yarn dev
⁠Build

To build the app run:

yarn build

This will create a zipped build in the build folder

Tag summary

Content type

Image

Digest

sha256:a1f4a639b…

Size

177 MB

Last updated

over 2 years ago

docker pull hisptanzania/chat-bot