Skip to content

notcaliper/TrueID

Repository files navigation

TrueID Logo

TrueID

Decentralized Biometric Identity System

License: MIT Node.js React PostgreSQL Avalanche Android

Secure biometric authentication backed by blockchain โ€” tamper-proof, privacy-first, and built for scale.

Watch Demo Try TrueID


Overview

TrueID combines biometric authentication with blockchain technology to create a tamper-proof, decentralized identity management system. Users register once, verify with their face, and carry a cryptographically-secured identity that no central authority can alter or revoke.


๐Ÿ“‘ Table of Contents

๐ŸŒŸ Key Features

Biometric
Biometric Auth
Secure face recognition
Blockchain
Blockchain
Immutable records
Privacy
Privacy
End-to-end encryption
Mobile
Mobile App
Cross-platform
Government
Gov Portal
Admin dashboard
Security
Security
Multi-factor auth

๐Ÿ“‹ System Overview

TrueID combines blockchain technology with biometric authentication to create a tamper-proof identity management system. The system consists of the following components:

๐Ÿ“ฑ 1. Android Mobile App
  • ๐Ÿ“ User Registration: Streamlined onboarding process
  • ๐Ÿ” Biometric Auth: ML Kit Face Detection integration
  • ๐Ÿ“Š Identity Management: Professional profile versioning
  • ๐Ÿ’Ž Blockchain Wallet: Secure transaction verification
  • ๐Ÿ”’ Data Security: Encrypted storage
  • ๐Ÿ“ก Offline Mode: Authentication without internet
  • ๐Ÿ“ฑ QR Codes: Easy identity sharing
  • ๐Ÿ“ธ CameraX: Advanced camera features
  • ๐Ÿ”„ Retrofit: Efficient API communication
๐Ÿ–ฅ๏ธ 2. Backend Server
  • ๐ŸŒ RESTful API: Node.js/Express.js endpoints
  • ๐Ÿ”‘ Auth System: JWT with refresh tokens
  • โ›“๏ธ Blockchain: Ethers.js integration
  • ๐Ÿ’พ Database: PostgreSQL operations
  • ๐Ÿ” Biometric: SHA-256 hashing
  • ๐Ÿ›ก๏ธ Security: Rate limiting & validation
  • ๐Ÿ”” Webhooks: Event notifications
  • ๐Ÿ›ก๏ธ Helmet: Enhanced security headers
  • ๐Ÿ“ Morgan: Request logging
โ›“๏ธ 3. Blockchain Layer
  • ๐Ÿ“œ Smart Contracts: Avalanche Fuji deployment
  • โœ๏ธ Multi-sig: Identity verification
  • ๐Ÿ“š History: Immutable records
  • โฑ๏ธ Audit Trail: Timestamp verification
  • ๐Ÿ‘ฅ Access Control: Role-based permissions
  • ๐Ÿ’ฐ Gas Optimization: Cost-effective transactions
๐ŸŒ 4. Frontend Web Application
  • โš›๏ธ React.js: Modern UI with Material UI
  • ๐Ÿ“ฑ Responsive: All device support
  • ๐Ÿ”— Web3: Blockchain integration
  • ๐Ÿ” Auth: Secure token management
  • ๐ŸŽจ UI/UX: User-friendly interface
  • ๐Ÿ”„ Real-time: Polling updates
๐Ÿ›๏ธ 5. Government Portal
  • โš›๏ธ React.js: Tailwind CSS dashboard
  • ๐Ÿ‘ฅ RBAC: Administrative hierarchy
  • ๐Ÿ“‹ Identity: Detailed user profiles
  • ๐Ÿ” Records: Search & filtering
  • ๐Ÿ“Š Analytics: Audit trail viewing
  • ๐Ÿ“ˆ Stats: Real-time visualization
  • ๐Ÿ› ๏ธ Dev Mode: Testing tools
  • โ™ฟ Accessibility: Headless UI
  • โœจ Animations: Framer Motion
๐Ÿ”ง 6. C Client
  • โšก Lightweight: Embedded systems
  • ๐Ÿ”Œ API Client: Backend integration
  • ๐Ÿ“ฆ Minimal: Few dependencies

๐Ÿ—๏ธ Architecture

TrueID Architecture
TrueID System Architecture

๐Ÿ“ Project Structure

TrueID/
โ”œโ”€โ”€ ๐Ÿ“ฑ android-app/         # Mobile application
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ app/            # Android source
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ src/        # Source code
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ build.gradle # Build config
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ gradle/         # Gradle wrapper
โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ backend/            # Node.js server
โ”‚   โ”œโ”€โ”€ โ›“๏ธ blockchain/     # Smart contracts
โ”‚   โ”œโ”€โ”€ โš™๏ธ config/         # Config files
โ”‚   โ”œโ”€โ”€ ๐ŸŽฎ controllers/    # API controllers
โ”‚   โ”œโ”€โ”€ ๐Ÿ”Œ middleware/     # Express middleware
โ”‚   โ”œโ”€โ”€ ๐Ÿ“Š models/         # Database models
โ”‚   โ”œโ”€โ”€ ๐Ÿ›ฃ๏ธ routes/         # API routes
โ”‚   โ”œโ”€โ”€ ๐Ÿ› ๏ธ services/       # Business logic
โ”‚   โ””โ”€โ”€ ๐Ÿงฐ utils/          # Utilities
โ”œโ”€โ”€ ๐Ÿ”ง c-client/           # C implementation
โ”œโ”€โ”€ ๐Ÿ’พ database/           # DB schemas
โ”œโ”€โ”€ ๐ŸŒ frontend/           # React web app
โ”œโ”€โ”€ ๐Ÿ›๏ธ government-portal/  # Admin dashboard
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ public/         # Static assets
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ src/            # React components
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ package.json    # Dependencies
โ””โ”€โ”€ ๐Ÿ“œ scripts/            # Utilities

