This repository houses the source code for the Chatbot backend. It uses NodeJS.
We highly recommend VS Code for its great plugins.
Using Docker is the best way to run the app for development. Please use only pnpm to run the project or handle dependencies! Different tools like yarn
and npm
are not interoperable with pnpm
(or each other) and will cause problems when intermingled.
Ensure you have wsl environment installed for those using windows pc, if not install from here.
Ensure you have Docker Desktop installed and running on your machine, if not install from here.
At the project here on github, click on the code button and copy the link from the https tab.
Navigate to the where you want to clone your project in the wsl environment on the terminal and enter the command git clone https://github.com/OpenSourceFellows/chatbot.git
.
cd into project cd chatbot_server
Open the project from your terminal using command code .
At the root of your project you would find a .env.example
file. Copy the creds in that file into a .env
file.
Still at the root of your project, locate the .docker
folder and copy the creds in its .env.example file into another .env file within the .docker folder.
Starting this project for the first time, at the root of the project /chatbot_server
, run the following commands in the terminal in the following order:
./scripts/rebuild.sh
to build the docker containers for our project.
./scripts/start.sh
to run our container and allow us to enter into the project.
Once inside, run
pnpm install
to install node packages and then run
pnpm dev
to start the development server. The app will run on port 7000 so make sure that is available on your local machine or you probably won't be able to access the app in your browser.
To exit the conainer, shut down the dev server with ctrl + c
and you can just type exit
.
To shut down the container, use
./scripts/stop.sh
You may need to rebuild the container from time to time and can do that with
./scripts/rebuild.sh
We use jest for testing. You can start this with
pnpm test
We use eslint for strong linting practices for this project and you can check if your code meets the standard by running
pnpm lint
and run
pnpm lint:fix
to auto fix common errors.