# mallikantipavan/sewasetu architecture

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

- Interactive diagram: https://gitdiagram.com/mallikantipavan/sewasetu
- Repository: https://github.com/mallikantipavan/sewasetu

## Overview

Sewa Setu is an old-age pension portal with a citizen application/status journey, departmental processing, and an OAuth 2.1 authorization service. The graph preserves these distinct product branches and the nightly statutory approval job, plus the simulated SMS gateway. The excerpts show key calls and database operations; OAuth and admin details beyond the sampled sections are represented at module level, with no inferred internal call chains.

Main entry points: [`app/oauth.py`](https://github.com/mallikantipavan/sewasetu/blob/main/app/oauth.py) (OAuth endpoints), [`app/schema.sql`](https://github.com/mallikantipavan/sewasetu/blob/main/app/schema.sql) (Portal database), [`app/app.py`](https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py) (Application journey), [`smsgw/app.py`](https://github.com/mallikantipavan/sewasetu/blob/main/smsgw/app.py) (SMS gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen services"]
  node_application["Application journey<br/>[app.py]"]
  node_eligibility["Submission validation<br/>[app.py]"]
  node_status["Status and connections<br/>[app.py]"]
  node_uploads["Proof and acknowledgment<br/>[app.py]"]
end

subgraph group_department["Department operations"]
  node_admin["Review and decisions<br/>[app.py]"]
  node_sla["Deemed approval<br/>[deemed_approval.py]"]
end

subgraph group_identity["OAuth authorization"]
  node_oauth["OAuth endpoints<br/>[oauth.py]"]
end

subgraph group_platform["Shared infrastructure"]
  node_database[("Portal database<br/>[schema.sql]")]
  node_sms["SMS gateway<br/>[app.py]"]
end

node_applicant(("Applicant"))
node_officer(("Departmental user"))
node_client(("Third-party application"))

node_applicant -->|"starts application"| node_application
node_application -->|"sends OTP"| node_sms
node_application -->|"validates submission"| node_eligibility
node_eligibility -->|"checks active applications"| node_database
node_application -->|"stores application"| node_database
node_applicant -->|"checks or withdraws"| node_status
node_status -->|"reads application"| node_database
node_applicant -->|"uploads proof"| node_uploads
node_uploads -.->|"reads application"| node_database
node_officer -->|"reviews applications"| node_admin
node_admin -->|"records decisions"| node_database
node_sla -->|"updates overdue cases"| node_database
node_sla -->|"sends notification"| node_sms
node_applicant -->|"authorizes citizen access"| node_oauth
node_officer -->|"authorizes officer access"| node_oauth
node_client -->|"requests authorization"| node_oauth
node_oauth -->|"stores OAuth records"| node_database
node_oauth -.->|"uses portal sign-in"| node_status
node_oauth -.->|"uses departmental login"| node_admin
node_oauth -->|"issues tokens"| node_client
node_application -.->|"sends notifications"| node_sms

click node_application "https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py"
click node_eligibility "https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py"
click node_status "https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py"
click node_uploads "https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py"
click node_admin "https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py"
click node_sla "https://github.com/mallikantipavan/sewasetu/blob/main/app/scripts/deemed_approval.py"
click node_oauth "https://github.com/mallikantipavan/sewasetu/blob/main/app/oauth.py"
click node_database "https://github.com/mallikantipavan/sewasetu/blob/main/app/schema.sql"
click node_sms "https://github.com/mallikantipavan/sewasetu/blob/main/smsgw/app.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_application,node_eligibility,node_status,node_uploads,node_officer toneBlue
class node_admin,node_sla toneAmber
class node_oauth toneMint
class node_database,node_sms toneRose
class node_applicant,node_client toneIndigo
```

## Components

### Citizen services

- [Application journey](https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py): `app/app.py`
- [Submission validation](https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py): `app/app.py`
- [Status and connections](https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py): `app/app.py`
- [Proof and acknowledgment](https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py): `app/app.py`

### Department operations

- [Review and decisions](https://github.com/mallikantipavan/sewasetu/blob/main/app/app.py): `app/app.py`
- [Deemed approval](https://github.com/mallikantipavan/sewasetu/blob/main/app/scripts/deemed_approval.py): `app/scripts/deemed_approval.py`

### OAuth authorization

- [OAuth endpoints](https://github.com/mallikantipavan/sewasetu/blob/main/app/oauth.py): `app/oauth.py`

### Shared infrastructure

- [Portal database](https://github.com/mallikantipavan/sewasetu/blob/main/app/schema.sql): `app/schema.sql`
- [SMS gateway](https://github.com/mallikantipavan/sewasetu/blob/main/smsgw/app.py): `smsgw/app.py`

### Other components

- **Applicant**
- **Departmental user**
- **Third-party application**

## Connections

- Applicant → Application journey: starts application (evidence: `README.md`)
- Application journey → SMS gateway: sends OTP (evidence: `app/app.py`)
- Application journey → Submission validation: validates submission (evidence: `app/app.py`)
- Submission validation → Portal database: checks active applications (evidence: `app/app.py`)
- Application journey → Portal database: stores application (evidence: `app/app.py`)
- Applicant → Status and connections: checks or withdraws (evidence: `README.md`)
- Status and connections → Portal database: reads application (evidence: `app/app.py`)
- Applicant → Proof and acknowledgment: uploads proof (evidence: `README.md`)
- Proof and acknowledgment → Portal database: reads application
- Departmental user → Review and decisions: reviews applications (evidence: `README.md`)
- Review and decisions → Portal database: records decisions (evidence: `README.md`)
- Deemed approval → Portal database: updates overdue cases (evidence: `app/scripts/deemed_approval.py`)
- Deemed approval → SMS gateway: sends notification (evidence: `app/scripts/deemed_approval.py`)
- Applicant → OAuth endpoints: authorizes citizen access (evidence: `README.md`)
- Departmental user → OAuth endpoints: authorizes officer access (evidence: `README.md`)
- Third-party application → OAuth endpoints: requests authorization (evidence: `README.md`)
- OAuth endpoints → Portal database: stores OAuth records (evidence: `app/oauth.py`)
- OAuth endpoints → Status and connections: uses portal sign-in (evidence: `app/oauth.py`)
- OAuth endpoints → Review and decisions: uses departmental login (evidence: `app/oauth.py`)
- OAuth endpoints → Third-party application: issues tokens (evidence: `README.md`)
- Application journey → SMS gateway: sends notifications
