Development Environments
Spin up Mongo and Redis
For development, only two containers are used from docker-compose.yaml (opens in a new tab) (by deleting all services except for Redis and Mongo). See file docker-compose-dev.yaml (opens in a new tab).
Run
docker compose -f docker-compose-dev.yaml build
docker compose -f docker-compose-dev.yaml up -d
Run the Backend
[!Note] Make sure you have Python 3.12 installed.
- Export required environment variables or prepare a
.env
file in the project folder:- Copy .env-template (opens in a new tab) and create
.env
.
- Copy .env-template (opens in a new tab) and create
(check out application/core/settings.py
if you want to see more config options.)
- (optional) Create a Python virtual environment: You can follow the Python official documentation (opens in a new tab) for virtual environments.
a) On Mac OS and Linux
python -m venv venv
. venv/bin/activate
b) On Windows
python -m venv venv
venv/Scripts/activate
- Download embedding model and save it in the
model/
folder: You can use the script below, or download it manually from here (opens in a new tab), unzip it and save it in themodel/
folder.
wget https://d3dg1063dc54p9.cloudfront.net/models/embeddings/mpnet-base-v2.zip
unzip mpnet-base-v2.zip -d model
rm mpnet-base-v2.zip
- Install dependencies for the backend:
pip install -r application/requirements.txt
- Run the app using
flask --app application/app.py run --host=0.0.0.0 --port=7091
. - Start worker with
celery -A application.app.celery worker -l INFO
.
[!Note] You can also launch the in a debugger mode in vscode by accessing SHIFT + CMD + D or SHIFT + Windows + D on windows and selecting Flask or Celery.
Start Frontend
[!Note] Make sure you have Node version 16 or higher.
- Navigate to the /frontend (opens in a new tab) folder.
- Install the required packages
husky
andvite
(ignore if already installed).
npm install husky -g
npm install vite -g
- Install dependencies by running
npm install --include=dev
. - Run the app using
npm run dev
.