# aneeshtele-eric/givtak architecture

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

- Interactive diagram: https://gitdiagram.com/aneeshtele-eric/givtak
- Repository: https://github.com/aneeshtele-eric/givtak

## Overview

GIVTAK is a civic mobility and disaster-response service. Its main workflow accepts an operator query, uses Gemini to select deterministic tools, and returns a response; separate APIs support commuter and fleet onboarding, approvals, and audit visibility. The graph also preserves the README’s privacy, HITL, Firestore, and mobility-tool capabilities, plus the sampled EcoShield census and relief functions. Source excerpts are partial, so unsampled details and unsupported links are omitted.

Main entry points: [`server.py`](https://github.com/aneeshtele-eric/givtak/blob/main/server.py) (HTTP API), [`agent_engine.py`](https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py) (SHARE agent), [`index.html`](https://github.com/aneeshtele-eric/givtak/blob/main/index.html) (Web interface), [`antigravity_guard.py`](https://github.com/aneeshtele-eric/givtak/blob/main/antigravity_guard.py) (Privacy guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Service access"]
  node_api["HTTP API<br/>[server.py]"]
  node_web["Web interface<br/>[index.html]"]
end

subgraph group_reasoning["Agent reasoning"]
  node_gemini["Gemini orchestrator<br/>[server.py]"]
  node_share_agent["SHARE agent<br/>[agent_engine.py]"]
end

subgraph group_domain["Mobility and civic tools"]
  node_toolset["Deterministic tools<br/>[server.py]"]
  node_commuter_data["Commuter data<br/>[agent_engine.py]"]
  node_mobility["Mobility planning<br/>[server.py]"]
  node_traffic_flood["Traffic and flood tools<br/>[server.py]"]
  node_geofence["Geofence census<br/>[server.py]"]
  node_relief["Relief calculator<br/>[server.py]"]
  node_ecoshield["EcoShield reports<br/>[agent_engine.py]"]
end

subgraph group_governance["State and governance"]
  node_privacy_guard["Privacy guard"]
  node_firestore[("Firestore")]
  node_approval_audit["Approval and run logs<br/>[server.py]"]
  node_payment["UPI authorization<br/>[server.py]"]
end

node_operator(("Operator"))

node_operator -.->|"uses"| node_web
node_web -.->|"submits queries"| node_api
node_operator -->|"calls endpoints"| node_api
node_api -->|"runs query"| node_gemini
node_gemini -->|"invokes tools"| node_toolset
node_toolset -->|"calculates pooling"| node_mobility
node_toolset -->|"scores hazards"| node_traffic_flood
node_toolset -->|"counts visitors"| node_geofence
node_toolset -->|"estimates supplies"| node_relief
node_api -.->|"not shown"| node_share_agent
node_share_agent -->|"checks consent"| node_privacy_guard
node_share_agent -->|"loads seed data"| node_commuter_data
node_share_agent -->|"computes reports"| node_ecoshield
node_api -->|"persists batch"| node_firestore
node_operator -->|"records approvals"| node_approval_audit
node_api -->|"serves run logs"| node_approval_audit
node_operator -->|"requests authorization"| node_payment

click node_api "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_web "https://github.com/aneeshtele-eric/givtak/blob/main/index.html"
click node_gemini "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_toolset "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_share_agent "https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py"
click node_privacy_guard "https://github.com/aneeshtele-eric/givtak/blob/main/antigravity_guard.py"
click node_commuter_data "https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py"
click node_mobility "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_traffic_flood "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_geofence "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_relief "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_ecoshield "https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py"
click node_approval_audit "https://github.com/aneeshtele-eric/givtak/blob/main/server.py"
click node_payment "https://github.com/aneeshtele-eric/givtak/blob/main/server.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_api,node_web toneBlue
class node_gemini,node_share_agent toneAmber
class node_toolset,node_commuter_data,node_mobility,node_traffic_flood,node_geofence,node_relief,node_ecoshield toneMint
class node_privacy_guard,node_firestore,node_approval_audit,node_payment toneRose
class node_operator toneIndigo
```

## Components

### Service access

- [HTTP API](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [Web interface](https://github.com/aneeshtele-eric/givtak/blob/main/index.html): `index.html`

### Agent reasoning

- [Gemini orchestrator](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [SHARE agent](https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py): `agent_engine.py`

### Mobility and civic tools

- [Deterministic tools](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [Commuter data](https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py): `agent_engine.py`
- [Mobility planning](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [Traffic and flood tools](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [Geofence census](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [Relief calculator](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [EcoShield reports](https://github.com/aneeshtele-eric/givtak/blob/main/agent_engine.py): `agent_engine.py`

### State and governance

- [Privacy guard](https://github.com/aneeshtele-eric/givtak/blob/main/antigravity_guard.py): `antigravity_guard.py`
- **Firestore**
- [Approval and run logs](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`
- [UPI authorization](https://github.com/aneeshtele-eric/givtak/blob/main/server.py): `server.py`

### Other components

- **Operator**

## Connections

- Operator → Web interface: uses
- Web interface → HTTP API: submits queries
- Operator → HTTP API: calls endpoints (evidence: `server.py`)
- HTTP API → Gemini orchestrator: runs query (evidence: `server.py`)
- Gemini orchestrator → Deterministic tools: invokes tools (evidence: `server.py`)
- Deterministic tools → Mobility planning: calculates pooling (evidence: `server.py`)
- Deterministic tools → Traffic and flood tools: scores hazards (evidence: `server.py`)
- Deterministic tools → Geofence census: counts visitors (evidence: `server.py`)
- Deterministic tools → Relief calculator: estimates supplies (evidence: `server.py`)
- HTTP API → SHARE agent: not shown
- SHARE agent → Privacy guard: checks consent (evidence: `agent_engine.py`)
- SHARE agent → Commuter data: loads seed data (evidence: `agent_engine.py`)
- SHARE agent → EcoShield reports: computes reports (evidence: `agent_engine.py`)
- HTTP API → Firestore: persists batch (evidence: `server.py`)
- Operator → Approval and run logs: records approvals (evidence: `server.py`)
- HTTP API → Approval and run logs: serves run logs (evidence: `server.py`)
- Operator → UPI authorization: requests authorization (evidence: `server.py`)
