- MongoDB setup
- Install MongoDB
- Install MongoDB Compass
- Create a
devdatabase
- Create a
.envfile at the project root, taking .env.example.local as a template- For production, point MONGODB_URI to your production MongoDB server, and set ENV to
prod.
- For production, point MONGODB_URI to your production MongoDB server, and set ENV to
- Create
venvfor doc-router, installpackages/requirements.txt- During setup
mkdir ~/.venv python -m venv ~/.venv/doc-router . ~/.venv/doc-router/bin/activate pip install -r packages/python/requirements.txt
- Install
NodeJSandnpm - Install the frontend
cd packages/typescript/frontend npm install - The Next.js gets its config from the top-level
.envnotpackages/typescript/frontend/.env.local
- Cd to the top of the project directory, and run
./start-all.sh
-
Open three terminals
-
In the two terminals you will run the fastapi and worker, activate the virtual environment:
. ~/.venv/doc-router/bin/activate -
Start the back end
cd packages/python uvicorn app.main:app --host 0.0.0.0 --port 8000 -
In a separate shell, start the workers
cd packages/python/worker python worker.py -
Open http://localhost:8000/docs to experiment with the FastAPI
-
Start the front end
cd packages/typescript/frontend npm run dev
Under construction.
- MongoDB setup
- Install MongoDB
- Install MongoDB Compass
- Create a
devdatabase
- Backend and venv
- Install python 3.11 - 3.12 and use it to create the venv
brew install python@3.11mkdir ~/.venvpython3.11 -m venv ~/.venv/doc-router. ~/.venv/doc-router/bin/activatepip install -r packages/python/requirements.txt
- The rest is the same as for Linux
- Install python 3.11 - 3.12 and use it to create the venv
- Frontend
- Same as for Linux
- The default log level is
INFO. - To change the log level, set the
LOG_LEVELenvironment variable to the desired level.export LOG_LEVEL=DEBUG
- The log level can only be set in the environment, not in the
.envfile.