CrimeGPT is a production-quality, hackathon-ready digital platform designed for Indian Police Departments. It streamlines case workflow registration (from FIR to Arrest), eliminates redundant paperwork, maintains an evolving Case Diary, and utilizes AI-powered legal matching to recommend BNS/BNSS/BSA sections and judicial precedents.
- No Duplicate Entry: Officers input details (Victims, Accused, Location, Narratives) once into a Central Case Data Pool. Multiple document templates pull from this pool dynamically.
- 12 Auto-Generated Documents: Supports compile, preview, and download of:
- Supplementary (Purvani) Chargesheet
- Medical Treatment Letter
- Police Custody Remand Request (BNSS Sec 187)
- Court Custody Letter
- Seizure Receipt / Memo (BNSS Sec 185)
- Accused Panchanama
- Face Identification Form
- Witness Statement Record
- Notice of Appearance (BNSS Sec 35(3))
- Arrest Memo (DK Basu compliant)
- Search Memo
- Recovery Memo (BSA Sec 23)
- Evolving Case Diary: Maintains a chronological, tamper-evident timeline log of all actions.
- AI Section Predictor & RAG: Matches narratives to relevant sections of BNS, BNSS, BSA, IPC, CrPC, and Evidence Act, providing explanatory reasoning and Supreme Court landmark case citations.
- Multilingual Legal Translation: Supports legal terminology across English, Hindi, and Gujarati.
- SHA256 Evidence Hashing: Calculates cryptographic hash of evidence files on upload, securing chain of custody and geo-tagging locations.
- Security Logs & Audit Trails: Tracks who changed which case variables, logging timestamps, actor, and
old_valuevsnew_value.
To start the prototype in a local environment on Windows, use the custom batch script which automatically creates a virtual environment, installs dependencies, seeds the database, and launches the dashboard.
- Double-click or execute the runner script in PowerShell/Command Prompt:
.\run.bat
- The script will initialize
.venv, upgrade pip, install libraries, seed datasets, start the FastAPI server, and open your browser automatically at: http://localhost:8000/
If you prefer to run the commands manually:
- Initialize the virtual environment:
python -m venv .venv
- Activate the virtual environment:
- Windows PowerShell:
.\.venv\Scripts\Activate.ps1 - Windows CMD:
.\.venv\Scripts\activate.bat - macOS/Linux:
source .venv/bin/activate
- Windows PowerShell:
- Install the dependencies:
pip install -r backend/requirements.txt
- Seed the dataset JSON files:
python datasets/generate_datasets.py
- Run the server:
python -m uvicorn backend.app.main:app --host 0.0.0.0 --port 8000 --reload
- Open your browser and navigate to: http://localhost:8000/
The system pre-seeds default credentials at database startup for demo flows:
- Investigation Officer (IO):
- Username:
io_rajesh - Password:
password123
- Username:
- Station House Officer (SHO):
- Username:
sho_arvind - Password:
password123
- Username:
- Administrator:
- Username:
admin_ops - Password:
password123
- Username:
- Frontend Workspace: React, TypeScript, Material UI (MUI), Lucide, Tailwind, React Router.
- FastAPI Hosting Environment: Served as a Single Page Application at root, CORS enabled.
- Backend Server: Python FastAPI, Pydantic, SQLAlchemy.
- Database & Storage: SQLite (
crimegpt.db), filesystem upload registers. - AI, NLP & RAG: Python TF-IDF, Cosine Similarity, keyword boosting vector matcher.
- Document Engines:
python-docxfor.docxformatting, nativeReportLabfor print-ready.pdfgenerations. - Deployment: Dockerfile, docker-compose.yml configuration files.
CrimeGPT/
├── backend/
│ ├── app/
│ │ ├── routes/ # Authentication, Case CRUD, Evidence, AI RAG, Audit
│ │ ├── static/ # Host directory for React Dashboard (index.html)
│ │ ├── auth.py # Bcrypt direct hashing and JWT sign verification
│ │ ├── config.py # Uploads/documents static directory configurations
│ │ ├── database.py # SQLAlchemy engine and local SQLite setup
│ │ ├── models.py # User, Case, Victim, Accused, Witness, Evidence, Diary
│ │ └── main.py # FastAPI entrypoint, mounts routers & static SPA
│ └── requirements.txt
├── frontend/ # Standalone Vite + React + TypeScript compilation workspace
│ ├── package.json
│ ├── tsconfig.json
│ └── src/
├── ai_engine/ # NLP engines (FIR summarizer, risks, duplicates)
├── legal_engine/ # RAG mappings for BNS/IPC and judgements datasets
├── document_engine/ # docx compile engines & native ReportLab PDF generators
├── ocr_engine/ # Document scan regex-assisted entity extractors
├── datasets/ # Seeding datasets (100 FIRs, witness logs, judgements)
├── docker/ # Dockerfile and Docker Compose configurations
├── docs/ # Architecture, user manual, and demo scripts
├── tests/ # 9 Pytest cases verifying core system functions
└── run.bat # Bootstrapper batch file
Verify the system compliance and compilation functions using the Pytest suite. Ensure the virtual environment is active first.
python -m pytest tests/test_crimegpt.pyThe test runner will execute 9 comprehensive tests validating:
- Password hashing security algorithms.
- JWT token creation and encryption.
- User database insertion.
- Case registration and data pool variable matching.
- AI RAG section recommendations from incident text.
- AI landmark judgements citation accuracy.
- AI compliance risk warnings.
- DOCX and PDF compilation.
- OCR text parsing and form filling.