# varshi072006/sih- architecture

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

- Interactive diagram: https://gitdiagram.com/varshi072006/sih-
- Repository: https://github.com/varshi072006/sih-

## Overview

Challenge to Impact is a civic problem-solving platform connecting citizens, government, universities, and industry. The main workflow runs from citizen problem submission and evidence, through government verification and ownership, AI decision support, university review, and industry participation in implementation; public pages expose problems and projects. Admin, identity, messaging, files, and live collaboration support that loop. The README documents the wider capabilities; sampled source confirms application setup, authentication, AI analysis, and file persistence, but not every router’s internal calls.

Main entry points: [`frontend/src/services/api.js`](https://github.com/varshi072006/sih-/blob/main/frontend/src/services/api.js) (HTTP client), [`frontend/src/App.jsx`](https://github.com/varshi072006/sih-/blob/main/frontend/src/App.jsx) (React app), [`backend/app/ai/pipeline.py`](https://github.com/varshi072006/sih-/blob/main/backend/app/ai/pipeline.py) (Analysis pipeline), [`frontend/src/context/AuthContext.jsx`](https://github.com/varshi072006/sih-/blob/main/frontend/src/context/AuthContext.jsx) (Login and registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["React app<br/>[App.jsx]"]
  node_authui["Login and registration<br/>[AuthContext.jsx]"]
  node_citizenui["Citizen portal"]
  node_govui["Government portal"]
  node_uniui["University portal"]
  node_industryui["Industry portal<br/>[IndustryPortal.jsx]"]
  node_publicui["Public discovery<br/>[ProblemsPage.jsx]"]
  node_adminui["Admin portal<br/>[AdminPortal.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_workflow["Problem-solving workflow"]
  node_auth_api["Identity API<br/>[auth.py]"]
  node_problems_api["Problem reports<br/>[problems.py]"]
  node_government_api["Government actions<br/>[government.py]"]
  node_ai_api["AI recommendations<br/>[ai.py]"]
  node_ai_pipeline["Analysis pipeline<br/>[pipeline.py]"]
  node_classification["Classification"]
  node_priority["Priority scoring"]
  node_university_matching["University matching"]
  node_university_api["University review<br/>[university.py]"]
  node_industry_api["Industry proposals<br/>[industry.py]"]
  node_projects_api["Projects and milestones<br/>[projects.py]"]
end

subgraph group_collaboration["Collaboration and oversight"]
  node_public_api["Public information<br/>[public.py]"]
  node_admin_api["Administration<br/>[admin.py]"]
  node_comms_api["Messages and notices<br/>[comms.py]"]
  node_assistant_api["AI assistant<br/>[assistant.py]"]
  node_socket_api["Live events<br/>[ws.py]"]
  node_socket_client["Live client"]
end

subgraph group_platform["Platform services"]
  node_files_api["Evidence files<br/>[files.py]"]
  node_storage["File storage<br/>[storage.py]"]
  node_audit["Audit trail<br/>[audit.py]"]
end

subgraph group_state["Persistent state"]
end

node_citizen(("Citizen"))
node_government(("Government"))
node_university(("University"))
node_industry(("Industry"))
node_admin(("Admin"))

node_citizen -->|"uses"| node_web
node_government -->|"uses"| node_web
node_university -->|"uses"| node_web
node_industry -->|"uses"| node_web
node_admin -->|"uses"| node_web
node_web -->|"routes"| node_authui
node_web -->|"routes"| node_citizenui
node_web -->|"routes"| node_govui
node_web -->|"routes"| node_uniui
node_web -->|"routes"| node_industryui
node_web -->|"routes"| node_publicui
node_web -->|"routes"| node_adminui
node_authui -->|"requests"| node_api_client
node_citizenui -->|"requests"| node_api_client
node_govui -->|"requests"| node_api_client
node_uniui -->|"requests"| node_api_client
node_industryui -->|"requests"| node_api_client
node_publicui -->|"requests"| node_api_client
node_adminui -->|"requests"| node_api_client
node_api_client -->|"HTTP requests"| node_auth_api
node_api_client -->|"HTTP requests"| node_problems_api
node_api_client -->|"HTTP requests"| node_government_api
node_api_client -->|"HTTP requests"| node_ai_api
node_api_client -->|"HTTP requests"| node_university_api
node_api_client -->|"HTTP requests"| node_industry_api
node_api_client -->|"HTTP requests"| node_projects_api
node_api_client -->|"HTTP requests"| node_public_api
node_api_client -->|"HTTP requests"| node_admin_api
node_api_client -->|"HTTP requests"| node_comms_api
node_api_client -->|"HTTP requests"| node_assistant_api
node_api_client -->|"HTTP requests"| node_files_api
node_problems_api -.->|"analysis"| node_ai_pipeline
node_ai_api -->|"analyses"| node_ai_pipeline
node_ai_pipeline -->|"classifies"| node_classification
node_ai_pipeline -->|"scores priority"| node_priority
node_ai_pipeline -->|"matches institutions"| node_university_matching
node_api_client -.->|"separate channel"| node_socket_client
node_socket_client -->|"socket events"| node_socket_api
node_files_api -->|"saves uploads"| node_storage

click node_web "https://github.com/varshi072006/sih-/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/varshi072006/sih-/blob/main/frontend/src/context/AuthContext.jsx"
click node_citizenui "https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/citizen/SubmitProblemPage.jsx"
click node_govui "https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/government/GovernmentPortal.jsx"
click node_uniui "https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/university/UniversityPortal.jsx"
click node_industryui "https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/industry/IndustryPortal.jsx"
click node_publicui "https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/public/ProblemsPage.jsx"
click node_adminui "https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/admin/AdminPortal.jsx"
click node_api_client "https://github.com/varshi072006/sih-/blob/main/frontend/src/services/api.js"
click node_auth_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/auth.py"
click node_problems_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/problems.py"
click node_government_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/government.py"
click node_ai_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/ai.py"
click node_ai_pipeline "https://github.com/varshi072006/sih-/blob/main/backend/app/ai/pipeline.py"
click node_classification "https://github.com/varshi072006/sih-/blob/main/backend/app/ai/classification_service.py"
click node_priority "https://github.com/varshi072006/sih-/blob/main/backend/app/ai/priority_service.py"
click node_university_matching "https://github.com/varshi072006/sih-/blob/main/backend/app/ai/university_matching_service.py"
click node_university_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/university.py"
click node_industry_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/industry.py"
click node_projects_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/projects.py"
click node_public_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/public.py"
click node_admin_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/admin.py"
click node_comms_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/comms.py"
click node_assistant_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/assistant.py"
click node_socket_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/ws.py"
click node_socket_client "https://github.com/varshi072006/sih-/blob/main/frontend/src/services/collaborationSocket.js"
click node_files_api "https://github.com/varshi072006/sih-/blob/main/backend/app/api/files.py"
click node_storage "https://github.com/varshi072006/sih-/blob/main/backend/app/services/storage.py"
click node_audit "https://github.com/varshi072006/sih-/blob/main/backend/app/services/audit.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_web,node_authui,node_citizenui,node_govui,node_uniui,node_industryui,node_publicui,node_adminui,node_api_client toneBlue
class node_auth_api,node_problems_api,node_government_api,node_ai_api,node_ai_pipeline,node_classification,node_priority,node_university_matching,node_university_api,node_industry_api,node_projects_api toneAmber
class node_public_api,node_admin_api,node_comms_api,node_assistant_api,node_socket_api,node_socket_client toneMint
class node_files_api,node_storage,node_audit toneRose
class node_citizen,node_government,node_university,node_industry,node_admin toneIndigo
```

## Components

### User experience

- [React app](https://github.com/varshi072006/sih-/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and registration](https://github.com/varshi072006/sih-/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Citizen portal](https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/citizen/SubmitProblemPage.jsx): `frontend/src/pages/citizen/SubmitProblemPage.jsx`
- [Government portal](https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/government/GovernmentPortal.jsx): `frontend/src/pages/government/GovernmentPortal.jsx`
- [University portal](https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/university/UniversityPortal.jsx): `frontend/src/pages/university/UniversityPortal.jsx`
- [Industry portal](https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/industry/IndustryPortal.jsx): `frontend/src/pages/industry/IndustryPortal.jsx`
- [Public discovery](https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/public/ProblemsPage.jsx): `frontend/src/pages/public/ProblemsPage.jsx`
- [Admin portal](https://github.com/varshi072006/sih-/blob/main/frontend/src/pages/admin/AdminPortal.jsx): `frontend/src/pages/admin/AdminPortal.jsx`
- [HTTP client](https://github.com/varshi072006/sih-/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Problem-solving workflow

- [Identity API](https://github.com/varshi072006/sih-/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Problem reports](https://github.com/varshi072006/sih-/blob/main/backend/app/api/problems.py): `backend/app/api/problems.py`
- [Government actions](https://github.com/varshi072006/sih-/blob/main/backend/app/api/government.py): `backend/app/api/government.py`
- [AI recommendations](https://github.com/varshi072006/sih-/blob/main/backend/app/api/ai.py): `backend/app/api/ai.py`
- [Analysis pipeline](https://github.com/varshi072006/sih-/blob/main/backend/app/ai/pipeline.py): `backend/app/ai/pipeline.py`
- [Classification](https://github.com/varshi072006/sih-/blob/main/backend/app/ai/classification_service.py): `backend/app/ai/classification_service.py`
- [Priority scoring](https://github.com/varshi072006/sih-/blob/main/backend/app/ai/priority_service.py): `backend/app/ai/priority_service.py`
- [University matching](https://github.com/varshi072006/sih-/blob/main/backend/app/ai/university_matching_service.py): `backend/app/ai/university_matching_service.py`
- [University review](https://github.com/varshi072006/sih-/blob/main/backend/app/api/university.py): `backend/app/api/university.py`
- [Industry proposals](https://github.com/varshi072006/sih-/blob/main/backend/app/api/industry.py): `backend/app/api/industry.py`
- [Projects and milestones](https://github.com/varshi072006/sih-/blob/main/backend/app/api/projects.py): `backend/app/api/projects.py`

### Collaboration and oversight

- [Public information](https://github.com/varshi072006/sih-/blob/main/backend/app/api/public.py): `backend/app/api/public.py`
- [Administration](https://github.com/varshi072006/sih-/blob/main/backend/app/api/admin.py): `backend/app/api/admin.py`
- [Messages and notices](https://github.com/varshi072006/sih-/blob/main/backend/app/api/comms.py): `backend/app/api/comms.py`
- [AI assistant](https://github.com/varshi072006/sih-/blob/main/backend/app/api/assistant.py): `backend/app/api/assistant.py`
- [Live events](https://github.com/varshi072006/sih-/blob/main/backend/app/api/ws.py): `backend/app/api/ws.py`
- [Live client](https://github.com/varshi072006/sih-/blob/main/frontend/src/services/collaborationSocket.js): `frontend/src/services/collaborationSocket.js`

### Platform services

- [Evidence files](https://github.com/varshi072006/sih-/blob/main/backend/app/api/files.py): `backend/app/api/files.py`
- [File storage](https://github.com/varshi072006/sih-/blob/main/backend/app/services/storage.py): `backend/app/services/storage.py`
- [Audit trail](https://github.com/varshi072006/sih-/blob/main/backend/app/services/audit.py): `backend/app/services/audit.py`

### Other components

- **Citizen**
- **Government**
- **University**
- **Industry**
- **Admin**

## Connections

- Citizen → React app: uses
- Government → React app: uses
- University → React app: uses
- Industry → React app: uses
- Admin → React app: uses
- React app → Login and registration: routes
- React app → Citizen portal: routes
- React app → Government portal: routes
- React app → University portal: routes
- React app → Industry portal: routes
- React app → Public discovery: routes
- React app → Admin portal: routes
- Login and registration → HTTP client: requests
- Citizen portal → HTTP client: requests
- Government portal → HTTP client: requests
- University portal → HTTP client: requests
- Industry portal → HTTP client: requests
- Public discovery → HTTP client: requests
- Admin portal → HTTP client: requests
- HTTP client → Identity API: HTTP requests
- HTTP client → Problem reports: HTTP requests
- HTTP client → Government actions: HTTP requests
- HTTP client → AI recommendations: HTTP requests
- HTTP client → University review: HTTP requests
- HTTP client → Industry proposals: HTTP requests
- HTTP client → Projects and milestones: HTTP requests
- HTTP client → Public information: HTTP requests
- HTTP client → Administration: HTTP requests
- HTTP client → Messages and notices: HTTP requests
- HTTP client → AI assistant: HTTP requests
- HTTP client → Evidence files: HTTP requests
- Problem reports → Analysis pipeline: analysis
- AI recommendations → Analysis pipeline: analyses
- Analysis pipeline → Classification: classifies
- Analysis pipeline → Priority scoring: scores priority
- Analysis pipeline → University matching: matches institutions
- HTTP client → Live client: separate channel
- Live client → Live events: socket events
- Evidence files → File storage: saves uploads
