- Node.js (v20.0.0 at least)
- npm (v6.14.4 at least)
- Python (v3.10.0 at least)
- MongoDB (running locally on port 27017)
- venv (Python virtual environment)
- Ollama installed on system and its server running locally.
Don't worry, I will have everything for you covered here in the installation section below.
First of all, clone the repository
# If it is not accessible to you, you may need to
# zip download it, and paste it in the client system
git clone [email protected]:CodeWhizHamza/chatbot.gitcd chatbot/frontend
npm installcp .env.sample .env.localNow, open the .env.local file and set the NEXT_PUBLIC_API_URL to the backend server URL. typically it is http://0.0.0.0:8000.
Also, setup the NEXT_PUBLIC_JWT_SECRET to a random string, and remember it for the backend setup too.
npm run buildNow the frontend is ready to be served.
cd chatbot/api
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtcp .env.sample .envNow, open the .env file and set the JWT_SECRET to the same value as you set in the frontend.
Note: Use this once you have install all the dependencies in the backend.
Change the SALT to a randomly generated salt using the following command:
python -c "import bcrypt; print(bcrypt.gensalt())"Copy this salt and paste it in the .env file.
The MONGODB_URI should be mongodb://localhost:27017/ if you are running MongoDB locally. Otherwise, set it to the appropriate URI from the MongoDB provider.
Now the backend is ready to be served.
First of all, you need to have Ollama installed on your system. If you don't have it, you can download it from here
Then in the terminal, run the following command to start the Ollama server:
ollama pull llama3.1:8b
ollama pull deepseek-r1:14b
ollama pull qwen2.5:14bThis will install the required dependencies and start the server.
If you don't have MongoDB installed, you can download it from here
This will only install the MongoDB server, you will need to start the server by running the following command:
mongodIf you have brew installed, you can install python using the following command:
brew install python3.10Otherwise, you can download the installer from here
Go to the root directory of the project and run the following command:
cd frontend
npm run startcd backend
source venv/bin/activate
fastapi run main.pyfastapi run, runs the backend server on http://0.0.0.0:8000, so make sure to set the NEXT_PUBLIC_API_URL in the frontend to this URL.
sudo ./run_application.sh- Note: if you are running the system after changes, please make sure to empty the database (development).