Repository to deal with the documents masking out the sensitive information. Currently, this is in the form of mono repo. Make sure you have node , uv (package manager for python) installed in your system.\
git clone hhttps://github.com/asifrahaman13/p2_detection.gitNext go to the root directory.
cd p2_detectionNow set up a virtual environment
uv venv
source .venv/bin/activateNext install the dependencies.
uv syncCreate a .env file from the .env.example file, and ensure you enter the correct credentials.
mv .env.example .envNext enter your credentials in .env file. Now you should be able to run the application in dev environment.
uv run uvicorn src.main:app --reloadFor the production environment, you can use the unicorn and unicorn combined instead. (Here, we used 4 workers.)
gunicorn src.main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000Go to the front-end directory
cd web/Create a .env file from the .env.example file and ensure you enter the correct credentials.
mv .env.example .envNow install the dependencies.
bun installNext, run the server in the local environment.
bun run devThe application can also be run as a docker container service. Run the following command in the root folder. Make sure you enter the correcnt credentials in the .env file of both the frontend and backend.
docker compose upFor linting the backend run the following:
ruff check --fixFor formatting run the following script:
ruff formatIf you want to run the pre-commit hooks, you can run the following command. They will run anyway.
uv run pre-commit runFor linting the frontend run the following inside the web folder.
bun run lintFor the format run the following:
bun run formatFew test scripts are present to test the functionalities.
pytestThe frontend of the application will run on port 3000. http://127.0.0.1:3000. But you need to hit the following api instead to be in the dashboard: http://localhost:3000/dashboard/cases
The backend of the application will run on port 8000 http://127.0.0.1:8000