Skip to content

Latest commit

 

History

History
71 lines (65 loc) · 2.4 KB

File metadata and controls

71 lines (65 loc) · 2.4 KB

Local Development Setup

Linux

  • MongoDB setup
  • Create a .env file 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.
  • Create venv for doc-router, install packages/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 NodeJS and npm
  • Install the frontend
    cd packages/typescript/frontend
    npm install
  • The Next.js gets its config from the top-level .env not packages/typescript/frontend/.env.local

Using start-all.sh

  • Cd to the top of the project directory, and run ./start-all.sh

Manually starting each process

  • 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

Macbook

Under construction.

  • MongoDB setup
  • Backend and venv
    • Install python 3.11 - 3.12 and use it to create the venv
      • brew install python@3.11
      • mkdir ~/.venv
      • python3.11 -m venv ~/.venv/doc-router
      • . ~/.venv/doc-router/bin/activate
      • pip install -r packages/python/requirements.txt
    • The rest is the same as for Linux
  • Frontend
    • Same as for Linux

Changing log levels

  • The default log level is INFO.
  • To change the log level, set the LOG_LEVEL environment variable to the desired level.
    • export LOG_LEVEL=DEBUG
  • The log level can only be set in the environment, not in the .env file.