# utkarsh713/proof-of-work architecture

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

- Interactive diagram: https://gitdiagram.com/utkarsh713/proof-of-work
- Repository: https://github.com/utkarsh713/proof-of-work

## Overview

Proof of Work is a public-infrastructure verification platform. A user registers a work item with before/after evidence and location; the React application sends it to the Spring backend, which manages work and verification data and connects to the AI service. Results and related work information are then presented through verification, dashboard, feedback, and reporting views. The README documents GPS/time checks, AI analysis, citizen feedback, notifications, analytics, and audit logs; unsampled backend details are represented at their existing source paths, with edges limited to documented or indexed relationships.

Main entry points: [`frontend/src/App.jsx`](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/App.jsx) (React routes), [`backend/src/main/java/com/proofofwork/demo/controller`](https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/controller) (Spring REST controllers), [`backend/src/main/java/com/proofofwork/demo/repository`](https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/repository) (Data repositories), [`frontend/src/api/workApi.js`](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/workApi.js) (Work API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_app["React routes<br/>[App.jsx]"]
  node_authpages["Login and registration<br/>[Register.jsx]"]
  node_authapi["Authentication API<br/>[authApi.js]"]
  node_workform["Work registration<br/>[RegisterWork.jsx]"]
  node_workapi["Work API client<br/>[workApi.js]"]
  node_apiclient["Backend API client<br/>[apiClient.js]"]
  node_dashboard["Dashboard and submissions<br/>[Dashboard.jsx]"]
  node_verificationui["AI verification view<br/>[AIVerification.jsx]"]
  node_feedbackui["Citizen feedback"]
  node_insights["Maps and analytics<br/>[Analytics.jsx]"]
  node_reports["Reports and notifications<br/>[Reports.jsx]"]
end

subgraph group_backend["Backend services"]
  node_backendapi["Spring REST controllers"]
  node_authservice["Authentication service<br/>[AuthService.java]"]
  node_workservice["Work management<br/>[WorkService.java]"]
  node_evidenceservice["Evidence handling"]
  node_verificationservice["Verification coordination"]
  node_aiclient["AI service client"]
end

subgraph group_ai["AI analysis"]
  node_aiservice["AI verification API<br/>[main.py]"]
  node_forensics["Image forensics"]
end

subgraph group_data["Persistence"]
  node_repositories["Data repositories"]
  node_records["Work and evidence records"]
  node_mysql[("MySQL database")]
end

node_user(("Platform user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_workform
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_verificationui
node_app -->|"routes to"| node_feedbackui
node_app -->|"routes to"| node_insights
node_app -->|"routes to"| node_reports
node_authpages -->|"submits credentials"| node_authapi
node_workform -->|"creates work"| node_workapi
node_dashboard -->|"loads works"| node_workapi
node_verificationui -->|"loads works"| node_workapi
node_verificationui -.->|"requests verification"| node_backendapi
node_feedbackui -.->|"submits feedback"| node_backendapi
node_insights -->|"loads work data"| node_workapi
node_workapi -->|"sends requests"| node_apiclient
node_authapi -->|"sends requests"| node_apiclient
node_apiclient -->|"calls REST API"| node_backendapi
node_backendapi -.->|"delegates auth"| node_authservice
node_backendapi -.->|"delegates work"| node_workservice
node_backendapi -.->|"handles evidence"| node_evidenceservice
node_backendapi -.->|"starts verification"| node_verificationservice
node_verificationservice -.->|"requests analysis"| node_aiclient
node_aiclient -->|"calls AI service"| node_aiservice
node_aiservice -->|"uses forensics"| node_forensics
node_workservice -.->|"persists work"| node_repositories
node_evidenceservice -.->|"persists evidence"| node_repositories
node_verificationservice -.->|"stores results"| node_repositories
node_repositories -.->|"maps records"| node_records
node_repositories -->|"reads and writes"| node_mysql

click node_app "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Register.jsx"
click node_authapi "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/authApi.js"
click node_workform "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/RegisterWork.jsx"
click node_workapi "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/workApi.js"
click node_apiclient "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/apiClient.js"
click node_dashboard "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Dashboard.jsx"
click node_verificationui "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/AIVerification.jsx"
click node_feedbackui "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/CitizenFeedback.jsx"
click node_insights "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Analytics.jsx"
click node_reports "https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Reports.jsx"
click node_backendapi "https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/controller"
click node_authservice "https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/AuthService.java"
click node_workservice "https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/WorkService.java"
click node_evidenceservice "https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/EvidenceService.java"
click node_verificationservice "https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/VerificationService.java"
click node_aiclient "https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/client/AIServiceClient.java"
click node_aiservice "https://github.com/utkarsh713/proof-of-work/blob/main/ai-service/main.py"
click node_forensics "https://github.com/utkarsh713/proof-of-work/blob/main/ai-service/forensic_analysis.py"
click node_repositories "https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/repository"
click node_records "https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/entity"

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_authpages,node_authapi,node_workform,node_workapi,node_apiclient,node_dashboard,node_verificationui,node_feedbackui,node_insights,node_reports,node_user toneBlue
class node_backendapi,node_authservice,node_workservice,node_evidenceservice,node_verificationservice,node_aiclient toneAmber
class node_aiservice,node_forensics toneMint
class node_repositories,node_records,node_mysql toneRose
```

## Components

### Web application

- [React routes](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and registration](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [Authentication API](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/authApi.js): `frontend/src/api/authApi.js`
- [Work registration](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/RegisterWork.jsx): `frontend/src/pages/RegisterWork.jsx`
- [Work API client](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/workApi.js): `frontend/src/api/workApi.js`
- [Backend API client](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/api/apiClient.js): `frontend/src/api/apiClient.js`
- [Dashboard and submissions](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [AI verification view](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/AIVerification.jsx): `frontend/src/pages/AIVerification.jsx`
- [Citizen feedback](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/CitizenFeedback.jsx): `frontend/src/pages/CitizenFeedback.jsx`
- [Maps and analytics](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Analytics.jsx): `frontend/src/pages/Analytics.jsx`
- [Reports and notifications](https://github.com/utkarsh713/proof-of-work/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`

### Backend services

- [Spring REST controllers](https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/controller): `backend/src/main/java/com/proofofwork/demo/controller`
- [Authentication service](https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/AuthService.java): `backend/src/main/java/com/proofofwork/demo/service/AuthService.java`
- [Work management](https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/WorkService.java): `backend/src/main/java/com/proofofwork/demo/service/WorkService.java`
- [Evidence handling](https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/EvidenceService.java): `backend/src/main/java/com/proofofwork/demo/service/EvidenceService.java`
- [Verification coordination](https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/service/VerificationService.java): `backend/src/main/java/com/proofofwork/demo/service/VerificationService.java`
- [AI service client](https://github.com/utkarsh713/proof-of-work/blob/main/backend/src/main/java/com/proofofwork/demo/client/AIServiceClient.java): `backend/src/main/java/com/proofofwork/demo/client/AIServiceClient.java`

### AI analysis

- [AI verification API](https://github.com/utkarsh713/proof-of-work/blob/main/ai-service/main.py): `ai-service/main.py`
- [Image forensics](https://github.com/utkarsh713/proof-of-work/blob/main/ai-service/forensic_analysis.py): `ai-service/forensic_analysis.py`

### Persistence

- [Data repositories](https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/repository): `backend/src/main/java/com/proofofwork/demo/repository`
- [Work and evidence records](https://github.com/utkarsh713/proof-of-work/tree/main/backend/src/main/java/com/proofofwork/demo/entity): `backend/src/main/java/com/proofofwork/demo/entity`
- **MySQL database**

### Other components

- **Platform user**

## Connections

- Platform user → React routes: uses (evidence: `README.md`)
- React routes → Login and registration: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Work registration: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Dashboard and submissions: routes to (evidence: `frontend/src/App.jsx`)
- React routes → AI verification view: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Citizen feedback: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Maps and analytics: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Reports and notifications: routes to (evidence: `frontend/src/App.jsx`)
- Login and registration → Authentication API: submits credentials (evidence: `frontend/src/pages/Register.jsx`)
- Work registration → Work API client: creates work (evidence: `frontend/src/pages/RegisterWork.jsx`)
- Dashboard and submissions → Work API client: loads works (evidence: `frontend/src/pages/Dashboard.jsx`)
- AI verification view → Work API client: loads works (evidence: `frontend/src/pages/AIVerification.jsx`)
- AI verification view → Spring REST controllers: requests verification (evidence: `README.md`)
- Citizen feedback → Spring REST controllers: submits feedback (evidence: `README.md`)
- Maps and analytics → Work API client: loads work data (evidence: `frontend/src/pages/Analytics.jsx`)
- Work API client → Backend API client: sends requests (evidence: `frontend/src/api/workApi.js`)
- Authentication API → Backend API client: sends requests (evidence: `frontend/src/api/authApi.js`)
- Backend API client → Spring REST controllers: calls REST API (evidence: `README.md`)
- Spring REST controllers → Authentication service: delegates auth
- Spring REST controllers → Work management: delegates work
- Spring REST controllers → Evidence handling: handles evidence
- Spring REST controllers → Verification coordination: starts verification
- Verification coordination → AI service client: requests analysis (evidence: `README.md`)
- AI service client → AI verification API: calls AI service (evidence: `README.md`)
- AI verification API → Image forensics: uses forensics (evidence: `ai-service/main.py`)
- Work management → Data repositories: persists work (evidence: `README.md`)
- Evidence handling → Data repositories: persists evidence (evidence: `README.md`)
- Verification coordination → Data repositories: stores results (evidence: `README.md`)
- Data repositories → Work and evidence records: maps records
- Data repositories → MySQL database: reads and writes (evidence: `README.md`)
