# lakshay3605/kaushalai architecture

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

- Interactive diagram: https://gitdiagram.com/lakshay3605/kaushalai
- Repository: https://github.com/lakshay3605/kaushalai

## Overview

SAHAKAR-SETU is a cooperative training, attendance, credentialing, and employment platform. Its principal journey runs from trainee-facing portals through training and assessments, attendance capture, certificates, and PACS job matching; institute administration and AI guidance are supporting capabilities. The frontend routes users and makes API requests; FastAPI routes own domain operations, backed by shared models and persistence. The README documents additional hardware, offline, and external-service capabilities not fully verifiable in sampled implementation, so those links are identified as documented rather than inferred from unseen code.

Main entry points: [`backend/main.py`](https://github.com/lakshay3605/kaushalai/blob/main/backend/main.py) (FastAPI application), [`frontend/src/App.jsx`](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/App.jsx) (Portal router), [`backend/database.py`](https://github.com/lakshay3605/kaushalai/blob/main/backend/database.py) (Relational database), [`backend/routers/attendance_routes.py`](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/attendance_routes.py) (Attendance processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_app["Portal router<br/>[App.jsx]"]
  node_context["Session and UI state<br/>[AppContext.jsx]"]
  node_api["API and offline queue<br/>[api.js]"]
  node_lms_ui["Learning portal<br/>[LmsMyLearning.jsx]"]
  node_assessment_ui["Assessments"]
  node_certificate_ui["Certificates and verification"]
  node_kiosk_ui["Kiosk operations"]
  node_recruiter_ui["Recruiter portal"]
  node_admin_ui["Institute administration"]
end

subgraph group_platform["API foundation"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_auth["Authentication and roles<br/>[auth.py]"]
  node_models["Domain data models<br/>[models.py]"]
  node_db[("Relational database<br/>[database.py]")]
end

subgraph group_learning["Training and attendance"]
  node_erp["Training ERP<br/>[erp_routes.py]"]
  node_lms["Courses and quizzes<br/>[lms_routes.py]"]
  node_attendance["Attendance processing"]
  node_hardware["Kiosk hardware support<br/>[hardware.py]"]
end

subgraph group_outcomes["Credentials and careers"]
  node_certificates["Credential issuance"]
  node_crypto["Ed25519 signing<br/>[crypto.py]"]
  node_jobs["Job exchange<br/>[job_routes.py]"]
  node_matcher["Candidate matching<br/>[matcher.py]"]
end

subgraph group_insight["Guidance and oversight"]
  node_ai["AI guidance and recommendations<br/>[ai_routes.py]"]
  node_rag["Grounded RAG pipeline<br/>[rag.py]"]
  node_analytics["Analytics"]
end

node_users(("Trainees and staff"))
node_national_services["DigiLocker and national services"]

node_users -->|"use portals"| node_app
node_app -->|"provides state"| node_context
node_app -->|"routes learning"| node_lms_ui
node_app -->|"routes exams"| node_assessment_ui
node_app -->|"routes credentials"| node_certificate_ui
node_app -->|"routes kiosk"| node_kiosk_ui
node_app -->|"routes recruiting"| node_recruiter_ui
node_app -->|"routes administration"| node_admin_ui
node_context -->|"calls API"| node_api
node_kiosk_ui -->|"uses requests"| node_api
node_api -->|"syncs events"| node_attendance
node_backend -->|"registers routes"| node_auth
node_backend -->|"registers routes"| node_erp
node_backend -->|"registers routes"| node_lms
node_backend -->|"registers routes"| node_attendance
node_backend -->|"registers routes"| node_certificates
node_backend -->|"registers routes"| node_jobs
node_backend -->|"registers routes"| node_ai
node_backend -->|"registers routes"| node_analytics
node_backend -->|"initializes schema"| node_db
node_lms -->|"queries records"| node_db
node_attendance -->|"stores events"| node_db
node_jobs -->|"queries records"| node_db
node_ai -->|"calls pipeline"| node_rag
node_ai -->|"uses ranking"| node_matcher
node_jobs -->|"scores candidates"| node_matcher
node_certificates -->|"signs credentials"| node_crypto
node_lms -->|"creates credentials"| node_crypto
node_erp -->|"queries records"| node_db
node_analytics -->|"queries records"| node_db
node_attendance -->|"verifies events"| node_hardware
node_certificates -.->|"pushes credentials"| node_national_services
node_users -.->|"check in offline"| node_hardware

click node_app "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/App.jsx"
click node_context "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/context/AppContext.jsx"
click node_api "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/api.js"
click node_lms_ui "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/LmsMyLearning.jsx"
click node_assessment_ui "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/AssessmentsPage.jsx"
click node_certificate_ui "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/CertificatesPage.jsx"
click node_kiosk_ui "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/KioskOperatorPortalPage.jsx"
click node_recruiter_ui "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/RecruiterPortalPage.jsx"
click node_admin_ui "https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/AdminDashboardPage.jsx"
click node_backend "https://github.com/lakshay3605/kaushalai/blob/main/backend/main.py"
click node_auth "https://github.com/lakshay3605/kaushalai/blob/main/backend/auth.py"
click node_models "https://github.com/lakshay3605/kaushalai/blob/main/backend/models.py"
click node_db "https://github.com/lakshay3605/kaushalai/blob/main/backend/database.py"
click node_erp "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/erp_routes.py"
click node_lms "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/lms_routes.py"
click node_attendance "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/attendance_routes.py"
click node_hardware "https://github.com/lakshay3605/kaushalai/blob/main/backend/hardware.py"
click node_certificates "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/certificate_routes.py"
click node_crypto "https://github.com/lakshay3605/kaushalai/blob/main/backend/crypto.py"
click node_jobs "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/job_routes.py"
click node_matcher "https://github.com/lakshay3605/kaushalai/blob/main/backend/matcher.py"
click node_ai "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/ai_routes.py"
click node_rag "https://github.com/lakshay3605/kaushalai/blob/main/backend/rag.py"
click node_analytics "https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/analytics_routes.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,node_context,node_api,node_lms_ui,node_assessment_ui,node_certificate_ui,node_kiosk_ui,node_recruiter_ui,node_admin_ui toneBlue
class node_backend,node_auth,node_models,node_db toneAmber
class node_erp,node_lms,node_attendance,node_hardware toneMint
class node_certificates,node_crypto,node_jobs,node_matcher toneRose
class node_ai,node_rag,node_analytics,node_users,node_national_services toneIndigo
```

## Components

### Web experience

- [Portal router](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session and UI state](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [API and offline queue](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Learning portal](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/LmsMyLearning.jsx): `frontend/src/pages/LmsMyLearning.jsx`
- [Assessments](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/AssessmentsPage.jsx): `frontend/src/pages/AssessmentsPage.jsx`
- [Certificates and verification](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/CertificatesPage.jsx): `frontend/src/pages/CertificatesPage.jsx`
- [Kiosk operations](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/KioskOperatorPortalPage.jsx): `frontend/src/pages/KioskOperatorPortalPage.jsx`
- [Recruiter portal](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/RecruiterPortalPage.jsx): `frontend/src/pages/RecruiterPortalPage.jsx`
- [Institute administration](https://github.com/lakshay3605/kaushalai/blob/main/frontend/src/pages/AdminDashboardPage.jsx): `frontend/src/pages/AdminDashboardPage.jsx`

### API foundation

- [FastAPI application](https://github.com/lakshay3605/kaushalai/blob/main/backend/main.py): `backend/main.py`
- [Authentication and roles](https://github.com/lakshay3605/kaushalai/blob/main/backend/auth.py): `backend/auth.py`
- [Domain data models](https://github.com/lakshay3605/kaushalai/blob/main/backend/models.py): `backend/models.py`
- [Relational database](https://github.com/lakshay3605/kaushalai/blob/main/backend/database.py): `backend/database.py`

### Training and attendance

- [Training ERP](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/erp_routes.py): `backend/routers/erp_routes.py`
- [Courses and quizzes](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/lms_routes.py): `backend/routers/lms_routes.py`
- [Attendance processing](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/attendance_routes.py): `backend/routers/attendance_routes.py`
- [Kiosk hardware support](https://github.com/lakshay3605/kaushalai/blob/main/backend/hardware.py): `backend/hardware.py`

### Credentials and careers

- [Credential issuance](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/certificate_routes.py): `backend/routers/certificate_routes.py`
- [Ed25519 signing](https://github.com/lakshay3605/kaushalai/blob/main/backend/crypto.py): `backend/crypto.py`
- [Job exchange](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/job_routes.py): `backend/routers/job_routes.py`
- [Candidate matching](https://github.com/lakshay3605/kaushalai/blob/main/backend/matcher.py): `backend/matcher.py`

### Guidance and oversight

- [AI guidance and recommendations](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/ai_routes.py): `backend/routers/ai_routes.py`
- [Grounded RAG pipeline](https://github.com/lakshay3605/kaushalai/blob/main/backend/rag.py): `backend/rag.py`
- [Analytics](https://github.com/lakshay3605/kaushalai/blob/main/backend/routers/analytics_routes.py): `backend/routers/analytics_routes.py`

### Other components

- **Trainees and staff**
- **DigiLocker and national services**

## Connections

- Trainees and staff → Portal router: use portals (evidence: `README.md`)
- Portal router → Session and UI state: provides state (evidence: `frontend/src/App.jsx`)
- Portal router → Learning portal: routes learning (evidence: `frontend/src/App.jsx`)
- Portal router → Assessments: routes exams (evidence: `frontend/src/App.jsx`)
- Portal router → Certificates and verification: routes credentials (evidence: `frontend/src/App.jsx`)
- Portal router → Kiosk operations: routes kiosk (evidence: `frontend/src/App.jsx`)
- Portal router → Recruiter portal: routes recruiting (evidence: `frontend/src/App.jsx`)
- Portal router → Institute administration: routes administration (evidence: `frontend/src/App.jsx`)
- Session and UI state → API and offline queue: calls API (evidence: `frontend/src/context/AppContext.jsx`)
- Kiosk operations → API and offline queue: uses requests (evidence: `frontend/src/pages/KioskOperatorPortalPage.jsx`)
- API and offline queue → Attendance processing: syncs events (evidence: `frontend/src/api.js`)
- FastAPI application → Authentication and roles: registers routes (evidence: `backend/main.py`)
- FastAPI application → Training ERP: registers routes (evidence: `backend/main.py`)
- FastAPI application → Courses and quizzes: registers routes (evidence: `backend/main.py`)
- FastAPI application → Attendance processing: registers routes (evidence: `backend/main.py`)
- FastAPI application → Credential issuance: registers routes (evidence: `backend/main.py`)
- FastAPI application → Job exchange: registers routes (evidence: `backend/main.py`)
- FastAPI application → AI guidance and recommendations: registers routes (evidence: `backend/main.py`)
- FastAPI application → Analytics: registers routes (evidence: `backend/main.py`)
- FastAPI application → Relational database: initializes schema (evidence: `backend/main.py`)
- Courses and quizzes → Relational database: queries records (evidence: `backend/routers/lms_routes.py`)
- Attendance processing → Relational database: stores events (evidence: `backend/routers/attendance_routes.py`)
- Job exchange → Relational database: queries records (evidence: `backend/routers/job_routes.py`)
- AI guidance and recommendations → Grounded RAG pipeline: calls pipeline (evidence: `backend/routers/ai_routes.py`)
- AI guidance and recommendations → Candidate matching: uses ranking (evidence: `backend/routers/ai_routes.py`)
- Job exchange → Candidate matching: scores candidates (evidence: `backend/routers/job_routes.py`)
- Credential issuance → Ed25519 signing: signs credentials (evidence: `backend/routers/certificate_routes.py`)
- Courses and quizzes → Ed25519 signing: creates credentials (evidence: `backend/routers/lms_routes.py`)
- Training ERP → Relational database: queries records (evidence: `backend/routers/erp_routes.py`)
- Analytics → Relational database: queries records (evidence: `backend/routers/analytics_routes.py`)
- Attendance processing → Kiosk hardware support: verifies events (evidence: `backend/routers/attendance_routes.py`)
- Credential issuance → DigiLocker and national services: pushes credentials (evidence: `README.md`)
- Trainees and staff → Kiosk hardware support: check in offline (evidence: `README.md`)
