Skip to content

The application is used to mask the sensitive data of the document and and replace them with some other text.

Notifications You must be signed in to change notification settings

asifrahaman13/p2_detection

Repository files navigation

About the application.

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.\

Screenshot from 2025-05-21 08-29-19

Screenshot from 2025-05-18 11-39-54

Screenshot from 2025-05-21 08-32-50

Screenshot from 2025-05-18 11-41-45

Screenshot from 2025-05-20 09-09-58

Screenshot from 2025-05-20 09-09-26

Backend

git clone hhttps://github.com/asifrahaman13/p2_detection.git

Next go to the root directory.

cd p2_detection

Now set up a virtual environment

uv venv
source .venv/bin/activate

Next install the dependencies.

uv sync

Create a .env file from the .env.example file, and ensure you enter the correct credentials.

mv .env.example .env

Next enter your credentials in .env file. Now you should be able to run the application in dev environment.

uv run uvicorn src.main:app --reload

For 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:8000

Front end

Go 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 .env

Now install the dependencies.

bun install

Next, run the server in the local environment.

bun run dev

Run as a docker container

The 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 up

Formatting

For linting the backend run the following:

ruff check --fix

For formatting run the following script:

ruff format

If you want to run the pre-commit hooks, you can run the following command. They will run anyway.

uv run pre-commit run

For linting the frontend run the following inside the web folder.

bun run lint

For the format run the following:

bun run format

Tests

Few test scripts are present to test the functionalities.

pytest

Ports

The 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

About

The application is used to mask the sensitive data of the document and and replace them with some other text.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •