Skip to content

Latest commit

 

History

History
104 lines (77 loc) · 2.64 KB

architecture.md

File metadata and controls

104 lines (77 loc) · 2.64 KB

Architecture Overview

System Architecture

ElimuChain follows a modern web3 architecture combining traditional web technologies with blockchain capabilities.

High-Level Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   React Frontend│     │  Supabase       │     │  Ethereum       │
│   (TypeScript)  │────▶│  (PostgreSQL)   │     │  Blockchain     │
└────────┬────────┘     └────────┬────────┘     └────────┬────────┘
         │                       │                       │
         │                       │                       │
    User Interface          Data Storage           Smart Contract
         │                       │                       │
         │                       │                       │
    Authentication        Row Level Security     Credential Verification

Core Components

Frontend (React + TypeScript)

  • Pages: React components for different views

    • Landing Page
    • Get Started Flow
    • Dashboard
    • Credential Management
  • State Management: React Context and Hooks

  • Styling: Tailwind CSS

  • Icons: Lucide React

Backend (Supabase)

  • Authentication: Supabase Auth
  • Database: PostgreSQL with RLS
  • Tables:
    • users
    • credentials
    • verifications

Blockchain (Ethereum)

  • Smart Contract: ElimuChain.sol
  • Features:
    • Credential Issuance
    • Verification
    • Institution Management

Data Flow

  1. User Registration:

    Frontend → Supabase Auth → Database
    
  2. Credential Issuance:

    Frontend → Smart Contract → Blockchain
            → Supabase → Database
    
  3. Verification:

    Frontend → Smart Contract → Verification Result
            → Database Update
    

Security

Authentication

  • Supabase handles user authentication
  • JWT tokens for API requests
  • MetaMask for blockchain transactions

Authorization

  • Row Level Security in Supabase
  • Smart contract modifiers
  • Role-based access control

Data Privacy

  • Credential hashes on blockchain
  • Encrypted data in Supabase
  • Client-side encryption where necessary

Performance Considerations

  • Optimistic UI updates
  • Caching strategies
  • Efficient blockchain interactions
  • Indexed database queries

Future Improvements

  1. Layer 2 scaling solutions
  2. IPFS integration
  3. Multi-chain support
  4. Advanced analytics