feat: Goa GEL Blockchain e-Licensing Platform - Full Stack Implementation
Complete implementation of the Goa Government e-Licensing platform with: Backend: - NestJS API with JWT authentication - PostgreSQL database with Knex ORM - Redis caching and session management - MinIO document storage - Hyperledger Besu blockchain integration - Multi-department workflow system - Comprehensive API tests (266/282 passing) Frontend: - Angular 21 with standalone components - Angular Material + TailwindCSS UI - Visual workflow builder - Document upload with progress tracking - Blockchain explorer integration - Role-based dashboards (Admin, Department, Citizen) - E2E tests with Playwright (37 tests) Infrastructure: - Docker Compose orchestration - Blockscout blockchain explorer - Development and production configurations
This commit is contained in:
268
docs/guides/INITIALIZATION_GUIDE.md
Normal file
268
docs/guides/INITIALIZATION_GUIDE.md
Normal file
@@ -0,0 +1,268 @@
|
||||
# 🚀 Goa-GEL Automatic Initialization Guide
|
||||
|
||||
This guide explains the automatic initialization process that runs when you start the Goa-GEL platform for the first time.
|
||||
|
||||
---
|
||||
|
||||
## 📋 What Happens on First Boot?
|
||||
|
||||
When you run `docker-compose up` for the first time, the backend automatically:
|
||||
|
||||
### 1. **Database Initialization** 📊
|
||||
- ✅ Waits for PostgreSQL to be ready
|
||||
- ✅ Runs all database migrations
|
||||
- ✅ Seeds initial data (admin user, sample departments, workflows)
|
||||
|
||||
### 2. **Blockchain Setup** 🔗
|
||||
- ✅ Generates a secure platform wallet with mnemonic
|
||||
- ✅ Funds the wallet from the dev network
|
||||
- ✅ Deploys all smart contracts:
|
||||
- License NFT Contract
|
||||
- Approval Manager Contract
|
||||
- Department Registry Contract
|
||||
- Workflow Registry Contract
|
||||
- ✅ Updates `.env` file with generated addresses
|
||||
|
||||
### 3. **Environment Configuration** 🔐
|
||||
- ✅ Generates secure keys and addresses
|
||||
- ✅ Updates `backend/.env` automatically
|
||||
- ✅ No manual configuration needed!
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Quick Start
|
||||
|
||||
```bash
|
||||
# 1. Start all services
|
||||
docker-compose up -d
|
||||
|
||||
# 2. Wait 1-2 minutes for initialization
|
||||
# Watch the logs to see progress
|
||||
docker-compose logs -f api
|
||||
|
||||
# 3. Access the platform
|
||||
open http://localhost:4200
|
||||
```
|
||||
|
||||
**That's it!** Everything is configured automatically.
|
||||
|
||||
---
|
||||
|
||||
## 📝 Generated Values
|
||||
|
||||
After initialization, check `backend/.env` for:
|
||||
|
||||
```bash
|
||||
# Platform Wallet (Generated)
|
||||
PLATFORM_WALLET_ADDRESS=0x...
|
||||
PLATFORM_WALLET_PRIVATE_KEY=0x...
|
||||
PLATFORM_WALLET_MNEMONIC=word word word...
|
||||
|
||||
# Smart Contract Addresses (Deployed)
|
||||
CONTRACT_ADDRESS_LICENSE_NFT=0x...
|
||||
CONTRACT_ADDRESS_APPROVAL_MANAGER=0x...
|
||||
CONTRACT_ADDRESS_DEPARTMENT_REGISTRY=0x...
|
||||
CONTRACT_ADDRESS_WORKFLOW_REGISTRY=0x...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Initialization Logs
|
||||
|
||||
Watch the initialization process:
|
||||
|
||||
```bash
|
||||
# View API logs
|
||||
docker-compose logs -f api
|
||||
```
|
||||
|
||||
You'll see:
|
||||
```
|
||||
🚀 Starting Goa-GEL Backend Initialization...
|
||||
📊 Step 1: Database initialization...
|
||||
✅ PostgreSQL is up
|
||||
📦 First time setup - running migrations...
|
||||
🌱 Seeding initial data...
|
||||
✅ Database initialized successfully!
|
||||
🔗 Step 2: Blockchain initialization...
|
||||
🔐 Generating platform wallet...
|
||||
📝 Platform Wallet Address: 0x...
|
||||
💰 Funding platform wallet...
|
||||
📜 Deploying smart contracts...
|
||||
✅ Blockchain initialization complete!
|
||||
🎯 Step 3: Starting NestJS application...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🗃️ Seeded Data
|
||||
|
||||
The database is automatically seeded with:
|
||||
|
||||
### Admin User
|
||||
- **Email**: `admin@goa.gov.in`
|
||||
- **Password**: `Admin@123` (Change after first login!)
|
||||
- **Role**: ADMIN
|
||||
|
||||
### Sample Departments
|
||||
1. **Tourism Department** (TOURISM)
|
||||
2. **Trade Department** (TRADE)
|
||||
3. **Health Department** (HEALTH)
|
||||
|
||||
### Sample Workflows
|
||||
- Resort License Workflow (Tourism + Health)
|
||||
- Trade License Workflow (Trade + Health)
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Re-initialization
|
||||
|
||||
If you need to re-initialize:
|
||||
|
||||
```bash
|
||||
# Stop and remove everything
|
||||
docker-compose down -v
|
||||
|
||||
# Start fresh (will auto-initialize)
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
**Warning**: This deletes all data!
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Security Notes
|
||||
|
||||
### Development Environment
|
||||
- Uses pre-funded dev account for deployment
|
||||
- Generates random mnemonics
|
||||
- All values are visible in logs (for debugging)
|
||||
|
||||
### Production Environment
|
||||
**Before deploying to production:**
|
||||
|
||||
1. ✅ Change admin password immediately
|
||||
2. ✅ Backup the mnemonic phrase securely
|
||||
3. ✅ Store private keys in secret management (Vault, AWS Secrets)
|
||||
4. ✅ Disable debug logging
|
||||
5. ✅ Use proper firewall rules
|
||||
6. ✅ Enable SSL/TLS
|
||||
7. ✅ Rotate API keys regularly
|
||||
|
||||
---
|
||||
|
||||
## 📊 Verification
|
||||
|
||||
### Check Database
|
||||
```bash
|
||||
docker exec -it goa-gel-postgres psql -U postgres -d goa_gel_platform -c "\dt"
|
||||
```
|
||||
|
||||
### Check Blockchain
|
||||
```bash
|
||||
# Get block number
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
|
||||
http://localhost:8545
|
||||
|
||||
# View in Blockscout
|
||||
open http://localhost:4000
|
||||
```
|
||||
|
||||
### Check Contracts
|
||||
```bash
|
||||
# View deployed contracts in .env
|
||||
cat backend/.env | grep CONTRACT_ADDRESS
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Manual Initialization (if needed)
|
||||
|
||||
If automatic initialization fails:
|
||||
|
||||
```bash
|
||||
# 1. Enter the API container
|
||||
docker exec -it goa-gel-api sh
|
||||
|
||||
# 2. Run migrations manually
|
||||
npm run migrate:latest
|
||||
|
||||
# 3. Run seeds
|
||||
npm run seed:run
|
||||
|
||||
# 4. Deploy contracts
|
||||
node scripts/init-blockchain.js
|
||||
|
||||
# 5. Restart the API
|
||||
docker-compose restart api
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📞 Troubleshooting
|
||||
|
||||
### "Database initialization failed"
|
||||
- **Check**: PostgreSQL is running
|
||||
- **Solution**: `docker-compose restart postgres`
|
||||
|
||||
### "Blockchain not available"
|
||||
- **Check**: Besu node is running and mining
|
||||
- **Solution**: `docker-compose restart besu-node-1`
|
||||
- **Verify**: `curl http://localhost:8545`
|
||||
|
||||
### "Contract deployment failed"
|
||||
- **Check**: Besu node logs
|
||||
- **Solution**: Ensure node is mining blocks
|
||||
- **Retry**: `docker-compose restart api`
|
||||
|
||||
### ".env file not updated"
|
||||
- **Check**: File permissions
|
||||
- **Solution**: Ensure `backend/.env` is writable
|
||||
- **Manual**: Copy values from logs to `.env`
|
||||
|
||||
---
|
||||
|
||||
## 🎯 What Gets Persisted?
|
||||
|
||||
### Persistent Data (Survives restart)
|
||||
✅ Database data (in `postgres_data` volume)
|
||||
✅ Blockchain data (in `besu_data` volume)
|
||||
✅ MinIO files (in `minio_data` volume)
|
||||
✅ `.env` file (in `backend/.env`)
|
||||
✅ Initialization flag (in `api_data` volume)
|
||||
|
||||
### Ephemeral Data (Lost on `docker-compose down -v`)
|
||||
❌ All of the above (with `-v` flag)
|
||||
|
||||
---
|
||||
|
||||
## 📚 Related Documentation
|
||||
|
||||
- **User Guide**: `/viewer.html?doc=USER_GUIDE`
|
||||
- **Testing Guide**: `/viewer.html?doc=E2E_TESTING_GUIDE`
|
||||
- **Architecture**: `ARCHITECTURE_GUIDE.md`
|
||||
- **Deployment**: `DOCKER_SETUP.md`
|
||||
|
||||
---
|
||||
|
||||
## ✅ Checklist
|
||||
|
||||
After successful initialization, you should have:
|
||||
|
||||
- [x] All 9 services running
|
||||
- [x] Database migrated and seeded
|
||||
- [x] Smart contracts deployed
|
||||
- [x] Platform wallet generated
|
||||
- [x] `.env` file populated
|
||||
- [x] Admin user created
|
||||
- [x] Sample departments created
|
||||
- [x] Frontend accessible at http://localhost:4200
|
||||
|
||||
**Status**: Ready for development! 🎉
|
||||
|
||||
---
|
||||
|
||||
**Version**: 1.0.0
|
||||
**Last Updated**: February 2026
|
||||
**Auto-Initialization**: Enabled ✅
|
||||
151
docs/guides/PRESENTATION_README.md
Normal file
151
docs/guides/PRESENTATION_README.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# Goa GEL Blockchain Document Verification Platform
|
||||
## Stakeholder Presentation
|
||||
|
||||
### File Information
|
||||
- **Filename:** `Goa-GEL-Architecture-Presentation.pptx`
|
||||
- **Location:** `/sessions/cool-elegant-faraday/mnt/Goa-GEL/`
|
||||
- **Size:** 294 KB
|
||||
- **Format:** Microsoft PowerPoint (PPTX, 16:9 aspect ratio)
|
||||
- **Total Slides:** 17
|
||||
- **Created:** February 4, 2026
|
||||
|
||||
### Presentation Overview
|
||||
|
||||
This professional stakeholder presentation provides a comprehensive overview of the Goa GEL (Government E-Ledger) Blockchain Document Verification Platform. It covers technical architecture, implementation strategy, and project scope for government decision-makers and technical stakeholders.
|
||||
|
||||
### Slide Structure
|
||||
|
||||
#### Opening (Slides 1-2)
|
||||
- **Slide 1:** Title slide with professional branding
|
||||
- **Slide 2:** Agenda outlining all presentation topics
|
||||
|
||||
#### Problem & Solution (Slides 3-5)
|
||||
- **Slide 3:** Problem Statement - 4 key challenges
|
||||
- **Slide 4:** Solution Overview - 4 core capabilities
|
||||
- **Slide 5:** National Blockchain Framework Alignment
|
||||
|
||||
#### Technical Architecture (Slides 6-9)
|
||||
- **Slide 6:** High-level system architecture
|
||||
- **Slide 7:** Blockchain architecture with Hyperledger Besu details
|
||||
- **Slide 8:** Smart contract design (ERC-721 NFT-based)
|
||||
- **Slide 9:** Technology stack overview
|
||||
|
||||
#### Implementation Details (Slides 10-13)
|
||||
- **Slide 10:** Workflow engine for multi-department approvals
|
||||
- **Slide 11:** End-to-end data flow and integration
|
||||
- **Slide 12:** Security architecture (3-layer defense)
|
||||
- **Slide 13:** Deployment architecture with Docker Compose
|
||||
|
||||
#### Project Scope & Planning (Slides 14-16)
|
||||
- **Slide 14:** POC scope - in-scope vs out-of-scope features
|
||||
- **Slide 15:** Success criteria with measurable metrics
|
||||
- **Slide 16:** 8-week timeline with phased milestones
|
||||
|
||||
#### Closing (Slide 17)
|
||||
- **Slide 17:** Q&A engagement slide
|
||||
|
||||
### Key Content Areas
|
||||
|
||||
#### Problem Statement
|
||||
- Fragmented online/offline mechanisms
|
||||
- Lack of trust and transparency
|
||||
- Poor document traceability
|
||||
- Risk of document tampering
|
||||
|
||||
#### Solution Approach
|
||||
- Single tamper-proof blockchain ledger
|
||||
- Multi-stakeholder consensus mechanism
|
||||
- End-to-end process traceability
|
||||
- REST API for system interoperability
|
||||
|
||||
#### Technical Highlights
|
||||
- **Frontend:** Next.js 14 with React & TypeScript
|
||||
- **Backend:** NestJS with TypeScript
|
||||
- **Database:** PostgreSQL with Redis caching
|
||||
- **Storage:** MinIO (S3-compatible)
|
||||
- **Blockchain:** Hyperledger Besu with QBFT consensus
|
||||
- **Smart Contracts:** ERC-721 Soulbound tokens for licenses
|
||||
|
||||
#### Implementation Timeline
|
||||
- **Phase 1 (Weeks 1-2):** Architecture setup
|
||||
- **Phase 2 (Weeks 3-4):** Core development
|
||||
- **Phase 3 (Weeks 5-6):** Integration & testing
|
||||
- **Phase 4 (Weeks 7-8):** POC demonstration
|
||||
|
||||
### Design Specifications
|
||||
|
||||
#### Color Palette
|
||||
- **Primary:** Deep Blue (#0F4C81) - Government trust
|
||||
- **Secondary:** Teal Blue (#1B7BAA) - Technology & innovation
|
||||
- **Accent:** Bright Cyan (#00B4D8) - Highlights & actions
|
||||
- **Background:** Light Gray (#F0F4F8) - Clean, professional
|
||||
- **Text:** Dark Gray (#1A1A1A) - High contrast readability
|
||||
|
||||
#### Typography
|
||||
- **Font Family:** Calibri
|
||||
- **Title Size:** 36-44pt bold
|
||||
- **Body Size:** 11-16pt
|
||||
- **Consistent hierarchy** throughout
|
||||
|
||||
#### Visual Design
|
||||
- Professional drop shadows on content cards
|
||||
- Colored accent bars for section titles
|
||||
- Varied layouts (no repetition)
|
||||
- Process flow diagrams and visual hierarchies
|
||||
- Large metric callouts for key statistics
|
||||
- Proper spacing and margins (0.5"+ from edges)
|
||||
|
||||
### Usage Recommendations
|
||||
|
||||
**Best For:**
|
||||
- Government stakeholder meetings
|
||||
- Technical architecture reviews
|
||||
- Project approval presentations
|
||||
- Budget justification sessions
|
||||
- Team onboarding & training
|
||||
- Partner/investor briefings
|
||||
|
||||
**Presentation Format:**
|
||||
- Designed for projector/screen presentation
|
||||
- 16:9 widescreen format
|
||||
- Professional appearance for formal settings
|
||||
- Readable from 15+ feet away
|
||||
|
||||
**Key Messages:**
|
||||
1. Problem clearly identified and articulated
|
||||
2. Solution aligns with National Blockchain Framework
|
||||
3. Architecture proven and tested technologies
|
||||
4. Timeline realistic with clear milestones
|
||||
5. Success criteria measurable and achievable
|
||||
|
||||
### Files Included
|
||||
|
||||
- `Goa-GEL-Architecture-Presentation.pptx` - Final presentation
|
||||
- `create_presentation.js` - Source code for presentation generation
|
||||
- `PRESENTATION_README.md` - This file
|
||||
|
||||
### Technical Notes
|
||||
|
||||
- Created using PptxGenJS (Node.js library)
|
||||
- All color codes in standard hex format (no # prefix)
|
||||
- Fresh object instances used to prevent mutations
|
||||
- Proper text formatting with breakLine for multi-line content
|
||||
- Valid PPTX format verified
|
||||
- No placeholder or Lorem Ipsum text
|
||||
|
||||
### Quality Assurance
|
||||
|
||||
✓ All 17 slides created and verified
|
||||
✓ Content completeness checked
|
||||
✓ Design consistency validated
|
||||
✓ Technical specifications accurate
|
||||
✓ Professional appearance confirmed
|
||||
✓ No overlapping elements
|
||||
✓ Proper text contrast
|
||||
✓ Clean spacing hierarchy
|
||||
✓ Ready for immediate presentation
|
||||
|
||||
---
|
||||
|
||||
**Status:** Ready for Stakeholder Presentation
|
||||
**Last Updated:** February 4, 2026
|
||||
366
docs/guides/QUICK_START.md
Normal file
366
docs/guides/QUICK_START.md
Normal file
@@ -0,0 +1,366 @@
|
||||
# Goa GEL - Quick Start Guide
|
||||
|
||||
## 🚀 5-Minute Overview
|
||||
|
||||
The **Goa Government E-License (GEL) Platform** is a blockchain-based document verification system that enables multi-department approval workflows for government licenses using:
|
||||
|
||||
- **Hyperledger Besu** (blockchain)
|
||||
- **NestJS** (backend API)
|
||||
- **Next.js** (frontend)
|
||||
- **PostgreSQL** + **MinIO** (data storage)
|
||||
- **QBFT Consensus** (4 validators)
|
||||
- **ERC-721 Soulbound NFTs** (license certificates)
|
||||
|
||||
---
|
||||
|
||||
## 📂 What's in This Directory?
|
||||
|
||||
```
|
||||
/sessions/cool-elegant-faraday/mnt/Goa-GEL/
|
||||
├── 6 Mermaid Diagrams (.mermaid files)
|
||||
├── 6 HTML Preview Files (.html files)
|
||||
├── 3 Documentation Files (.md files)
|
||||
└── 3 Utility Scripts (.js files)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Start Here (Choose Your Role)
|
||||
|
||||
### I'm a Project Manager / Non-Technical Stakeholder
|
||||
1. Open `system-context.html` in your browser
|
||||
2. Read `INDEX.md` - Section "Diagram Descriptions"
|
||||
3. Reference `ARCHITECTURE_GUIDE.md` - Sections 1, 7, 8
|
||||
|
||||
**Time: 15 minutes**
|
||||
|
||||
### I'm a Backend Developer
|
||||
1. Open `container-architecture.html`
|
||||
2. Read `ARCHITECTURE_GUIDE.md` - Sections 2, 3, 5, 6
|
||||
3. Study the smart contract details in Section 3
|
||||
4. Review data flow in Section 5
|
||||
|
||||
**Time: 45 minutes**
|
||||
|
||||
### I'm a Frontend Developer
|
||||
1. Open `system-context.html`
|
||||
2. Read `ARCHITECTURE_GUIDE.md` - Section 2 (Frontend Layer only)
|
||||
3. Review `container-architecture.html`
|
||||
4. Check deployment in Section 6
|
||||
|
||||
**Time: 20 minutes**
|
||||
|
||||
### I'm a DevOps / Infrastructure Engineer
|
||||
1. Open `deployment-architecture.html`
|
||||
2. Read `ARCHITECTURE_GUIDE.md` - Section 6 (Deployment)
|
||||
3. Review Docker Compose configuration details
|
||||
4. Check Section 3 for blockchain node setup
|
||||
|
||||
**Time: 30 minutes**
|
||||
|
||||
### I'm a Blockchain / Smart Contract Developer
|
||||
1. Open `blockchain-architecture.html`
|
||||
2. Read `ARCHITECTURE_GUIDE.md` - Section 3 (Blockchain Deep Dive)
|
||||
3. Study the 4 smart contracts section
|
||||
4. Review on-chain vs off-chain data split
|
||||
|
||||
**Time: 40 minutes**
|
||||
|
||||
### I'm a QA / Tester
|
||||
1. Open `workflow-state-machine.html`
|
||||
2. Open `data-flow.html`
|
||||
3. Read `ARCHITECTURE_GUIDE.md` - Sections 4 (Workflows) and 5 (Data Flow)
|
||||
4. Create test cases based on the 11-step process
|
||||
|
||||
**Time: 35 minutes**
|
||||
|
||||
---
|
||||
|
||||
## 📊 View Diagrams
|
||||
|
||||
### Browser Preview (Easiest)
|
||||
|
||||
Open any .html file in your web browser:
|
||||
|
||||
```bash
|
||||
# Linux/Mac
|
||||
firefox system-context.html
|
||||
|
||||
# Or
|
||||
google-chrome container-architecture.html
|
||||
|
||||
# Or (macOS)
|
||||
open workflow-state-machine.html
|
||||
```
|
||||
|
||||
### Mermaid Live (Online, Interactive)
|
||||
|
||||
1. Go to https://mermaid.live
|
||||
2. Copy content from any .mermaid file
|
||||
3. Paste into editor
|
||||
4. View instant diagram
|
||||
5. Download as PNG/SVG
|
||||
|
||||
### Export to PNG (if needed)
|
||||
|
||||
See `README.md` for 5 different methods:
|
||||
- **Method 1**: Mermaid Live (easiest)
|
||||
- **Method 2**: NPM CLI
|
||||
- **Method 3**: Docker
|
||||
- **Method 4**: Browser screenshot
|
||||
- **Method 5**: Kroki.io API
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ Architecture at a Glance
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────┐
|
||||
│ USERS / STAKEHOLDERS │
|
||||
│ Citizens • Departments • Approvers • Admins │
|
||||
└──────────────────┬──────────────────────────────────┘
|
||||
│
|
||||
┌──────────────────▼──────────────────────────────────┐
|
||||
│ FRONTEND (Next.js) │
|
||||
│ Port 3000 • shadcn/ui • Tailwind │
|
||||
└──────────────────┬──────────────────────────────────┘
|
||||
│
|
||||
┌──────────────────▼──────────────────────────────────┐
|
||||
│ API GATEWAY (NestJS) │
|
||||
│ Port 3001 • Auth • Workflow • Approvals │
|
||||
└──────────────────┬──────────────────────────────────┘
|
||||
│
|
||||
┌──────────────┼──────────────┬──────────────┐
|
||||
│ │ │ │
|
||||
┌───▼────┐ ┌────▼────┐ ┌────▼────┐ ┌────▼────┐
|
||||
│PostgreSQL │ Redis │ │ MinIO │ │ Besu │
|
||||
│(5432) │ (6379) │ │ (9000) │ │(8545+) │
|
||||
│Database │ Cache │ │ Storage │ │Blockchain
|
||||
└──────────┘ └────────┘ └────────┘ └────────┘
|
||||
```
|
||||
|
||||
**Key Components**:
|
||||
- Frontend: React UI for users
|
||||
- Backend: NestJS for business logic
|
||||
- Database: PostgreSQL for structured data
|
||||
- Cache: Redis for real-time state
|
||||
- Storage: MinIO for documents
|
||||
- Blockchain: Besu for immutable records
|
||||
|
||||
---
|
||||
|
||||
## 🔄 License Approval Flow (11 Steps)
|
||||
|
||||
```
|
||||
1. Citizen Creates License Request
|
||||
└─> Upload documents (PDF, images, etc.)
|
||||
|
||||
2. Documents Hashed
|
||||
└─> SHA-256 hash of each document
|
||||
|
||||
3. Blockchain Recording
|
||||
└─> Hash recorded on Besu (QBFT consensus)
|
||||
|
||||
4. Route to Departments
|
||||
└─> Tourism + Fire Safety (parallel)
|
||||
|
||||
5-6. Departments Receive Notifications
|
||||
└─> Ready for review
|
||||
|
||||
7-8. Departments Approve (Parallel)
|
||||
└─> Record approvals on blockchain
|
||||
|
||||
9. NFT Minting
|
||||
└─> ERC-721 Soulbound license certificate
|
||||
|
||||
10. Notifications Sent
|
||||
└─> Citizen receives approval
|
||||
|
||||
11. Verification
|
||||
└─> Anyone can verify on blockchain
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⛓️ Blockchain Details
|
||||
|
||||
### Consensus
|
||||
- **Type**: QBFT (Quorum Byzantine Fault Tolerant)
|
||||
- **Validators**: 4 nodes
|
||||
- **Requirement**: 3/4 (75%) agreement
|
||||
- **Block Time**: ~12 seconds
|
||||
- **Network**: Private permissioned
|
||||
|
||||
### Smart Contracts (4)
|
||||
|
||||
| Contract | Purpose | Key Functions |
|
||||
|----------|---------|---|
|
||||
| LicenseRequestNFT | Issue licenses as NFTs | mint(), burn(), ownerOf() |
|
||||
| ApprovalManager | Record approvals | recordApproval(), getApprovalChain() |
|
||||
| DepartmentRegistry | Manage departments | registerDept(), setApprovers() |
|
||||
| WorkflowRegistry | Define workflows | defineWorkflow(), getWorkflow() |
|
||||
|
||||
### Data Strategy
|
||||
|
||||
**On-Chain** (Immutable & Verifiable):
|
||||
- License hashes
|
||||
- Approval signatures
|
||||
- Department registry
|
||||
- NFT ownership
|
||||
|
||||
**Off-Chain** (Searchable & Scalable):
|
||||
- Full document details
|
||||
- Applicant information
|
||||
- Actual document files
|
||||
- Workflow state
|
||||
|
||||
**Link**: SHA-256 hash bridges both worlds
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Get Started
|
||||
|
||||
### Step 1: View a Diagram
|
||||
```bash
|
||||
# Open system-context.html in your browser
|
||||
open /sessions/cool-elegant-faraday/mnt/Goa-GEL/system-context.html
|
||||
```
|
||||
|
||||
### Step 2: Read Documentation
|
||||
- Start: `INDEX.md` (this is your navigation guide)
|
||||
- Quick overview: `README.md`
|
||||
- Deep dive: `ARCHITECTURE_GUIDE.md` (sections based on your role)
|
||||
|
||||
### Step 3: Understand Your Domain
|
||||
- **Frontend Dev**: See container-architecture.html (Frontend section)
|
||||
- **Backend Dev**: See container-architecture.html (API section)
|
||||
- **Blockchain Dev**: See blockchain-architecture.html
|
||||
- **DevOps**: See deployment-architecture.html
|
||||
|
||||
### Step 4: Plan Implementation
|
||||
Use the detailed architecture guide to plan your specific implementation.
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation Files Explained
|
||||
|
||||
| File | Best For | Read Time |
|
||||
|------|----------|-----------|
|
||||
| `INDEX.md` | Navigation & overview | 10 min |
|
||||
| `README.md` | Quick reference | 8 min |
|
||||
| `ARCHITECTURE_GUIDE.md` | Deep technical details | 30 min |
|
||||
| `QUICK_START.md` | This file - getting oriented | 5 min |
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Learning Path (Recommended)
|
||||
|
||||
### For Everyone (Required)
|
||||
1. ✓ Read this file (QUICK_START.md)
|
||||
2. ✓ Open system-context.html in browser
|
||||
3. ✓ Read INDEX.md
|
||||
|
||||
**Time: 20 minutes**
|
||||
|
||||
### Role-Specific (Choose One)
|
||||
**Backend Developers**:
|
||||
- container-architecture.html
|
||||
- ARCHITECTURE_GUIDE.md - Sections 2, 3, 5, 6
|
||||
- Database schema in Section 3
|
||||
|
||||
**Frontend Developers**:
|
||||
- container-architecture.html (Frontend section)
|
||||
- deployment-architecture.html
|
||||
- ARCHITECTURE_GUIDE.md - Section 2
|
||||
|
||||
**Blockchain Developers**:
|
||||
- blockchain-architecture.html
|
||||
- ARCHITECTURE_GUIDE.md - Section 3
|
||||
- Smart contracts overview
|
||||
|
||||
**DevOps Engineers**:
|
||||
- deployment-architecture.html
|
||||
- ARCHITECTURE_GUIDE.md - Section 6
|
||||
- Docker Compose details
|
||||
|
||||
---
|
||||
|
||||
## ❓ Common Questions
|
||||
|
||||
**Q: Where do I start?**
|
||||
A: Open `system-context.html` in your browser for a visual overview.
|
||||
|
||||
**Q: How do I convert diagrams to PNG?**
|
||||
A: See `README.md` - 5 different methods listed (Mermaid Live is easiest).
|
||||
|
||||
**Q: What's the technology stack?**
|
||||
A: See section "Technology Stack Summary" in INDEX.md or ARCHITECTURE_GUIDE.md appendix.
|
||||
|
||||
**Q: How does blockchain integration work?**
|
||||
A: See data-flow.html (Steps 3, 9) and ARCHITECTURE_GUIDE.md Section 3.
|
||||
|
||||
**Q: What's the deployment process?**
|
||||
A: See deployment-architecture.html and ARCHITECTURE_GUIDE.md Section 6.
|
||||
|
||||
**Q: How many smart contracts are there?**
|
||||
A: 4 contracts: LicenseRequestNFT, ApprovalManager, DepartmentRegistry, WorkflowRegistry.
|
||||
|
||||
**Q: Can I run this locally?**
|
||||
A: Yes, see deployment-architecture.html for Docker Compose setup.
|
||||
|
||||
**Q: How does multi-department approval work?**
|
||||
A: See workflow-state-machine.html and data-flow.html (Steps 5-8).
|
||||
|
||||
---
|
||||
|
||||
## 📞 File Manifest
|
||||
|
||||
```
|
||||
Core Diagrams (6 files):
|
||||
├── system-context.mermaid (40 lines)
|
||||
├── container-architecture.mermaid (64 lines)
|
||||
├── blockchain-architecture.mermaid (75 lines)
|
||||
├── workflow-state-machine.mermaid (65 lines)
|
||||
├── data-flow.mermaid (105 lines)
|
||||
└── deployment-architecture.mermaid (102 lines)
|
||||
|
||||
HTML Previews (6 files):
|
||||
├── system-context.html
|
||||
├── container-architecture.html
|
||||
├── blockchain-architecture.html
|
||||
├── workflow-state-machine.html
|
||||
├── data-flow.html
|
||||
└── deployment-architecture.html
|
||||
|
||||
Documentation (3 files):
|
||||
├── INDEX.md (comprehensive index and navigation)
|
||||
├── README.md (overview and PNG conversion)
|
||||
└── ARCHITECTURE_GUIDE.md (1000+ line technical guide)
|
||||
|
||||
Utilities (3 files):
|
||||
├── convert.js
|
||||
├── convert-to-png.js
|
||||
└── screenshot-diagrams.js
|
||||
```
|
||||
|
||||
**Total**: 18 files, 140 KB, 2,800+ lines of diagrams & docs
|
||||
|
||||
---
|
||||
|
||||
## ✅ Next Steps
|
||||
|
||||
1. **Now**: Open any .html file in your browser
|
||||
2. **Next**: Read `INDEX.md` for detailed navigation
|
||||
3. **Then**: Read role-specific sections in `ARCHITECTURE_GUIDE.md`
|
||||
4. **Finally**: Use diagrams as reference during implementation
|
||||
|
||||
---
|
||||
|
||||
**Version**: 1.0
|
||||
**Created**: 2026-02-03
|
||||
**Platform**: Goa GEL (Government E-License)
|
||||
**Status**: POC Phase 1
|
||||
|
||||
---
|
||||
|
||||
*Ready to dive in? Open `system-context.html` now!*
|
||||
337
docs/guides/START_HERE.md
Normal file
337
docs/guides/START_HERE.md
Normal file
@@ -0,0 +1,337 @@
|
||||
# 🎯 Goa GEL Architecture Diagrams - START HERE
|
||||
|
||||
## Welcome!
|
||||
|
||||
You have received **comprehensive architecture diagrams and documentation** for the **Goa Government E-License (GEL) Blockchain Document Verification Platform**.
|
||||
|
||||
This is your starting point. Choose your path:
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Quick Start (Choose One)
|
||||
|
||||
### I have 5 minutes
|
||||
Open this file in your browser:
|
||||
```
|
||||
system-context.html
|
||||
```
|
||||
This gives you a high-level overview of the entire system.
|
||||
|
||||
### I have 15 minutes
|
||||
1. Read: `QUICK_START.md`
|
||||
2. Open: `system-context.html` in browser
|
||||
3. Understand the 4-layer architecture
|
||||
|
||||
### I have 30 minutes
|
||||
1. Read: `QUICK_START.md` (10 min)
|
||||
2. Open: `container-architecture.html` (5 min)
|
||||
3. Read: `INDEX.md` - "Diagram Descriptions" section (15 min)
|
||||
|
||||
### I have 60+ minutes
|
||||
1. Read: `QUICK_START.md` (10 min)
|
||||
2. Open: All 6 .html diagrams in separate browser tabs
|
||||
3. Read: `ARCHITECTURE_GUIDE.md` (sections based on your role)
|
||||
|
||||
---
|
||||
|
||||
## 📂 What's Inside?
|
||||
|
||||
### Core Diagrams (6 Mermaid Diagrams)
|
||||
- `system-context.mermaid` - High-level overview
|
||||
- `container-architecture.mermaid` - Technical components
|
||||
- `blockchain-architecture.mermaid` - Smart contracts & consensus
|
||||
- `workflow-state-machine.mermaid` - License approval flows
|
||||
- `data-flow.mermaid` - 11-step end-to-end process
|
||||
- `deployment-architecture.mermaid` - Docker Compose setup
|
||||
|
||||
### View These in Your Browser
|
||||
- `system-context.html`
|
||||
- `container-architecture.html`
|
||||
- `blockchain-architecture.html`
|
||||
- `workflow-state-machine.html`
|
||||
- `data-flow.html`
|
||||
- `deployment-architecture.html`
|
||||
|
||||
### Documentation (Read These)
|
||||
- `QUICK_START.md` - 5-minute orientation
|
||||
- `README.md` - Diagram reference & PNG conversion
|
||||
- `INDEX.md` - Comprehensive navigation guide
|
||||
- `ARCHITECTURE_GUIDE.md` - 1000+ line technical deep-dive
|
||||
|
||||
### Utilities
|
||||
- `convert.js` - HTML generation script
|
||||
- `convert-to-png.js` - PNG conversion guide
|
||||
- `screenshot-diagrams.js` - Multiple conversion methods
|
||||
|
||||
---
|
||||
|
||||
## 👤 Choose Your Role
|
||||
|
||||
### Project Manager / Business Stakeholder
|
||||
**Time: 20 minutes**
|
||||
1. Open: `system-context.html`
|
||||
2. Read: `QUICK_START.md`
|
||||
3. Read: `INDEX.md` - "Diagram Descriptions"
|
||||
4. Result: Understand what the platform does and who uses it
|
||||
|
||||
### Backend Developer
|
||||
**Time: 45 minutes**
|
||||
1. Open: `container-architecture.html`
|
||||
2. Read: `ARCHITECTURE_GUIDE.md` - Sections 2, 3, 5, 6
|
||||
3. Open: `data-flow.html`
|
||||
4. Result: Know the API structure, database schema, blockchain integration
|
||||
|
||||
### Frontend Developer
|
||||
**Time: 25 minutes**
|
||||
1. Open: `container-architecture.html`
|
||||
2. Focus on: Frontend section (Next.js 14 + shadcn/ui)
|
||||
3. Read: `ARCHITECTURE_GUIDE.md` - Section 2 (Frontend Layer)
|
||||
4. Result: Understand UI components, API integration points
|
||||
|
||||
### Blockchain Developer
|
||||
**Time: 40 minutes**
|
||||
1. Open: `blockchain-architecture.html`
|
||||
2. Read: `ARCHITECTURE_GUIDE.md` - Section 3 (Blockchain Deep Dive)
|
||||
3. Study: Smart contracts section
|
||||
4. Result: Know the 4 smart contracts, consensus mechanism, on-chain/off-chain data
|
||||
|
||||
### DevOps / Infrastructure Engineer
|
||||
**Time: 30 minutes**
|
||||
1. Open: `deployment-architecture.html`
|
||||
2. Read: `ARCHITECTURE_GUIDE.md` - Section 6 (Deployment)
|
||||
3. Review: Docker Compose configuration
|
||||
4. Result: Know how to set up and deploy the platform
|
||||
|
||||
### QA / Test Engineer
|
||||
**Time: 35 minutes**
|
||||
1. Open: `workflow-state-machine.html`
|
||||
2. Open: `data-flow.html`
|
||||
3. Read: `ARCHITECTURE_GUIDE.md` - Sections 4, 5 (Workflows & Data Flow)
|
||||
4. Result: Know all test scenarios and approval workflows
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Reading Recommendations by Role
|
||||
|
||||
### Backend Developer Learning Path
|
||||
```
|
||||
1. QUICK_START.md (10 min) - Get oriented
|
||||
2. container-architecture.html (5 min) - See the big picture
|
||||
3. ARCHITECTURE_GUIDE.md - Section 2 (API layer) (10 min)
|
||||
4. ARCHITECTURE_GUIDE.md - Section 3 (Blockchain) (15 min)
|
||||
5. data-flow.html (10 min) - See the workflow
|
||||
6. ARCHITECTURE_GUIDE.md - Section 5 (11-step process) (15 min)
|
||||
7. ARCHITECTURE_GUIDE.md - Section 6 (Deployment) (10 min)
|
||||
Total: 75 minutes (complete understanding)
|
||||
```
|
||||
|
||||
### Frontend Developer Learning Path
|
||||
```
|
||||
1. QUICK_START.md (10 min)
|
||||
2. system-context.html (5 min)
|
||||
3. container-architecture.html focus on Frontend layer (10 min)
|
||||
4. ARCHITECTURE_GUIDE.md - Section 2 Frontend Layer (10 min)
|
||||
5. data-flow.html (5 min)
|
||||
Total: 40 minutes
|
||||
```
|
||||
|
||||
### Blockchain Developer Learning Path
|
||||
```
|
||||
1. QUICK_START.md (10 min)
|
||||
2. system-context.html (5 min)
|
||||
3. blockchain-architecture.html (15 min)
|
||||
4. ARCHITECTURE_GUIDE.md - Section 3 Blockchain Deep Dive (25 min)
|
||||
5. ARCHITECTURE_GUIDE.md - Smart Contracts subsection (15 min)
|
||||
Total: 70 minutes
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 💡 Key Insights
|
||||
|
||||
### Architecture Highlights
|
||||
✓ **C4 Model Compliance** - System Context → Containers → Components
|
||||
✓ **Blockchain Integration** - Immutable record-keeping with QBFT consensus
|
||||
✓ **Multi-Department Workflows** - Parallel approval processes
|
||||
✓ **Soulbound NFTs** - Non-transferable license certificates
|
||||
✓ **Hybrid Storage** - On-chain hashing, off-chain documents
|
||||
✓ **Containerized** - Everything runs in Docker
|
||||
|
||||
### Technology Stack
|
||||
- **Blockchain**: Hyperledger Besu (QBFT consensus, 4 validators)
|
||||
- **Backend**: NestJS (TypeScript)
|
||||
- **Frontend**: Next.js 14 + shadcn/ui
|
||||
- **Database**: PostgreSQL
|
||||
- **Cache**: Redis
|
||||
- **Storage**: MinIO (S3-compatible)
|
||||
- **Infrastructure**: Docker Compose
|
||||
|
||||
### Deployment
|
||||
- All services containerized
|
||||
- 9 containers total (Frontend, API, PostgreSQL, Redis, MinIO, 4x Besu)
|
||||
- Named volumes for data persistence
|
||||
- Health checks for reliability
|
||||
- Prometheus & Grafana for monitoring
|
||||
|
||||
---
|
||||
|
||||
## 🖥️ How to View Diagrams
|
||||
|
||||
### Option 1: Browser (Easiest)
|
||||
```bash
|
||||
# Open any .html file in your web browser
|
||||
firefox system-context.html
|
||||
# or
|
||||
google-chrome container-architecture.html
|
||||
# or just double-click in file manager
|
||||
```
|
||||
✓ No installation needed
|
||||
✓ Instant rendering
|
||||
✓ Works offline
|
||||
|
||||
### Option 2: Mermaid Live (Online)
|
||||
1. Go to: https://mermaid.live
|
||||
2. Copy content from any .mermaid file
|
||||
3. Paste into editor
|
||||
4. View instantly and export to PNG
|
||||
|
||||
### Option 3: Convert to PNG
|
||||
See README.md for 5 different methods to convert to PNG format.
|
||||
|
||||
---
|
||||
|
||||
## 📊 File Summary
|
||||
|
||||
```
|
||||
/sessions/cool-elegant-faraday/mnt/Goa-GEL/
|
||||
|
||||
Core Files (20 total):
|
||||
|
||||
DIAGRAMS (.mermaid + .html):
|
||||
├── system-context.mermaid / .html
|
||||
├── container-architecture.mermaid / .html
|
||||
├── blockchain-architecture.mermaid / .html
|
||||
├── workflow-state-machine.mermaid / .html
|
||||
├── data-flow.mermaid / .html
|
||||
└── deployment-architecture.mermaid / .html
|
||||
|
||||
DOCUMENTATION (.md):
|
||||
├── START_HERE.md (this file)
|
||||
├── QUICK_START.md
|
||||
├── README.md
|
||||
├── INDEX.md
|
||||
└── ARCHITECTURE_GUIDE.md
|
||||
|
||||
UTILITIES:
|
||||
├── convert.js
|
||||
├── convert-to-png.js
|
||||
└── screenshot-diagrams.js
|
||||
```
|
||||
|
||||
**Total: 20 files, 172 KB, 3,500+ lines**
|
||||
|
||||
---
|
||||
|
||||
## ⚡ Next Steps
|
||||
|
||||
### Right Now
|
||||
1. Open one .html file in your browser
|
||||
2. See the diagrams rendered instantly
|
||||
3. Read QUICK_START.md (5 minutes)
|
||||
|
||||
### Today
|
||||
1. Review your role-specific section
|
||||
2. Understand the architecture
|
||||
3. Plan your implementation approach
|
||||
|
||||
### This Week
|
||||
1. Deep-dive into ARCHITECTURE_GUIDE.md
|
||||
2. Convert diagrams to PNG for presentations
|
||||
3. Share with your team
|
||||
|
||||
### Implementation
|
||||
1. Use diagrams as visual reference
|
||||
2. Follow the 11-step data flow for workflows
|
||||
3. Reference deployment architecture for setup
|
||||
|
||||
---
|
||||
|
||||
## ❓ FAQ
|
||||
|
||||
**Q: Can I view diagrams without installing anything?**
|
||||
A: Yes! Open any .html file in your web browser.
|
||||
|
||||
**Q: How do I convert to PNG?**
|
||||
A: See README.md for 5 methods. Easiest: https://mermaid.live
|
||||
|
||||
**Q: Which diagram should I look at first?**
|
||||
A: Start with system-context.html (high-level overview)
|
||||
|
||||
**Q: Where's the detailed technical info?**
|
||||
A: Read ARCHITECTURE_GUIDE.md (1000+ lines of detailed documentation)
|
||||
|
||||
**Q: Can I use these diagrams in presentations?**
|
||||
A: Yes! Convert to PNG (see README.md) or share .html files
|
||||
|
||||
**Q: How does the blockchain integration work?**
|
||||
A: See blockchain-architecture.html and data-flow.html Step 3 & 9
|
||||
|
||||
**Q: What's the deployment process?**
|
||||
A: See deployment-architecture.html and ARCHITECTURE_GUIDE.md Section 6
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Your Next Action
|
||||
|
||||
**Pick one:**
|
||||
|
||||
1. **Right now** (5 min):
|
||||
```
|
||||
Open in browser: system-context.html
|
||||
```
|
||||
|
||||
2. **Next 15 minutes**:
|
||||
```
|
||||
Read: QUICK_START.md
|
||||
Then open: container-architecture.html
|
||||
```
|
||||
|
||||
3. **Next 30 minutes**:
|
||||
```
|
||||
Read: QUICK_START.md
|
||||
Open: All 6 diagrams in tabs
|
||||
Skim: INDEX.md "Diagram Descriptions"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📞 Support
|
||||
|
||||
For more details, see:
|
||||
- **Quick overview**: QUICK_START.md
|
||||
- **Navigation guide**: INDEX.md
|
||||
- **Technical details**: ARCHITECTURE_GUIDE.md
|
||||
- **PNG conversion**: README.md
|
||||
- **Complete summary**: DELIVERABLES.txt
|
||||
|
||||
---
|
||||
|
||||
**Created**: 2026-02-03
|
||||
**Platform**: Goa GEL (Government E-License)
|
||||
**Status**: Complete
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Ready?
|
||||
|
||||
Go open `system-context.html` in your browser now!
|
||||
|
||||
Or read `QUICK_START.md` if you prefer text.
|
||||
|
||||
Or jump to `ARCHITECTURE_GUIDE.md` if you want deep technical details.
|
||||
|
||||
Your choice - all paths lead to understanding the platform.
|
||||
|
||||
---
|
||||
|
||||
*Good luck with the Goa GEL Blockchain Document Verification Platform!*
|
||||
1369
docs/guides/USER_GUIDE.md
Normal file
1369
docs/guides/USER_GUIDE.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user