mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
2.4 KiB
2.4 KiB
Development Environments
Spin up Mongo and Redis
For development, only two containers are used from docker-compose.yaml (by deleting all services except for Redis and Mongo). See file docker-compose-dev.yaml.
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
.envfile in the project folder:- Copy .env-template and create
.env.
- Copy .env-template 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 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, 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 folder.
- Install the required packages
huskyandvite(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.