๐Ÿš€ Getting Started

๐Ÿ“‹ Prerequisites

โš™๏ธ Installation

1. Clone
git clone https://github.com/notcaliper/TrueID.git
2. Backend
cd backend && npm install
3. Database
cd database && npm run migrate
4. Frontend
cd frontend && npm install
5. Portal
cd government-portal && npm install
6. Deploy
cd backend && npm run blockchain:deploy:fuji

โš™๏ธ Configuration

๐Ÿ” Environment Variables

Backend (.env)

# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:3000

# Database Configuration
DB_USER=your_db_user
DB_HOST=localhost
DB_NAME=trueid_db
DB_PASSWORD=your_db_password
DB_PORT=5432

# Authentication
JWT_SECRET=your_jwt_secret
JWT_EXPIRATION=1h
REFRESH_TOKEN_SECRET=your_refresh_token_secret
REFRESH_TOKEN_EXPIRATION=7d

# Blockchain
BLOCKCHAIN_RPC_URL=https://api.avax-test.network/ext/bc/C/rpc
CONTRACT_ADDRESS=your_contract_address
ADMIN_WALLET_PRIVATE_KEY=your_private_key

Frontend (.env)

# API Configuration
REACT_APP_API_URL=http://localhost:5000

# Blockchain Configuration
REACT_APP_AVALANCHE_CONTRACT_ADDRESS=your_contract_address
REACT_APP_AVALANCHE_NETWORK=fuji
REACT_APP_AVALANCHE_RPC_URL=https://api.avax-test.network/ext/bc/C/rpc

Government Portal (.env)

# Server Configuration
PORT=8000

# API Configuration
REACT_APP_API_URL=http://localhost:5000
REACT_APP_AVALANCHE_CONTRACT_ADDRESS=your_contract_address

๐Ÿƒโ€โ™‚๏ธ Running the System

Backend
cd backend && npm run dev
Frontend
cd frontend && npm start
Portal
cd government-portal && npm start
Dev Mode
cd government-portal && npm run dev:mock
Android
cd android-app && ./gradlew assembleDebug
Tests
npm run test

๐Ÿ›ก๏ธ Security Features

๐Ÿ”’ Data Protection
Biometric hashing
End-to-end encryption
๐Ÿ” Authentication
JWT with refresh
Multi-factor auth
โ›“๏ธ Blockchain
Immutable records
Smart contracts
๐Ÿ›ก๏ธ Access Control
Role-based permissions
Rate limiting
๐Ÿ“œ Compliance
Data protection
Security audits
๐Ÿ” Monitoring
Audit trails
Activity logging

๐Ÿ‘จโ€๐Ÿ’ป Development Guidelines

๐Ÿ“ Code Style

๐ŸŽจ Formatting
ESLint & Prettier
๐Ÿ“š Style Guide
Airbnb JavaScript
๐Ÿ“˜ TypeScript
Type safety
โœ… Testing
Unit tests
๐Ÿ“– Documentation
API docs
๐Ÿ” Code Review
Peer review

๐Ÿ”„ Git Workflow

๐ŸŒฟ Branches
Feature branches
๐Ÿ‘ฅ Reviews
PR reviews
๐Ÿ“ Commits
Conventional

๐Ÿงช Testing

๐Ÿงช Unit
Jest
๐Ÿ”„ Integration
Supertest
๐ŸŒ E2E
Cypress
๐Ÿ“ฑ Mobile
Espresso
โ›“๏ธ Smart Contracts
Hardhat
๐Ÿ“Š Coverage
Reports

๐Ÿค Contributing

1. ๐Ÿด Fork
Clone the repo
2. ๐ŸŒฟ Branch
Create feature branch
3. ๐Ÿ’พ Commit
Make changes
4. ๐Ÿ“ค Push
To your branch
5. ๐Ÿ”„ PR
Create pull request
6. โœ… Review
Address feedback

๐Ÿ’ฌ Support


๐Ÿ› ๏ธ Backend Interactive Setup Tool

TrueID provides an interactive setup wizard to simplify backend configuration, database setup, blockchain contract deployment, and admin creation.

๐Ÿš€ Quickstart (Recommended)

cd backend
npm run setup
# or
node setup.js

What the setup tool does:

  • Installs all backend dependencies (if needed)
  • Asks for PostgreSQL connection info and tests the connection
  • Creates the database if it doesn't exist
  • Runs the schema and migrations
  • Configures JWT secrets (auto-generates or lets you enter your own)
  • Asks for Avalanche wallet private key and derives the address
  • Optionally deploys the smart contract to Avalanche Fuji testnet
  • Creates the initial admin account (argon2-hashed password)
  • Writes the complete .env file (backs up old one if present)
  • Prints a summary and next steps

You can re-run the setup tool any time to update your configuration.


TrueID Banner

Made with โค๏ธ by Akshay

Copyright ยฉ 2026 TrueID. All rights reserved.

About

TrueID is a blockchain-powered decentralized identity system that combines biometric authentication (facemesh recognition) with secure smart contracts to create tamper-proof professional and personal identities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors