# geetheshwar420/projectageis architecture

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

- Interactive diagram: https://gitdiagram.com/geetheshwar420/projectageis
- Repository: https://github.com/geetheshwar420/projectageis

## Overview

AGIES is a browser-heavy, post-quantum secure messaging product with a Flask real-time relay and Firebase persistence. The main workflow is identity setup and key publication, friend/chat discovery, client-side message encryption, relay and offline delivery, then local history and decryption. The graph also preserves the documented identity, file, and cryptographic capabilities. Evidence is limited to the README, excerpts, and SOURCE INDEX references; unsampled runtime wiring is not assumed.

Main entry points: [`frontend/App.tsx`](https://github.com/geetheshwar420/projectageis/blob/main/frontend/App.tsx) (App orchestration), [`frontend/services/api.ts`](https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/api.ts) (HTTP client), [`frontend/context/AuthContext.tsx`](https://github.com/geetheshwar420/projectageis/blob/main/frontend/context/AuthContext.tsx) (Authentication), [`frontend/components/ChatWindow.tsx`](https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/ChatWindow.tsx) (Chat window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_app["App orchestration<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_chat["Chat window<br/>[ChatWindow.tsx]"]
  node_friend_ui["Friend discovery<br/>[LeftSidebar.tsx]"]
  node_profile_ui["Profile and sharing<br/>[QRCodeModal.tsx]"]
  node_file_service["File handling<br/>[FileService.ts]"]
  node_socket_client["Socket connection<br/>[SocketContext.tsx]"]
  node_api["HTTP client<br/>[api.ts]"]
end

subgraph group_crypto["Cryptography"]
  node_crypto_engine["Client crypto engine<br/>[CryptoEngine.ts]"]
  node_quantum_service["Quantum service<br/>[quantum_service.py]"]
  node_bb84["BB84 protocol<br/>[bb84.py]"]
  node_kyber["Kyber KEM<br/>[kyber.py]"]
  node_dilithium["Dilithium signatures<br/>[dilithium.py]"]
  node_crypto_models["Crypto models<br/>[crypto_models.py]"]
end

subgraph group_backend["Relay backend"]
  node_flask["Flask app<br/>[app.py]"]
  node_http_routes["HTTP routes<br/>[routes.py]"]
  node_socket_events["Socket events<br/>[socket_events.py]"]
end

subgraph group_persistence["Persistence and identity"]
  node_local_vault[("Local vault<br/>[StorageService.ts]")]
  node_google_auth["Google identity<br/>[firebase.ts]"]
  node_db_facade["Database access<br/>[db.py]"]
  node_firebase_store[("Firebase storage<br/>[firebase_db.py]")]
end

node_user(("User"))
node_firestore[("Firestore")]

node_user -->|"uses"| node_app
node_app -->|"wraps"| node_auth
node_app -->|"renders"| node_chat
node_app -->|"renders"| node_friend_ui
node_app -->|"renders"| node_profile_ui
node_app -->|"fetches data"| node_api
node_app -->|"loads history"| node_local_vault
node_app -->|"decrypts history"| node_crypto_engine
node_auth -->|"authenticates"| node_api
node_auth -->|"creates keys"| node_crypto_engine
node_auth -->|"stores keys"| node_local_vault
node_auth -->|"signs in"| node_google_auth
node_chat -->|"encrypts messages"| node_crypto_engine
node_chat -->|"stores messages"| node_local_vault
node_chat -->|"requests data"| node_api
node_chat -->|"uses socket"| node_socket_client
node_friend_ui -->|"searches peers"| node_api
node_file_service -->|"uploads files"| node_api
node_socket_client -->|"relays events"| node_flask
node_api -->|"sends requests"| node_flask
node_flask -->|"registers routes"| node_http_routes
node_flask -->|"registers handlers"| node_socket_events
node_http_routes -->|"queries"| node_db_facade
node_socket_events -->|"updates status"| node_db_facade
node_db_facade -->|"delegates"| node_firebase_store
node_firebase_store -->|"persists metadata"| node_firestore
node_firebase_store -->|"queues messages"| node_firestore
node_google_auth -->|"provides identity token"| node_http_routes
node_quantum_service -->|"uses protocol"| node_bb84
node_quantum_service -->|"uses KEM"| node_kyber
node_quantum_service -->|"uses signatures"| node_dilithium
node_quantum_service -->|"uses models"| node_crypto_models

click node_app "https://github.com/geetheshwar420/projectageis/blob/main/frontend/App.tsx"
click node_auth "https://github.com/geetheshwar420/projectageis/blob/main/frontend/context/AuthContext.tsx"
click node_chat "https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/ChatWindow.tsx"
click node_friend_ui "https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/LeftSidebar.tsx"
click node_profile_ui "https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/QRCodeModal.tsx"
click node_file_service "https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/FileService.ts"
click node_socket_client "https://github.com/geetheshwar420/projectageis/blob/main/frontend/context/SocketContext.tsx"
click node_api "https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/api.ts"
click node_crypto_engine "https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/CryptoEngine.ts"
click node_local_vault "https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/StorageService.ts"
click node_google_auth "https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/firebase.ts"
click node_flask "https://github.com/geetheshwar420/projectageis/blob/main/backend/app.py"
click node_http_routes "https://github.com/geetheshwar420/projectageis/blob/main/backend/routes.py"
click node_socket_events "https://github.com/geetheshwar420/projectageis/blob/main/backend/socket_events.py"
click node_db_facade "https://github.com/geetheshwar420/projectageis/blob/main/backend/db.py"
click node_firebase_store "https://github.com/geetheshwar420/projectageis/blob/main/backend/firebase_db.py"
click node_quantum_service "https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/quantum_service.py"
click node_bb84 "https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/bb84.py"
click node_kyber "https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/kyber.py"
click node_dilithium "https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/dilithium.py"
click node_crypto_models "https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/crypto_models.py"

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_app,node_auth,node_chat,node_friend_ui,node_profile_ui,node_file_service,node_socket_client,node_api,node_user toneBlue
class node_crypto_engine,node_quantum_service,node_bb84,node_kyber,node_dilithium,node_crypto_models,node_firestore toneAmber
class node_flask,node_http_routes,node_socket_events toneMint
class node_local_vault,node_google_auth,node_db_facade,node_firebase_store toneRose
```

## Components

### Browser client

- [App orchestration](https://github.com/geetheshwar420/projectageis/blob/main/frontend/App.tsx): `frontend/App.tsx`
- [Authentication](https://github.com/geetheshwar420/projectageis/blob/main/frontend/context/AuthContext.tsx): `frontend/context/AuthContext.tsx`
- [Chat window](https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/ChatWindow.tsx): `frontend/components/ChatWindow.tsx`
- [Friend discovery](https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/LeftSidebar.tsx): `frontend/components/LeftSidebar.tsx`
- [Profile and sharing](https://github.com/geetheshwar420/projectageis/blob/main/frontend/components/QRCodeModal.tsx): `frontend/components/QRCodeModal.tsx`
- [File handling](https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/FileService.ts): `frontend/services/FileService.ts`
- [Socket connection](https://github.com/geetheshwar420/projectageis/blob/main/frontend/context/SocketContext.tsx): `frontend/context/SocketContext.tsx`
- [HTTP client](https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/api.ts): `frontend/services/api.ts`

### Cryptography

- [Client crypto engine](https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/CryptoEngine.ts): `frontend/services/CryptoEngine.ts`
- [Quantum service](https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/quantum_service.py): `backend/crypto/quantum_service.py`
- [BB84 protocol](https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/bb84.py): `backend/crypto/bb84.py`
- [Kyber KEM](https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/kyber.py): `backend/crypto/kyber.py`
- [Dilithium signatures](https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/dilithium.py): `backend/crypto/dilithium.py`
- [Crypto models](https://github.com/geetheshwar420/projectageis/blob/main/backend/crypto/crypto_models.py): `backend/crypto/crypto_models.py`

### Relay backend

- [Flask app](https://github.com/geetheshwar420/projectageis/blob/main/backend/app.py): `backend/app.py`
- [HTTP routes](https://github.com/geetheshwar420/projectageis/blob/main/backend/routes.py): `backend/routes.py`
- [Socket events](https://github.com/geetheshwar420/projectageis/blob/main/backend/socket_events.py): `backend/socket_events.py`

### Persistence and identity

- [Local vault](https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/StorageService.ts): `frontend/services/StorageService.ts`
- [Google identity](https://github.com/geetheshwar420/projectageis/blob/main/frontend/services/firebase.ts): `frontend/services/firebase.ts`
- [Database access](https://github.com/geetheshwar420/projectageis/blob/main/backend/db.py): `backend/db.py`
- [Firebase storage](https://github.com/geetheshwar420/projectageis/blob/main/backend/firebase_db.py): `backend/firebase_db.py`

### Other components

- **User**
- **Firestore**

## Connections

- User → App orchestration: uses
- App orchestration → Authentication: wraps (evidence: `frontend/App.tsx`)
- App orchestration → Chat window: renders (evidence: `frontend/App.tsx`)
- App orchestration → Friend discovery: renders (evidence: `frontend/App.tsx`)
- App orchestration → Profile and sharing: renders (evidence: `frontend/App.tsx`)
- App orchestration → HTTP client: fetches data (evidence: `frontend/App.tsx`)
- App orchestration → Local vault: loads history (evidence: `frontend/App.tsx`)
- App orchestration → Client crypto engine: decrypts history (evidence: `frontend/App.tsx`)
- Authentication → HTTP client: authenticates (evidence: `frontend/context/AuthContext.tsx`)
- Authentication → Client crypto engine: creates keys (evidence: `frontend/context/AuthContext.tsx`)
- Authentication → Local vault: stores keys (evidence: `frontend/context/AuthContext.tsx`)
- Authentication → Google identity: signs in (evidence: `frontend/context/AuthContext.tsx`)
- Chat window → Client crypto engine: encrypts messages (evidence: `frontend/components/ChatWindow.tsx`)
- Chat window → Local vault: stores messages (evidence: `frontend/components/ChatWindow.tsx`)
- Chat window → HTTP client: requests data (evidence: `frontend/components/ChatWindow.tsx`)
- Chat window → Socket connection: uses socket (evidence: `frontend/components/ChatWindow.tsx`)
- Friend discovery → HTTP client: searches peers (evidence: `frontend/components/LeftSidebar.tsx`)
- File handling → HTTP client: uploads files (evidence: `frontend/services/FileService.ts`)
- Socket connection → Flask app: relays events
- HTTP client → Flask app: sends requests
- Flask app → HTTP routes: registers routes (evidence: `backend/app.py`)
- Flask app → Socket events: registers handlers (evidence: `backend/app.py`)
- HTTP routes → Database access: queries (evidence: `backend/routes.py`)
- Socket events → Database access: updates status (evidence: `backend/socket_events.py`)
- Database access → Firebase storage: delegates (evidence: `backend/db.py`)
- Firebase storage → Firestore: persists metadata
- Firebase storage → Firestore: queues messages
- Google identity → HTTP routes: provides identity token
- Quantum service → BB84 protocol: uses protocol (evidence: `backend/crypto/quantum_service.py`)
- Quantum service → Kyber KEM: uses KEM (evidence: `backend/crypto/quantum_service.py`)
- Quantum service → Dilithium signatures: uses signatures (evidence: `backend/crypto/quantum_service.py`)
- Quantum service → Crypto models: uses models (evidence: `backend/crypto/quantum_service.py`)
