Chat-bot implementation using decision tree
480
A simple server that uses decision tree based algorithm to perform different actions based on the user selection
To set up the server, download the latest release. Then create copy
the .env.example file to .env and change the required environment variables.
DATABASE_URL: The postgres database url for the server with the
format postgres://user:password@server_name:port/db_namePOSTGRES_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 accessibleAPI_KEY_ADMIN: An API key that every request must set in the header as x-api-keyCORS_WHITELIST: A list of whitelisted urls separated by comma e.g http://dev.hisptz.com,http://dhis2.orgThis 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:
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
This is recommended if you don't have an external Postgres database. To run the app use:
docker compose up -d --build
You can set up the project by cloning into your local machine.
Get the required dependencies by running:
yarn install
Copy .env.example to .env file and change the variables as required.
To run the server in development mode use:
yarn dev
To build the app run:
yarn build
This will create a zipped build in the build folder
Content type
Image
Digest
sha256:a1f4a639b…
Size
177 MB
Last updated
over 2 years ago
docker pull hisptanzania/chat-bot