SHIELD is a secure, decentralized digital system designed to handle First Information Reports (FIR) and associated digital evidence for law enforcement and judicial systems.
By generating cryptographic hash values (SHA-256) at the exact time of submission, SHIELD ensures the absolute data integrity of digital evidence (CCTV footage, documents, images) and FIR records. It enables tamper detection and maintains a cryptographically verifiable chain of custody without relying on centralized, vulnerable storage systems.
- Architecture & Monorepo Structure: Learn how our 7 microservices connect.
- Database & Storage Architecture: Understand PostgreSQL/PostGIS, Blockchain Ledger, and MinIO details.
- Legal & Section 63 Compliance: Deep-dive into the Section 63/65B certificate generation and the cryptographic tamper lock.
- Contributing Guidelines: Please read this before opening a Pull Request!
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. The project is designed to be Cross-Platform (Windows, macOS, & Linux) compatible via Docker.
You will need the following installed on your machine:
- Docker Desktop (Must be running before starting the project)
- Node.js (LTS Version Recommended)
- Git
First, clone the repository and navigate into it:
git clone https://github.com/your-org/shield-project.git
cd shield-projectNext, run the root setup script. This uses concurrently to install the npm dependencies for all microservices simultaneously:
npm run setupSHIELD uses a single .env file at the root level which is injected into the Docker containers via docker-compose.yml.
Copy the example environment file and fill in any required development secrets:
cp .env.example .envEnsure that variables are set before proceeding.
(Note: Do not commit your .env file. It is ignored by Git.)
We use Docker Compose to orchestrate the infrastructure (PostgreSQL, MinIO, Blockchain) and the Node.js application services.
For a step-by-step walk-through of starting a fresh system, deploying the smart contract, and launching the services, please refer to the comprehensive Deployment & Setup Guide.
To start the entire cluster in development mode:
- Create the shared network:
docker network create --label "com.docker.compose.network=shield-network" --label "com.docker.compose.project=shield" --label "com.docker.compose.version=2" shield_shield-network
- Start the blockchain:
docker compose -f docker-compose.blockchain.yml up -d
- Deploy the smart contracts:
npx hardhat compile npx hardhat run scripts/deploy.js --network localnet
- Copy the printed contract addresses into your
.envasBLOCKCHAIN_FIR_CONTRACT_ADDRESSandBLOCKCHAIN_EVIDENCE_CONTRACT_ADDRESS. - Start the application stack:
docker compose up -d --build
To stop the cluster:
npm run stop && npm run blockchain:downSHIELD includes a centralized testing suite located in the /tests folder to verify the functionality of all services, enforce zero-trust constraints, and simulate security attacks.
For a detailed breakdown of the testing strategy, E2E assertions, and architecture, refer to the Testing Documentation.
Ensure that the Docker stack is running before executing these scripts.
npm run seed # Wipe and populate mock PG & MinIO data
npm run test:comprehensive # Primary E2E test suite (69 advanced assertions)
npm run test:tamper # Overwrite MinIO file directly and prove blockchain catches it
npm run watchdog:local # Run a local database/ledger integrity cycle
npm run test:manual # Run raw shell curl diagnostics
npm run test:contract # Run Hardhat Solidity unit tests (no Docker needed)
npm run test:blockchain # Run Docker blockchain network integration testsSHIELD runs a private 3-node Clique Proof-of-Authority (PoA) Ethereum network to anchor evidence hashes on-chain.
SHIELD uses a per-user cryptographic signature model to guarantee zero-trust chain of custody:
- Key Automation: When an administrator provisions a new officer, the system auto-generates a unique Ethereum wallet and encrypts its private key using AES-256-GCM under the
BLOCKCHAIN_ENCRYPTION_KEY. - Client-Side Signing: When an officer uploads evidence, the backend retrieves and decrypts their key, initializing an
ethers.Walletto sign transactions client-side before forwarding them to the ledger. - On-Chain Identity: The
registeredByfield in theShieldLedgersmart contract stores the unique public address of the specific officer who registered the evidence.
blockchain-network (isolated) shield-network (shared with app)
┌────────────────────────────────┐ ┌──────────────────────────────┐
│ blockchain-bootnode │ │ shield-ledger │
│ node-police ◄─────────────────┼─────────────► node-police (RPC: 8545) │
│ node-court ◄─────────────────┼─────────────► node-court (RPC: 8546) │
└────────────────────────────────┘ └──────────────────────────────┘
Refer to Deployment & Setup Guide for full setup details. Alternatively, start it directly with:
npm run blockchain:upnpm run blockchain:down
# or: docker compose -f docker-compose.blockchain.yml downNote: Blockchain chain data is persisted in
.docker-data/geth-*/. To start fresh, delete those directories before runningblockchain:up.
| Account | Address | Private Key Location |
|---|---|---|
| Police Institution | 0x80de6eF5a945D6Cc1DAd5375E3CeD4DF466e0384 |
blockchain/keystore/police-account.json |
| Court Institution | 0x01a08fc1e3c0EB8d2Be2301Ba36761485d1a2B4e |
blockchain/keystore/court-account.json |
Keystore password: shield-dev-password-2026 (dev only — zero-value chain, no real ETH).
Once running, the entire SHIELD application is unified behind an Nginx Reverse Proxy (shield-nginx) exposing the standard HTTP port 80.
Unified Entrypoint:
- Web App (Frontend):
http://localhost(Routes to React + Vite application) - API Gateway (Backend):
http://localhost/api/(Routes to BFF Gateway API)
Alternatively, you can access the individual microservices and databases directly at their respective ports:
Individual Microservices:
- Frontend (React + Vite dev server):
http://localhost:3000 - API Gateway (BFF):
http://localhost:3001 - Auth Service:
http://localhost:4000 - Evidence Service:
http://localhost:4001 - Ledger Service (Blockchain Node Wrapper):
http://localhost:4002
Infrastructure & Consoles:
- PostgreSQL Database (
db-users):5432 - MinIO Object Store (
minio-store):9000(Console Web UI athttp://localhost:9001)
- Ammar Rangwala
- Vishvambar Udavant
- Ish Chaniyara
- Ziyadali Sayed