# ahm21st/identia-mvp architecture

> Architecture diagram of the GitHub repository ahm21st/identia-mvp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahm21st/identia-mvp
- Repository: https://github.com/ahm21st/identia-mvp

## Overview

Identia is a Solana skill-learning and attestation app. A user connects a wallet, studies React lessons, completes a timed quiz, and submits a score-based attestation request. An authenticated admin reviews requests and asks the backend to emit attestations; users can view certificate-style records. The sampled frontend shows request storage and admin actions, but the emission backend is not in this tree, and the attestation list is currently hardcoded. The README documents SAS on Solana; edges to that external issuance path rely on that documentation.

Main entry points: [`src/App.tsx`](https://github.com/ahm21st/identia-mvp/blob/main/src/App.tsx) (App navigation), [`src/components/AdminPanel.tsx`](https://github.com/ahm21st/identia-mvp/blob/main/src/components/AdminPanel.tsx) (Request review), [`src/lib/adminAuth.ts`](https://github.com/ahm21st/identia-mvp/blob/main/src/lib/adminAuth.ts) (Admin sign-in), [`src/lib/supabase.ts`](https://github.com/ahm21st/identia-mvp/blob/main/src/lib/supabase.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning and profile"]
  node_profile["Profile form<br/>[ProfileForm.tsx]"]
  node_lessons_quiz["Lessons and quiz<br/>[LearnReact.tsx]"]
  node_attestations_view["Certificate view"]
  node_browser_storage[("Browser storage")]
end

subgraph group_app["Frontend application"]
  node_app["App navigation<br/>[App.tsx]"]
  node_wallet["Wallet control<br/>[WalletButton.tsx]"]
  node_wallet_setup["Wallet setup<br/>[main.tsx]"]
  node_solana_config["Solana network config<br/>[solana.ts]"]
end

subgraph group_admin["Admin workflow"]
  node_admin_auth["Admin sign-in<br/>[adminAuth.ts]"]
  node_admin_panel["Request review<br/>[AdminPanel.tsx]"]
end

subgraph group_services["Data and issuance"]
  node_verify_admin["Admin verification<br/>[index.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_request_store[("Supabase records")]
  node_emission_api["Attestation API"]
  node_sas_solana[("SAS on Solana")]
end

node_user(("Learner"))
node_admin_actor(("Admin"))

node_user -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_wallet_setup -->|"provides wallet context"| node_app
node_wallet_setup -->|"gets endpoint"| node_solana_config
node_app -->|"renders"| node_wallet
node_app -->|"renders"| node_profile
node_app -->|"routes to"| node_lessons_quiz
node_app -->|"routes to"| node_attestations_view
node_app -->|"routes to"| node_admin_panel
node_app -->|"calls"| node_admin_auth
node_profile -->|"reads and writes"| node_browser_storage
node_admin_auth -->|"stores token"| node_browser_storage
node_admin_auth -->|"posts signature"| node_verify_admin
node_verify_admin -->|"checks admin"| node_request_store
node_lessons_quiz -->|"uses"| node_supabase_client
node_supabase_client -->|"inserts request"| node_request_store
node_admin_panel -->|"uses"| node_supabase_client
node_admin_panel -->|"reads and updates"| node_request_store
node_admin_panel -->|"requests emission"| node_emission_api
node_emission_api -->|"emits attestation"| node_sas_solana

click node_app "https://github.com/ahm21st/identia-mvp/blob/main/src/App.tsx"
click node_wallet "https://github.com/ahm21st/identia-mvp/blob/main/src/components/WalletButton.tsx"
click node_wallet_setup "https://github.com/ahm21st/identia-mvp/blob/main/src/main.tsx"
click node_solana_config "https://github.com/ahm21st/identia-mvp/blob/main/src/lib/solana.ts"
click node_profile "https://github.com/ahm21st/identia-mvp/blob/main/src/components/ProfileForm.tsx"
click node_lessons_quiz "https://github.com/ahm21st/identia-mvp/blob/main/src/components/LearnReact.tsx"
click node_attestations_view "https://github.com/ahm21st/identia-mvp/blob/main/src/components/AttestationsList.tsx"
click node_admin_auth "https://github.com/ahm21st/identia-mvp/blob/main/src/lib/adminAuth.ts"
click node_admin_panel "https://github.com/ahm21st/identia-mvp/blob/main/src/components/AdminPanel.tsx"
click node_verify_admin "https://github.com/ahm21st/identia-mvp/blob/main/supabase/functions/verify-admin/index.ts"
click node_supabase_client "https://github.com/ahm21st/identia-mvp/blob/main/src/lib/supabase.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_profile,node_lessons_quiz,node_attestations_view,node_browser_storage toneBlue
class node_app,node_wallet,node_wallet_setup,node_solana_config toneAmber
class node_admin_auth,node_admin_panel toneMint
class node_verify_admin,node_supabase_client,node_request_store,node_emission_api,node_sas_solana toneRose
class node_user,node_admin_actor toneIndigo
```

## Components

### Learning and profile

- [Profile form](https://github.com/ahm21st/identia-mvp/blob/main/src/components/ProfileForm.tsx): `src/components/ProfileForm.tsx`
- [Lessons and quiz](https://github.com/ahm21st/identia-mvp/blob/main/src/components/LearnReact.tsx): `src/components/LearnReact.tsx`
- [Certificate view](https://github.com/ahm21st/identia-mvp/blob/main/src/components/AttestationsList.tsx): `src/components/AttestationsList.tsx`
- **Browser storage**

### Frontend application

- [App navigation](https://github.com/ahm21st/identia-mvp/blob/main/src/App.tsx): `src/App.tsx`
- [Wallet control](https://github.com/ahm21st/identia-mvp/blob/main/src/components/WalletButton.tsx): `src/components/WalletButton.tsx`
- [Wallet setup](https://github.com/ahm21st/identia-mvp/blob/main/src/main.tsx): `src/main.tsx`
- [Solana network config](https://github.com/ahm21st/identia-mvp/blob/main/src/lib/solana.ts): `src/lib/solana.ts`

### Admin workflow

- [Admin sign-in](https://github.com/ahm21st/identia-mvp/blob/main/src/lib/adminAuth.ts): `src/lib/adminAuth.ts`
- [Request review](https://github.com/ahm21st/identia-mvp/blob/main/src/components/AdminPanel.tsx): `src/components/AdminPanel.tsx`

### Data and issuance

- [Admin verification](https://github.com/ahm21st/identia-mvp/blob/main/supabase/functions/verify-admin/index.ts): `supabase/functions/verify-admin/index.ts`
- [Supabase client](https://github.com/ahm21st/identia-mvp/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase records**
- **Attestation API**
- **SAS on Solana**

### Other components

- **Learner**
- **Admin**

## Connections

- Learner → App navigation: uses (evidence: `README.md`)
- Admin → App navigation: uses (evidence: `README.md`)
- Wallet setup → App navigation: provides wallet context (evidence: `src/main.tsx`)
- Wallet setup → Solana network config: gets endpoint (evidence: `src/main.tsx`)
- App navigation → Wallet control: renders (evidence: `src/App.tsx`)
- App navigation → Profile form: renders (evidence: `src/App.tsx`)
- App navigation → Lessons and quiz: routes to (evidence: `src/App.tsx`)
- App navigation → Certificate view: routes to (evidence: `src/App.tsx`)
- App navigation → Request review: routes to (evidence: `src/App.tsx`)
- App navigation → Admin sign-in: calls (evidence: `src/App.tsx`)
- Profile form → Browser storage: reads and writes (evidence: `src/components/ProfileForm.tsx`)
- Admin sign-in → Browser storage: stores token (evidence: `src/lib/adminAuth.ts`)
- Admin sign-in → Admin verification: posts signature (evidence: `src/lib/adminAuth.ts`)
- Admin verification → Supabase records: checks admin (evidence: `supabase/functions/verify-admin/index.ts`)
- Lessons and quiz → Supabase client: uses (evidence: `src/components/LearnReact.tsx`)
- Supabase client → Supabase records: inserts request
- Request review → Supabase client: uses (evidence: `src/components/AdminPanel.tsx`)
- Request review → Supabase records: reads and updates (evidence: `src/components/AdminPanel.tsx`)
- Request review → Attestation API: requests emission (evidence: `src/components/AdminPanel.tsx`)
- Attestation API → SAS on Solana: emits attestation (evidence: `README.md`)
