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
A blockchain-backed digital evidence management platform for law enforcement. Files are stored off-chain (local/IPFS); cryptographic hashes and custody records are anchored on Ethereum for tamper-proof auditability.
ARCHIVED and REJECTED are terminal states. Admins can force-archive from any state.
Sensitive Evidence (Multi-Sig Flow)
Evidence flagged isSensitive = true cannot be directly transferred. It requires:
Owner/admin calls POST /api/transfer-requests → creates a pending request
N admins call POST /api/transfer-requests/:id/approve (default N = 2)
Anyone calls POST /api/transfer-requests/:id/execute once approvals are met
The same logic is mirrored on-chain via requestTransfer → approveTransfer → executeTransfer.
Setup
Prerequisites
Node.js 18+
PostgreSQL database
(Optional) Ethereum wallet + Sepolia RPC for blockchain features
1. Install dependencies
npm install
cd Blockchain && npm install
2. Configure environment
# .env (root)DATABASE_URL="postgresql://user:pass@localhost:5432/evidence_db"JWT_SECRET="your-secret-key"CONTRACT_ADDRESS="0x..."# after deployingPRIVATE_KEY="your-wallet-key"# for blockchain writesRPC_URL="https://sepolia.rpc..."REQUIRED_APPROVALS=2# Blockchain/.envPRIVATE_KEY="your-wallet-key"CONTRACT_ADDRESS="0x..."TEST_ADMIN_WALLET="0x..."TEST_ADMIN_NAME="Admin Name"TEST_ADMIN_BADGE="BADGE-001"
3. Database setup
npx prisma migrate dev
npx prisma generate
4. Deploy smart contract (optional)
cd Blockchain
npx hardhat run scripts/deploy.ts --network sepolia
# Copy CONTRACT_ADDRESS from output to .env
npx hardhat run scripts/registerAdmin.ts --network sepolia
5. Run the app
npm run dev
Key API Endpoints
Auth
Method
Endpoint
Description
POST
/api/auth/register
Register new officer
POST
/api/auth/login
Login, returns JWT
GET
/api/auth/me
Current user profile
Cases
Method
Endpoint
Description
GET
/api/cases
List cases (paginated, filterable)
POST
/api/cases
Create case
GET
/api/cases/:id
Case detail + evidence list
PATCH
/api/cases/:id/status
Update case status
Evidence
Method
Endpoint
Description
GET
/api/evidence
List/search evidence
POST
/api/evidence
Upload evidence file (multipart)
GET
/api/evidence/:id
Detail + custody history + verifications
POST
/api/evidence/:id/transfer
Direct transfer (non-sensitive)
POST
/api/evidence/:id/verify
Verify with file upload
Transfer Requests (Sensitive)
Method
Endpoint
Description
POST
/api/transfer-requests
Create request
POST
/api/transfer-requests/:id/approve
Admin approve
POST
/api/transfer-requests/:id/execute
Execute once approved
POST
/api/transfer-requests/:id/cancel
Cancel request
Verification
Method
Endpoint
Description
POST
/verify/quick
Hash-only check, no blockchain write
POST
/verify/batch
Up to 50 items at once
Admin
Method
Endpoint
Description
GET
/api/admin/stats
System-wide statistics
GET
/api/admin/officers
List all officers
POST
/api/admin/officers/:id/deactivate
Deactivate officer
POST
/api/admin/officers/:id/reactivate
Reactivate officer
GET
/api/admin/audit-logs
System audit log
POST
/api/admin/evidence/:id/force-archive
Emergency archive
PATCH
/api/admin/evidence/:id/sensitive
Toggle sensitive flag
Smart Contract — EvidenceRegistry.sol
Deployed on Sepolia. Key properties:
No external dependencies — pure Solidity, no OpenZeppelin imports
File content is never stored on-chain; only the SHA-256 hash
Privacy-sensitive fields (description, location, name) stored as keccak256 hashes