You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Star1 (1)You must be signed in to star a repository
About
JusticeFlow is a comprehensive, AI-powered Case Management System designed to digitize and streamline the entire lifecycle of criminal cases in the Indian judicial system — from FIR registration to final judgment.
JusticeFlow is a comprehensive, AI-powered Case Management System designed to digitize and streamline the entire lifecycle of criminal cases in the Indian judicial system — from FIR registration to final judgment.
🌟 Why JusticeFlow?
graph LR
A[📋 Manual FIRs] -->|Before| B[❌ Paper-based chaos]
C[⚖️ JusticeFlow] -->|After| D[✅ Digital efficiency]
B --> E[Lost documents]
B --> F[Delayed justice]
B --> G[No transparency]
D --> H[Secure storage]
D --> I[Fast processing]
D --> J[Complete audit trail]
style A fill:#ffcccc
style B fill:#ff6666
style C fill:#ccffcc
style D fill:#66ff66
Loading
🏆 Key Achievements
Metric
Value
Total Features
26+
AI Models Integrated
7
API Endpoints
60+
Database Tables
23
Lines of Code
~25,000+
Languages Supported
11 (OCR)
Cost
100% FREE
✨ Feature Highlights
🔥 Core Features
🚔 Police Module
✅ Digital FIR Registration
✅ Case Assignment & Tracking
✅ Investigation Management
✅ Evidence Upload & Management
✅ Witness & Accused Records
✅ Document Generation (Charge Sheet, etc.)
✅ Document Request System
✅ Bail Tracking
⚖️ Court Module
✅ Case Intake & Review
✅ Submission Acknowledgment
✅ Cognizance & Charges Recording
✅ Trial Progress Tracking
✅ Hearing Management
✅ Judgment & Sentencing
✅ Case Archival
✅ Reopen Request Handling
🤖 AI-Powered Features (26 Total)
flowchart TB
subgraph OCR["📄 OCR & Extraction"]
O1[Intelligent OCR]
O2[Multilingual Support]
O3[PII Redaction]
O4[Entity Extraction]
end
subgraph DOC["📝 Document Intelligence"]
D1[Charge Sheet Drafting]
D2[Document Validation]
D3[Template Generation]
D4[Case Brief Generator]
end
subgraph LEGAL["⚖️ Legal AI"]
L1[Section Suggester]
L2[Section Explainer]
L3[Precedent Matcher]
L4[Legal NER]
end
subgraph SEARCH["🔍 Search & Discovery"]
S1[Semantic Search]
S2[RAG Chatbot]
S3[Query Expansion]
S4[Reranking]
end
subgraph ROLE["👥 Role-Based AI"]
R1[Case Readiness Checker]
R2[Document Validator]
R3[AI Insight Pane]
end
AI((🤖 AI Core)) --> OCR
AI --> DOC
AI --> LEGAL
AI --> SEARCH
AI --> ROLE
style AI fill:#6366f1,stroke:#4338ca,color:#fff
style OCR fill:#e0f2fe,stroke:#0284c7,color:#0c4a6e
style DOC fill:#fef3c7,stroke:#d97706,color:#78350f
style LEGAL fill:#d1fae5,stroke:#059669,color:#064e3b
style SEARCH fill:#fce7f3,stroke:#db2777,color:#831843
style ROLE fill:#ede9fe,stroke:#7c3aed,color:#4c1d95
Loading
🎨 UI/UX Features
Feature
Description
📱 Mobile Responsive
Works on all devices (phones, tablets, desktops)
🔔 Real-Time Notifications
Instant alerts with unread count
📊 Analytics Dashboard
Charts, stats, and trends
⏱️ Timeline Visualization
Visual case journey with icons
🔍 Advanced Search
AI-powered semantic search
📄 Document Preview
In-browser document viewing
🎯 Drag & Drop
Evidence upload with preview
⚡ Skeleton Loaders
Smooth loading states
🏗️ System Architecture
High-Level Architecture
graph TB
subgraph "🖥️ Client Layer"
A[React 19 SPA<br/>Vite + TypeScript + TailwindCSS]
end
subgraph "🔌 API Gateway"
B[Express.js Server<br/>JWT Auth + RBAC]
end
subgraph "🤖 AI Service"
C[FastAPI Server<br/>Python + ML Models]
end
subgraph "💾 Data Layer"
D[(PostgreSQL<br/>Prisma ORM)]
E[(FAISS<br/>Vector Index)]
F[☁️ Cloudinary<br/>File Storage]
end
A -->|REST API| B
B -->|Proxy| C
B --> D
B --> F
C --> E
C --> D
style A fill:#61dafb,stroke:#333,color:#000
style B fill:#68a063,stroke:#333,color:#fff
style C fill:#009688,stroke:#333,color:#fff
style D fill:#336791,stroke:#333,color:#fff
style E fill:#ff6b6b,stroke:#333,color:#fff
style F fill:#3448c5,stroke:#333,color:#fff
flowchart TD
A[👮 Police registers FIR] --> B[📋 Case auto-created]
B --> C[👨✈️ SHO assigns case]
C --> D[🔍 Investigation phase]
D --> E{Evidence found?}
E -->|Yes| F[📝 Prepare Charge Sheet]
E -->|No| G[📄 Prepare Closure Report]
F --> H[✅ Document Validation]
G --> H
H --> I{All documents ready?}
I -->|No| J[⚠️ Fix missing items]
J --> H
I -->|Yes| K[📤 SHO submits to Court]
K --> L[📋 Court Clerk reviews]
L --> M{Accepted?}
M -->|No| N[🔙 Return for defects]
N --> D
M -->|Yes| O[⚖️ Court accepts case]
O --> P[👨⚖️ Trial phase]
P --> Q[📜 Judgment delivered]
Q --> R[📁 Case archived]
style A fill:#3498db,color:#fff
style O fill:#2ecc71,color:#fff
style Q fill:#f39c12,color:#fff
style R fill:#95a5a6,color:#fff
Loading
👥 User Roles & Permissions
Role Hierarchy
graph TD
J[⚖️ JUDGE<br/>Highest Authority]
CC[📋 COURT_CLERK<br/>Court Operations]
SHO[👨✈️ SHO<br/>Station Head]
P[👮 POLICE<br/>Investigating Officer]
J --> CC
SHO --> P
style J fill:#f39c12,stroke:#333,color:#000
style CC fill:#2ecc71,stroke:#333,color:#fff
style SHO fill:#e74c3c,stroke:#333,color:#fff
style P fill:#3498db,stroke:#333,color:#fff
Loading
Permission Matrix
Feature
POLICE
SHO
COURT_CLERK
JUDGE
Register FIR
✅
✅
❌
❌
Assign Cases
❌
✅
❌
❌
Upload Evidence
✅
✅
❌
❌
Create Documents
✅
✅
❌
❌
Submit to Court
❌
✅
❌
❌
Accept Submission
❌
❌
✅
✅
Record Court Actions
❌
❌
✅
✅
Deliver Judgment
❌
❌
❌
✅
Approve Reopen
❌
❌
❌
✅
Case Readiness Check
❌
✅
❌
❌
Document Validation
❌
❌
✅
❌
Generate Case Brief
❌
❌
❌
✅
🛠️ Tech Stack
Frontend
Technology
Version
Purpose
React
19.2.0
UI Framework
TypeScript
5.9.3
Type Safety
Vite
7.2.4
Build Tool
TailwindCSS
4.1.18
Styling
React Router
7.11.0
Routing
Axios
1.13.2
HTTP Client
Recharts
2.15.1
Charts & Analytics
React Hot Toast
2.6.0
Notifications
jsPDF
3.0.4
PDF Generation
Backend
Technology
Version
Purpose
Node.js
≥18.0.0
Runtime
Express.js
4.21.2
Web Framework
TypeScript
5.7.2
Type Safety
Prisma
5.22.0
ORM
PostgreSQL
Latest
Database
JWT
9.0.2
Authentication
Bcrypt
6.0.0
Password Hashing
Cloudinary
2.8.0
File Storage
PDFKit
0.17.2
PDF Generation
Winston
3.17.0
Logging
Helmet
8.0.0
Security Headers
AI-POC
Technology
Version
Purpose
FastAPI
Latest
API Framework
Python
≥3.8
Runtime
pytesseract
Latest
OCR Engine
pdfplumber
Latest
PDF Parsing
spaCy
Latest
NER & NLP
FAISS
Latest
Vector Search
sentence-transformers
Latest
Embeddings
HuggingFace
Latest
LLM API
Jinja2
Latest
Templating
langdetect
Latest
Language Detection
📦 Installation
Prerequisites
Node.js ≥ 18.0.0
Python ≥ 3.8
PostgreSQL ≥ 14.0
Tesseract OCR (for AI features)
Quick Start (3 Terminals)
Terminal 1: Backend
cd backend
npm install
cp .env.example .env # Configure your variables
npm run db:generate
npm run db:migrate
npm run db:seed # Optional: Add sample data
npm run dev
Terminal 2: Frontend
cd client
npm install
cp .env.example .env
npm run dev
erDiagram
User ||--o{ Fir : registers
User ||--o{ CaseAssignment : assigns
PoliceStation ||--o{ Fir : has
Court ||--o{ CourtSubmission : receives
Fir ||--|| Case : creates
Case ||--|| CurrentCaseState : has
Case ||--o{ CaseStateHistory : tracks
Case ||--o{ InvestigationEvent : records
Case ||--o{ Evidence : contains
Case ||--o{ Witness : has
Case ||--o{ Accused : involves
Case ||--o{ Document : generates
Case ||--o{ CourtSubmission : submitted
Case ||--o{ CourtAction : receives
CourtSubmission ||--|| Acknowledgement : receives
Accused ||--o{ BailRecord : applies
Loading
Database Statistics
Category
Count
Tables
23
Enums
13
Relations
50+
Indexed Fields
35+
Core Tables
Table
Purpose
users
All system users with roles
police_stations
Police station registry
courts
Court registry
firs
First Information Reports
cases
Case records
current_case_states
Current state tracking
case_state_history
State transition history
investigation_events
Investigation activities
evidence
Evidence files & metadata
witnesses
Witness records
accused
Accused persons
documents
Legal documents
court_submissions
Submissions to court
court_actions
Court proceedings
case_briefs
AI-generated briefs
case_readiness_checks
Readiness analysis
document_validations
Validation records
📡 API Documentation
Authentication
All protected routes require JWT token:
Authorization: Bearer <your_jwt_token>
Core Endpoints
🔐 Authentication
POST /api/auth/register # Register new userPOST /api/auth/login # LoginGET /api/auth/me # Get current user
📋 FIR Management
POST /api/firs # Register FIRGET /api/firs # List FIRsGET /api/firs/:id # Get FIR details
📁 Case Management
GET /api/cases # List casesGET /api/cases/:id # Get case detailsPOST /api/cases/:id/assign # Assign caseGET /api/cases/:id/timeline # Get timeline
JusticeFlow is a comprehensive, AI-powered Case Management System designed to digitize and streamline the entire lifecycle of criminal cases in the Indian judicial system — from FIR registration to final judgment.