# google-developers-group-iit-mandi/geoledger architecture

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

- Interactive diagram: https://gitdiagram.com/google-developers-group-iit-mandi/geoledger
- Repository: https://github.com/google-developers-group-iit-mandi/geoledger

## Overview

GeoLedger is a Stellar/Soroban charitable-giving platform. Donors discover verified NGOs, authenticate and connect a wallet, then make geolocated donations; NGOs submit evidence and impact can be tracked. The web app calls an Express API for authentication, NGO/project, donation, evidence, and assistant features, while Soroban contracts provide the documented ledger capabilities. Several backend controllers shown are placeholders, so the graph represents documented product capabilities without implying those handlers are implemented. Evidence is limited to the README and sampled excerpts; contract-to-backend runtime calls are not shown.

Main entry points: [`frontend/src/lib/api/client.ts`](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/lib/api/client.ts) (API client), [`backend/src/routes/index.ts`](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/index.ts) (API routing), [`backend/src/routes/donations.ts`](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/donations.ts) (Donation processing), [`frontend/src/app/dashboard/donate/page.tsx`](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/app/dashboard/donate/page.tsx) (Donation and dashboards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_landing["Discovery and entry<br/>[page.tsx]"]
  node_identity["Web identity<br/>[useGoogleAuth.ts]"]
  node_api_client["API client<br/>[client.ts]"]
  node_donation_ui["Donation and dashboards<br/>[page.tsx]"]
  node_wallet["Wallet integration<br/>[wallet.ts]"]
  node_evidence_ui["Evidence submission<br/>[EvidenceUpload.tsx]"]
  node_assistant_ui["Giving assistant<br/>[Chatbot.tsx]"]
end

subgraph group_backend["Backend API"]
  node_api_app["API application<br/>[app.ts]"]
  node_api_routes["API routing<br/>[index.ts]"]
  node_auth["Authentication<br/>[auth.routes.ts]"]
  node_ngo_projects["NGO and projects<br/>[ngos.ts]"]
  node_donations["Donation processing<br/>[donations.ts]"]
  node_evidence["Evidence processing<br/>[evidence.ts]"]
  node_chat["AI assistant API<br/>[chat.ts]"]
  node_storage[("Database access<br/>[database.ts]")]
  node_ipfs["Evidence storage<br/>[ipfs.service.ts]"]
  node_stellar_lib["Stellar integration<br/>[stellar.ts]"]
end

subgraph group_contracts["Soroban contracts"]
  node_donation_contract["Donation registry<br/>[lib.rs]"]
  node_verification_contract["NGO verification<br/>[lib.rs]"]
  node_escrow_contract["Impact escrow<br/>[lib.rs]"]
  node_evidence_contract["Evidence contract<br/>[lib.rs]"]
  node_token_contract["Token manager<br/>[lib.rs]"]
  node_nft_contract["NFT minting<br/>[lib.rs]"]
end

subgraph group_integrations["External services"]
  node_google["Google and Firebase"]
  node_stellar_network["Stellar network"]
  node_gemini["Gemini AI"]
  node_ipfs_service["IPFS or Pinata"]
end

node_donor(("Donor or NGO"))

node_donor -->|"browses"| node_landing
node_landing -->|"loads NGOs"| node_api_client
node_donor -->|"authenticates"| node_identity
node_identity -->|"signs in"| node_google
node_identity -->|"posts login"| node_auth
node_donor -->|"starts donation"| node_donation_ui
node_donation_ui -->|"connects wallet"| node_wallet
node_donation_ui -->|"requests donation"| node_api_client
node_api_client -->|"calls API"| node_donations
node_evidence_ui -->|"prepares evidence"| node_api_client
node_api_client -->|"uploads evidence"| node_evidence
node_donor -->|"asks questions"| node_assistant_ui
node_assistant_ui -->|"sends message"| node_api_client
node_api_client -->|"calls assistant"| node_chat
node_landing -->|"lists NGOs"| node_ngo_projects
node_api_app -->|"mounts routes"| node_api_routes
node_api_app -->|"initializes database"| node_storage
node_api_routes -.->|"routes auth"| node_auth
node_api_routes -.->|"routes directories"| node_ngo_projects
node_api_routes -.->|"routes donations"| node_donations
node_api_routes -.->|"routes evidence"| node_evidence
node_api_routes -.->|"routes chat"| node_chat
node_donation_ui -.->|"submits transactions"| node_stellar_network
node_ngo_projects -.->|"verifies NGOs"| node_verification_contract
node_donations -.->|"records donations"| node_donation_contract
node_donations -.->|"uses escrow"| node_escrow_contract
node_evidence -.->|"stores evidence"| node_ipfs
node_evidence -.->|"records proof"| node_evidence_contract
node_donations -.->|"handles tokens"| node_token_contract
node_donations -.->|"mints NFTs"| node_nft_contract
node_chat -.->|"uses AI"| node_gemini

click node_landing "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/app/page.tsx"
click node_identity "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/hooks/useGoogleAuth.ts"
click node_api_client "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/lib/api/client.ts"
click node_donation_ui "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/app/dashboard/donate/page.tsx"
click node_wallet "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/lib/stellar/wallet.ts"
click node_evidence_ui "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/components/EvidenceUpload.tsx"
click node_assistant_ui "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/components/Chatbot.tsx"
click node_api_app "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/app.ts"
click node_api_routes "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/index.ts"
click node_auth "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/auth.routes.ts"
click node_ngo_projects "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/ngos.ts"
click node_donations "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/donations.ts"
click node_evidence "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/evidence.ts"
click node_chat "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/chat.ts"
click node_storage "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/config/database.ts"
click node_ipfs "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/services/ipfs.service.ts"
click node_stellar_lib "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/lib/stellar.ts"
click node_donation_contract "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/donation_registry/src/lib.rs"
click node_verification_contract "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/ngo_verification/src/lib.rs"
click node_escrow_contract "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/impact_escrow/src/lib.rs"
click node_evidence_contract "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/evidence/src/lib.rs"
click node_token_contract "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/token_manager/src/lib.rs"
click node_nft_contract "https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/nft_minting/src/lib.rs"

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_landing,node_identity,node_api_client,node_donation_ui,node_wallet,node_evidence_ui,node_assistant_ui toneBlue
class node_api_app,node_api_routes,node_auth,node_ngo_projects,node_donations,node_evidence,node_chat,node_storage,node_ipfs,node_stellar_lib toneAmber
class node_donation_contract,node_verification_contract,node_escrow_contract,node_evidence_contract,node_token_contract,node_nft_contract toneMint
class node_google,node_stellar_network,node_gemini,node_ipfs_service toneRose
class node_donor toneIndigo
```

## Components

### Web application

- [Discovery and entry](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Web identity](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/hooks/useGoogleAuth.ts): `frontend/src/hooks/useGoogleAuth.ts`
- [API client](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/lib/api/client.ts): `frontend/src/lib/api/client.ts`
- [Donation and dashboards](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/app/dashboard/donate/page.tsx): `frontend/src/app/dashboard/donate/page.tsx`
- [Wallet integration](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/lib/stellar/wallet.ts): `frontend/src/lib/stellar/wallet.ts`
- [Evidence submission](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/components/EvidenceUpload.tsx): `frontend/src/components/EvidenceUpload.tsx`
- [Giving assistant](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/frontend/src/components/Chatbot.tsx): `frontend/src/components/Chatbot.tsx`

### Backend API

- [API application](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [API routing](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/index.ts): `backend/src/routes/index.ts`
- [Authentication](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [NGO and projects](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/ngos.ts): `backend/src/routes/ngos.ts`
- [Donation processing](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/donations.ts): `backend/src/routes/donations.ts`
- [Evidence processing](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/evidence.ts): `backend/src/routes/evidence.ts`
- [AI assistant API](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/routes/chat.ts): `backend/src/routes/chat.ts`
- [Database access](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/config/database.ts): `backend/src/config/database.ts`
- [Evidence storage](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/services/ipfs.service.ts): `backend/src/services/ipfs.service.ts`
- [Stellar integration](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/backend/src/lib/stellar.ts): `backend/src/lib/stellar.ts`

### Soroban contracts

- [Donation registry](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/donation_registry/src/lib.rs): `contracts/donation_registry/src/lib.rs`
- [NGO verification](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/ngo_verification/src/lib.rs): `contracts/ngo_verification/src/lib.rs`
- [Impact escrow](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/impact_escrow/src/lib.rs): `contracts/impact_escrow/src/lib.rs`
- [Evidence contract](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/evidence/src/lib.rs): `contracts/evidence/src/lib.rs`
- [Token manager](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/token_manager/src/lib.rs): `contracts/token_manager/src/lib.rs`
- [NFT minting](https://github.com/google-developers-group-iit-mandi/geoledger/blob/main/contracts/nft_minting/src/lib.rs): `contracts/nft_minting/src/lib.rs`

### External services

- **Google and Firebase**
- **Stellar network**
- **Gemini AI**
- **IPFS or Pinata**

### Other components

- **Donor or NGO**

## Connections

- Donor or NGO → Discovery and entry: browses (evidence: `frontend/src/app/page.tsx`)
- Discovery and entry → API client: loads NGOs (evidence: `frontend/src/app/page.tsx`)
- Donor or NGO → Web identity: authenticates (evidence: `README.md`)
- Web identity → Google and Firebase: signs in (evidence: `frontend/src/hooks/useGoogleAuth.ts`)
- Web identity → Authentication: posts login (evidence: `frontend/src/hooks/useGoogleAuth.ts`)
- Donor or NGO → Donation and dashboards: starts donation (evidence: `README.md`)
- Donation and dashboards → Wallet integration: connects wallet (evidence: `README.md`)
- Donation and dashboards → API client: requests donation (evidence: `README.md`)
- API client → Donation processing: calls API (evidence: `README.md`)
- Evidence submission → API client: prepares evidence
- API client → Evidence processing: uploads evidence (evidence: `README.md`)
- Donor or NGO → Giving assistant: asks questions (evidence: `README.md`)
- Giving assistant → API client: sends message (evidence: `README.md`)
- API client → AI assistant API: calls assistant (evidence: `README.md`)
- Discovery and entry → NGO and projects: lists NGOs (evidence: `frontend/src/app/page.tsx`)
- API application → API routing: mounts routes (evidence: `backend/src/app.ts`)
- API application → Database access: initializes database (evidence: `backend/src/app.ts`)
- API routing → Authentication: routes auth (evidence: `README.md`)
- API routing → NGO and projects: routes directories (evidence: `README.md`)
- API routing → Donation processing: routes donations (evidence: `README.md`)
- API routing → Evidence processing: routes evidence (evidence: `README.md`)
- API routing → AI assistant API: routes chat (evidence: `README.md`)
- Donation and dashboards → Stellar network: submits transactions (evidence: `README.md`)
- NGO and projects → NGO verification: verifies NGOs (evidence: `README.md`)
- Donation processing → Donation registry: records donations (evidence: `README.md`)
- Donation processing → Impact escrow: uses escrow (evidence: `README.md`)
- Evidence processing → Evidence storage: stores evidence (evidence: `README.md`)
- Evidence processing → Evidence contract: records proof (evidence: `README.md`)
- Donation processing → Token manager: handles tokens (evidence: `README.md`)
- Donation processing → NFT minting: mints NFTs (evidence: `README.md`)
- AI assistant API → Gemini AI: uses AI (evidence: `README.md`)
