A hybrid blockchain + cloud document verification platform targeting the Indian Background Verification (BGV) industry.
Core Principle: Blockchain for trust. Cloud for speed. Device for privacy.
Every time someone changes jobs in India, their entire career history is re-verified from scratch β a slow, expensive, and repetitive process. DocureChain introduces the BGV Chain: each document is verified once by the issuing institution, anchored on the Polygon blockchain, and reused across future employers with the person's consent. New employers only verify the latest record; everything before is already confirmed.
| Metric | Traditional BGV | DocureChain |
|---|---|---|
| Verification time | 9β14 days | 1β2 days |
| Repeated work | 100% | Only newest |
| Person controls data | β | β (consent) |
| Tamper-proof records | β | β (blockchain) |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND LAYER β
β ββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββ β
β β Mobile (Expo RN) β β Org Portal (Next.js 16 + TW4) β β
β β Wallet Β· Upload Β· QRβ β Landing Β· Person/Org Demo Views β β
β ββββββββββββ¬ββββββββββββ ββββββββββββββββ¬βββββββββββββββββββββ β
βββββββββββββββΌβββββββββββββββββββββββββββββββΌβββββββββββββββββββββββ€
β β API GATEWAY (:4000) β β
β β Express + http-proxy-middleware β
β β /api/v1/auth β Auth Service β
β β /api/v1/documents β Document Service β
β β /api/v1/verify β Verification Service β
βββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββ-β€
β MICROSERVICES β
β ββββββββββββ βββββββββββββ ββββββββββββββββ βββββββββββββββ β
β βAuth :4001β βDoc :4002 β βVerify :4003 β βNotif :4004 β β
β βExpress β βFastify β βExpress β βExpress β β
β βJWT + DID β βMultipart β βHash + QR + IDβ βRedis PubSub β β
β ββββββββββββ βBull Queue β ββββββββββββββββ βββββββββββββββ β
β βββββββββββββ ββββββββββββββββ β
β βAI Mail :4005 β β
β βOpenAI+Resend β β
β ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ-β€
β DATA LAYER β
β PostgreSQL (Prisma) Β· Redis Β· AWS S3 Β· IPFS/Pinata β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ-β€
β BLOCKCHAIN LAYER β
β Polygon (Hardhat Β· OpenZeppelin Upgradeable) β
β IdentityRegistry Β· DocumentRegistry Β· AccessControl β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Monorepo: Turborepo v2 + pnpm 9 workspaces
- Smart Contracts: Solidity 0.8.20, OpenZeppelin Upgradeable, Hardhat
- Frontend: Next.js 16 (App Router) + TailwindCSS v4, React Native (Expo)
- Backend: Express, Fastify, Prisma ORM, Bull queues, Redis
- AI: OpenAI (
gpt-4o) for verification email drafting - Email: Resend for transactional delivery
- Crypto: AES-256-GCM client-side encryption, SHA-256 hashing, DID:ethr identity
docurechain/
βββ apps/
β βββ mobile/ # Expo React Native β end-user wallet
β βββ org-portal/ # Next.js 16 β product landing & demo
β
βββ services/
β βββ api-gateway/ # Edge proxy bridging all microservices
β βββ auth-service/ # UUID/DID mapping, JWT signing
β βββ document-service/ # Fastify multipart S3/IPFS uploads + Bull queues
β βββ verification-service/ # Document hash, ID, and QR code verification
β βββ notification-service/ # Redis pub/sub push & email notifications
β βββ ai-mail-service/ # AI-drafted verification emails (OpenAI + Resend)
β
βββ packages/
β βββ crypto-utils/ # AES-256-GCM encryption, DID generation, SHA-256 hashing
β βββ shared-types/ # Common TypeScript interfaces
β
βββ blockchain/
β βββ contracts/
β βββ IdentityRegistry.sol # DID β address mapping, issuer registration
β βββ DocumentRegistry.sol # Anchor document hashes, revocation
β βββ AccessControl.sol # Time-limited verifier access tokens
β
βββ docker-compose.yml # PostgreSQL 15 + Redis 7
βββ Makefile # Dev, test, deploy, clean targets
βββ turbo.json # Turborepo pipeline config
βββ pnpm-workspace.yaml
| Contract | Purpose |
|---|---|
| IdentityRegistry | Maps DIDs to Ethereum addresses. Registers verified issuers (owner-only). |
| DocumentRegistry | Anchors SHA-256 hashes on-chain with owner DID, IPFS CID, doc type, and issuer. Supports revocation. |
| AccessControl | Grants time-limited access tokens to verifiers. Owner can revoke anytime. |
All contracts use OpenZeppelin Upgradeable proxies for future-proof deployment.
- Node.js β₯ 20
pnpmβ₯ 9.0- Docker & Docker Compose
cp .env.example .env
# Fill in: DATABASE_URL, REDIS_URL, JWT_SECRET, AWS/S3, Pinata,
# Polygon RPC, OPENAI_API_KEY, RESEND_API_KEY, etc.Spin up PostgreSQL and Redis containers:
make services-uppnpm install
pnpm run buildcd blockchain
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.ts --network mumbaiImportant: Update
.envwith the deployed addresses forIDENTITY_REGISTRY_ADDRESS,DOCUMENT_REGISTRY_ADDRESS, andACCESS_CONTROL_ADDRESS.
Boot every app and service via Turborepo:
make dev
# or: pnpm dev / turbo run dev| Service | Default Port |
|---|---|
| API Gateway | 4000 |
| Auth Service | 4001 |
| Document Service | 4002 |
| Verification Service | 4003 |
| Notification Service | 4004 |
| AI Mail Service | 4005 |
| Org Portal (Next.js) | 3000 |
The React Native app provides:
- Wallet Generation: Creates a secp256k1 keypair and DID:ethr identity, stored in
expo-secure-store - Encrypted Document Upload: Select from gallery β upload via API Gateway β anchor on-chain
- QR Code Verification: Scan any DocureChain QR to verify document authenticity against Polygon
cd apps/mobile
npx expo startRun the full test suite across the monorepo:
make test
# or: pnpm testIndividual services can be tested in isolation:
cd services/verification-service
pnpm test| Layer | Mechanism |
|---|---|
| Transport | Helmet headers, CORS, rate limiting on every service |
| Encryption | AES-256-GCM client-side β server never sees raw documents |
| Identity | DID:ethr decentralized identifiers, JWT-secured API paths |
| Blockchain | SHA-256 hashes anchored on Polygon β tamper-proof source of truth |
| Access | Time-limited on-chain access tokens; owner grants and revokes |
| Gateway | Express reverse proxy with per-IP rate limiting (300 req/min) |
| Command | Description |
|---|---|
make dev |
Start infra + all services |
make test |
Run monorepo-wide test suite |
make services-up |
Docker Compose up (PostgreSQL + Redis) |
make services-down |
Docker Compose down |
make deploy-contracts |
Deploy Solidity contracts to Polygon |
make clean |
Remove all node_modules, dist, .turbo |
Private β All rights reserved.