# adityarawat00189/footprint-zero architecture

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

- Interactive diagram: https://gitdiagram.com/adityarawat00189/footprint-zero
- Repository: https://github.com/adityarawat00189/footprint-zero

## Overview

FootprintZero scans a user’s breach and data-broker exposure, ranks privacy risk, drafts statutory erasure notices, pauses for user approval or revision, then dispatches notices and tracks deadlines for follow-up escalation. The React client supports dashboard, approval, and case-tracking workflows; the Express service persists users, exposures, cases, and audit records, while a Python LangGraph service performs discovery, risk scoring, drafting, and follow-up. The README documents the full pipeline; unsampled UI and backend details are represented only at subsystem level.

Main entry points: [`agent-service/graph/build_graph.py`](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/graph/build_graph.py) (Pipeline orchestration), [`client/src/App.jsx`](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/App.jsx) (Web app routing), [`server/src/server.js`](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/server.js) (REST routes), [`server/src/services/agentServiceClient.js`](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/services/agentServiceClient.js) (Agent service client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User application"]
  node_web["Web app routing<br/>[App.jsx]"]
  node_authui["Sign-in session<br/>[AuthContext.jsx]"]
  node_dashboard["Exposure dashboard<br/>[DashboardPage.jsx]"]
  node_approvalui["Approval queue"]
  node_tracker["Case tracker"]
  node_http["API client<br/>[axiosClient.js]"]
end

subgraph group_api["Application service"]
  node_routes["REST routes<br/>[server.js]"]
  node_auth["JWT authorization<br/>[auth.js]"]
  node_scan["Exposure scanning"]
  node_cases["Case and approval handling<br/>[caseController.js]"]
  node_agentclient["Agent service client"]
end

subgraph group_agents["Privacy agent pipeline"]
  node_agentapi["Agent HTTP endpoints<br/>[main.py]"]
  node_graph["Pipeline orchestration<br/>[build_graph.py]"]
  node_discovery["Breach and broker discovery<br/>[discovery_agent.py]"]
  node_hibp["HIBP scanner<br/>[hibp_tool.py]"]
  node_brokerlookup["Broker registry lookup<br/>[broker_db_tool.py]"]
  node_risk["Risk ranking"]
  node_draft["Legal notice drafting"]
  node_rag["Legal citation retrieval<br/>[vector_store.py]"]
  node_clauses["Statutory clauses<br/>[clauses.py]"]
  node_executor["Notice execution<br/>[executor_agent.py]"]
  node_followup["Deadline escalation<br/>[followup_agent.py]"]
  node_state["Pipeline case state<br/>[state.py]"]
end

subgraph group_state["Persistence and deadlines"]
  node_mongo[("MongoDB records<br/>[db.js]")]
  node_cron["Statutory scheduler<br/>[cronService.js]"]
  node_models[("User, exposure, case records<br/>[Case.js]")]
end

node_user(("Privacy user"))

node_user -->|"uses"| node_web
node_web -->|"provides session"| node_authui
node_web -->|"routes to"| node_dashboard
node_web -->|"routes to"| node_approvalui
node_web -->|"routes to"| node_tracker
node_authui -->|"requests through"| node_http
node_dashboard -->|"requests through"| node_http
node_http -->|"calls REST API"| node_routes
node_routes -->|"protects routes"| node_auth
node_routes -.->|"routes scan requests"| node_scan
node_routes -->|"routes case requests"| node_cases
node_scan -->|"scans via"| node_agentclient
node_cases -->|"starts and resumes"| node_agentclient
node_agentclient -.->|"calls service"| node_agentapi
node_agentapi -->|"invokes pipeline"| node_graph
node_graph -->|"dispatches first"| node_discovery
node_graph -->|"dispatches after discovery"| node_risk
node_graph -->|"dispatches after ranking"| node_draft
node_graph -->|"dispatches on approval"| node_executor
node_graph -->|"registers follow-up"| node_followup
node_discovery -->|"queries breaches"| node_hibp
node_discovery -->|"queries brokers"| node_brokerlookup
node_draft -->|"retrieves authorities"| node_rag
node_rag -->|"loads clauses"| node_clauses
node_graph -->|"uses shared state"| node_state
node_scan -->|"writes exposures"| node_models
node_cases -->|"reads and writes cases"| node_models
node_cron -->|"requests follow-up"| node_agentclient
node_cron -->|"audits overdue cases"| node_models
node_models -.->|"persists records"| node_mongo

click node_web "https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/App.jsx"
click node_authui "https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/pages/DashboardPage.jsx"
click node_approvalui "https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/pages/ApprovalQueuePage.jsx"
click node_tracker "https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/pages/CaseTrackerPage.jsx"
click node_http "https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/api/axiosClient.js"
click node_routes "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/server.js"
click node_auth "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/middleware/auth.js"
click node_scan "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/controllers/exposureController.js"
click node_cases "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/controllers/caseController.js"
click node_agentclient "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/services/agentServiceClient.js"
click node_agentapi "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/main.py"
click node_graph "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/graph/build_graph.py"
click node_discovery "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/discovery_agent.py"
click node_hibp "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/tools/hibp_tool.py"
click node_brokerlookup "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/tools/broker_db_tool.py"
click node_risk "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/risk_ranking_agent.py"
click node_draft "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/legal_drafting_agent.py"
click node_rag "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/rag/vector_store.py"
click node_clauses "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/rag/legal_templates/clauses.py"
click node_executor "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/executor_agent.py"
click node_followup "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/followup_agent.py"
click node_state "https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/graph/state.py"
click node_mongo "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/config/db.js"
click node_cron "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/services/cronService.js"
click node_models "https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/models/Case.js"

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_web,node_authui,node_dashboard,node_approvalui,node_tracker,node_http,node_user toneBlue
class node_routes,node_auth,node_scan,node_cases,node_agentclient toneAmber
class node_agentapi,node_graph,node_discovery,node_hibp,node_brokerlookup,node_risk,node_draft,node_rag,node_clauses,node_executor,node_followup,node_state toneMint
class node_mongo,node_cron,node_models toneRose
```

## Components

### User application

- [Web app routing](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in session](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Exposure dashboard](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/pages/DashboardPage.jsx): `client/src/pages/DashboardPage.jsx`
- [Approval queue](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/pages/ApprovalQueuePage.jsx): `client/src/pages/ApprovalQueuePage.jsx`
- [Case tracker](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/pages/CaseTrackerPage.jsx): `client/src/pages/CaseTrackerPage.jsx`
- [API client](https://github.com/adityarawat00189/footprint-zero/blob/main/client/src/api/axiosClient.js): `client/src/api/axiosClient.js`

### Application service

- [REST routes](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/server.js): `server/src/server.js`
- [JWT authorization](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Exposure scanning](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/controllers/exposureController.js): `server/src/controllers/exposureController.js`
- [Case and approval handling](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/controllers/caseController.js): `server/src/controllers/caseController.js`
- [Agent service client](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/services/agentServiceClient.js): `server/src/services/agentServiceClient.js`

### Privacy agent pipeline

- [Agent HTTP endpoints](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/main.py): `agent-service/main.py`
- [Pipeline orchestration](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/graph/build_graph.py): `agent-service/graph/build_graph.py`
- [Breach and broker discovery](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/discovery_agent.py): `agent-service/agents/discovery_agent.py`
- [HIBP scanner](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/tools/hibp_tool.py): `agent-service/tools/hibp_tool.py`
- [Broker registry lookup](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/tools/broker_db_tool.py): `agent-service/tools/broker_db_tool.py`
- [Risk ranking](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/risk_ranking_agent.py): `agent-service/agents/risk_ranking_agent.py`
- [Legal notice drafting](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/legal_drafting_agent.py): `agent-service/agents/legal_drafting_agent.py`
- [Legal citation retrieval](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/rag/vector_store.py): `agent-service/rag/vector_store.py`
- [Statutory clauses](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/rag/legal_templates/clauses.py): `agent-service/rag/legal_templates/clauses.py`
- [Notice execution](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/executor_agent.py): `agent-service/agents/executor_agent.py`
- [Deadline escalation](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/agents/followup_agent.py): `agent-service/agents/followup_agent.py`
- [Pipeline case state](https://github.com/adityarawat00189/footprint-zero/blob/main/agent-service/graph/state.py): `agent-service/graph/state.py`

### Persistence and deadlines

- [MongoDB records](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/config/db.js): `server/src/config/db.js`
- [Statutory scheduler](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/services/cronService.js): `server/src/services/cronService.js`
- [User, exposure, case records](https://github.com/adityarawat00189/footprint-zero/blob/main/server/src/models/Case.js): `server/src/models/Case.js`

### Other components

- **Privacy user**

## Connections

- Privacy user → Web app routing: uses (evidence: `README.md`)
- Web app routing → Sign-in session: provides session (evidence: `client/src/App.jsx`)
- Web app routing → Exposure dashboard: routes to (evidence: `client/src/App.jsx`)
- Web app routing → Approval queue: routes to (evidence: `client/src/App.jsx`)
- Web app routing → Case tracker: routes to (evidence: `client/src/App.jsx`)
- Sign-in session → API client: requests through (evidence: `client/src/context/AuthContext.jsx`)
- Exposure dashboard → API client: requests through (evidence: `client/src/pages/DashboardPage.jsx`)
- API client → REST routes: calls REST API (evidence: `README.md`)
- REST routes → JWT authorization: protects routes
- REST routes → Exposure scanning: routes scan requests
- REST routes → Case and approval handling: routes case requests
- Exposure scanning → Agent service client: scans via (evidence: `server/src/controllers/exposureController.js`)
- Case and approval handling → Agent service client: starts and resumes (evidence: `server/src/controllers/caseController.js`)
- Agent service client → Agent HTTP endpoints: calls service
- Agent HTTP endpoints → Pipeline orchestration: invokes pipeline (evidence: `agent-service/main.py`)
- Pipeline orchestration → Breach and broker discovery: dispatches first (evidence: `agent-service/graph/build_graph.py`)
- Pipeline orchestration → Risk ranking: dispatches after discovery (evidence: `agent-service/graph/build_graph.py`)
- Pipeline orchestration → Legal notice drafting: dispatches after ranking (evidence: `agent-service/graph/build_graph.py`)
- Pipeline orchestration → Notice execution: dispatches on approval (evidence: `agent-service/graph/build_graph.py`)
- Pipeline orchestration → Deadline escalation: registers follow-up (evidence: `agent-service/graph/build_graph.py`)
- Breach and broker discovery → HIBP scanner: queries breaches (evidence: `agent-service/agents/discovery_agent.py`)
- Breach and broker discovery → Broker registry lookup: queries brokers (evidence: `agent-service/agents/discovery_agent.py`)
- Legal notice drafting → Legal citation retrieval: retrieves authorities (evidence: `agent-service/agents/legal_drafting_agent.py`)
- Legal citation retrieval → Statutory clauses: loads clauses (evidence: `agent-service/rag/vector_store.py`)
- Pipeline orchestration → Pipeline case state: uses shared state (evidence: `agent-service/graph/build_graph.py`)
- Exposure scanning → User, exposure, case records: writes exposures (evidence: `server/src/controllers/exposureController.js`)
- Case and approval handling → User, exposure, case records: reads and writes cases (evidence: `server/src/controllers/caseController.js`)
- Statutory scheduler → Agent service client: requests follow-up (evidence: `server/src/services/cronService.js`)
- Statutory scheduler → User, exposure, case records: audits overdue cases (evidence: `server/src/services/cronService.js`)
- User, exposure, case records → MongoDB records: persists records
