# kumarianetham-bot/identix-api architecture

> Architecture diagram of the GitHub repository kumarianetham-bot/identix-api, 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/kumarianetham-bot/identix-api
- Repository: https://github.com/kumarianetham-bot/identix-api

## Overview

IDentix is a FastAPI service for school administrators to manage student enrollment and identity cards. Administrators register students, review enrollment and pending-card status, generate and retrieve PDF cards, and manage accounts and notifications. The API routers own these workflows, with SQLAlchemy models and a PostgreSQL session layer for persistence; Cloudinary stores student photos and generated PDFs. The graph follows documented features and sampled imports/calls; unsampled router implementations are represented as documented capabilities, so their internal dependencies are omitted.

Main entry points: [`main.py`](https://github.com/kumarianetham-bot/identix-api/blob/api-development/main.py) (FastAPI application), [`database.py`](https://github.com/kumarianetham-bot/identix-api/blob/api-development/database.py) (Database sessions), [`models.py`](https://github.com/kumarianetham-bot/identix-api/blob/api-development/models.py) (Domain models), [`routers/idcard_generator.py`](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/idcard_generator.py) (Card generation and download)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_app["FastAPI application<br/>[main.py]"]
end

subgraph group_people["Enrollment and access"]
  node_auth["Admin authentication<br/>[auth.py]"]
  node_students["Student management<br/>[students.py]"]
end

subgraph group_cards["Identity cards"]
  node_cardgen["Card generation and download"]
  node_cardrecords["Card records<br/>[idcard.py]"]
  node_pdf["PDF card design<br/>[pdf_generator.py]"]
end

subgraph group_operations["Administration and dashboard"]
  node_adminmgmt["Admin management<br/>[admin.py]"]
  node_stats["Dashboard and enrollments<br/>[stats.py]"]
  node_notifications["Activity notifications<br/>[notifications.py]"]
  node_upload["File upload endpoint<br/>[upload.py]"]
end

subgraph group_persistence["Data and storage"]
  node_models["Domain models<br/>[models.py]"]
  node_database["Database sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
  node_cloudinary[("Cloudinary storage")]
  node_cloudhelpers["Cloudinary helpers"]
end

node_admin(("Administrator"))

node_admin -->|"calls API"| node_app
node_app -->|"registers routes"| node_auth
node_app -->|"registers routes"| node_students
node_app -->|"registers routes"| node_cardgen
node_app -->|"registers routes"| node_cardrecords
node_app -->|"registers routes"| node_adminmgmt
node_app -->|"registers routes"| node_notifications
node_app -->|"registers routes"| node_upload
node_app -->|"registers routes"| node_stats
node_app -->|"creates tables"| node_database
node_auth -->|"opens sessions"| node_database
node_students -->|"opens sessions"| node_database
node_cardgen -->|"opens sessions"| node_database
node_cardrecords -->|"opens sessions"| node_database
node_adminmgmt -->|"opens sessions"| node_database
node_stats -->|"opens sessions"| node_database
node_notifications -->|"opens sessions"| node_database
node_models -->|"uses base"| node_database
node_database -->|"connects"| node_postgres
node_auth -->|"defines auth table"| node_models
node_students -->|"reads and writes"| node_models
node_cardgen -->|"reads and writes"| node_models
node_cardrecords -->|"reads and writes"| node_models
node_adminmgmt -->|"reads and writes"| node_models
node_stats -->|"queries metrics"| node_models
node_notifications -->|"reads and writes"| node_models
node_students -->|"uploads photos"| node_cloudinary
node_cardgen -->|"generates PDF"| node_pdf
node_cardgen -->|"uploads PDF"| node_cloudhelpers
node_cloudhelpers -->|"uploads files"| node_cloudinary
node_upload -->|"uses helpers"| node_cloudhelpers

click node_app "https://github.com/kumarianetham-bot/identix-api/blob/api-development/main.py"
click node_auth "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/auth.py"
click node_students "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/students.py"
click node_cardgen "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/idcard_generator.py"
click node_cardrecords "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/idcard.py"
click node_pdf "https://github.com/kumarianetham-bot/identix-api/blob/api-development/pdf_generator.py"
click node_adminmgmt "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/admin.py"
click node_stats "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/stats.py"
click node_notifications "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/notifications.py"
click node_upload "https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/upload.py"
click node_models "https://github.com/kumarianetham-bot/identix-api/blob/api-development/models.py"
click node_database "https://github.com/kumarianetham-bot/identix-api/blob/api-development/database.py"
click node_cloudhelpers "https://github.com/kumarianetham-bot/identix-api/blob/api-development/cloudinary_config.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_app toneBlue
class node_auth,node_students toneAmber
class node_cardgen,node_cardrecords,node_pdf toneMint
class node_adminmgmt,node_stats,node_notifications,node_upload toneRose
class node_models,node_database,node_postgres,node_cloudinary,node_cloudhelpers,node_admin toneIndigo
```

## Components

### API runtime

- [FastAPI application](https://github.com/kumarianetham-bot/identix-api/blob/api-development/main.py): `main.py`

### Enrollment and access

- [Admin authentication](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/auth.py): `routers/auth.py`
- [Student management](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/students.py): `routers/students.py`

### Identity cards

- [Card generation and download](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/idcard_generator.py): `routers/idcard_generator.py`
- [Card records](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/idcard.py): `routers/idcard.py`
- [PDF card design](https://github.com/kumarianetham-bot/identix-api/blob/api-development/pdf_generator.py): `pdf_generator.py`

### Administration and dashboard

- [Admin management](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/admin.py): `routers/admin.py`
- [Dashboard and enrollments](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/stats.py): `routers/stats.py`
- [Activity notifications](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/notifications.py): `routers/notifications.py`
- [File upload endpoint](https://github.com/kumarianetham-bot/identix-api/blob/api-development/routers/upload.py): `routers/upload.py`

### Data and storage

- [Domain models](https://github.com/kumarianetham-bot/identix-api/blob/api-development/models.py): `models.py`
- [Database sessions](https://github.com/kumarianetham-bot/identix-api/blob/api-development/database.py): `database.py`
- **PostgreSQL**
- **Cloudinary storage**
- [Cloudinary helpers](https://github.com/kumarianetham-bot/identix-api/blob/api-development/cloudinary_config.py): `cloudinary_config.py`

### Other components

- **Administrator**

## Connections

- Administrator → FastAPI application: calls API (evidence: `README.md`)
- FastAPI application → Admin authentication: registers routes (evidence: `main.py`)
- FastAPI application → Student management: registers routes (evidence: `main.py`)
- FastAPI application → Card generation and download: registers routes (evidence: `main.py`)
- FastAPI application → Card records: registers routes (evidence: `main.py`)
- FastAPI application → Admin management: registers routes (evidence: `main.py`)
- FastAPI application → Activity notifications: registers routes (evidence: `main.py`)
- FastAPI application → File upload endpoint: registers routes (evidence: `main.py`)
- FastAPI application → Dashboard and enrollments: registers routes (evidence: `main.py`)
- FastAPI application → Database sessions: creates tables (evidence: `main.py`)
- Admin authentication → Database sessions: opens sessions (evidence: `routers/auth.py`)
- Student management → Database sessions: opens sessions (evidence: `routers/students.py`)
- Card generation and download → Database sessions: opens sessions (evidence: `routers/idcard_generator.py`)
- Card records → Database sessions: opens sessions (evidence: `routers/idcard.py`)
- Admin management → Database sessions: opens sessions (evidence: `routers/admin.py`)
- Dashboard and enrollments → Database sessions: opens sessions (evidence: `routers/stats.py`)
- Activity notifications → Database sessions: opens sessions (evidence: `routers/notifications.py`)
- Domain models → Database sessions: uses base (evidence: `models.py`)
- Database sessions → PostgreSQL: connects (evidence: `README.md`)
- Admin authentication → Domain models: defines auth table (evidence: `routers/auth.py`)
- Student management → Domain models: reads and writes (evidence: `routers/students.py`)
- Card generation and download → Domain models: reads and writes (evidence: `routers/idcard_generator.py`)
- Card records → Domain models: reads and writes (evidence: `routers/idcard.py`)
- Admin management → Domain models: reads and writes (evidence: `routers/admin.py`)
- Dashboard and enrollments → Domain models: queries metrics (evidence: `routers/stats.py`)
- Activity notifications → Domain models: reads and writes (evidence: `routers/notifications.py`)
- Student management → Cloudinary storage: uploads photos (evidence: `README.md`)
- Card generation and download → PDF card design: generates PDF (evidence: `routers/idcard_generator.py`)
- Card generation and download → Cloudinary helpers: uploads PDF (evidence: `routers/idcard_generator.py`)
- Cloudinary helpers → Cloudinary storage: uploads files (evidence: `cloudinary_config.py`)
- File upload endpoint → Cloudinary helpers: uses helpers (evidence: `routers/upload.py`)
