# rajbhokare/sih---project architecture

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

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

## Overview

EduPadhai is a gamified learning platform for students in Classes 6–12. Students sign up or log in, choose a class and subject, complete lesson notes, quizzes, or games, earn XP, and review their progress on a dashboard. The Express app serves EJS pages and mounts authentication and content APIs; those route handlers query MySQL for users, curriculum, and progress. The README documents the learning and gamification capabilities, while frontend implementation details and client-side API calls were not sampled, so those links are shown only where documented.

Main entry points: [`app.js`](https://github.com/rajbhokare/sih---project/blob/main/app.js) (Express app), [`BACKEND/routes/content.js`](https://github.com/rajbhokare/sih---project/blob/main/BACKEND/routes/content.js) (Curriculum API), [`BACKEND/config/db.js`](https://github.com/rajbhokare/sih---project/blob/main/BACKEND/config/db.js) (MySQL pool), [`FRONTEND/learn.ejs`](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/learn.ejs) (Class and subject selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_server["Express app<br/>[app.js]"]
  node_shared["Shared layout<br/>[header.ejs]"]
  node_landing["Landing page<br/>[index.ejs]"]
  node_info["Info pages<br/>[about.ejs]"]
end

subgraph group_learning["Learning experience"]
  node_learner["Class and subject selector<br/>[learn.ejs]"]
  node_content_api["Curriculum API<br/>[content.js]"]
  node_activity["Activity viewer<br/>[activity.ejs]"]
  node_dashboard["Progress dashboard<br/>[dashboard.ejs]"]
end

subgraph group_identity["Accounts and progress"]
  node_account_pages["Login and signup<br/>[login.ejs]"]
  node_auth["Authentication API<br/>[auth.js]"]
end

subgraph group_data["Persistence"]
  node_db_pool["MySQL pool<br/>[db.js]"]
  node_mysql[("MySQL database")]
end

node_student(("Student"))

node_student -->|"visits"| node_server
node_server -->|"renders"| node_landing
node_server -->|"renders"| node_account_pages
node_server -->|"renders"| node_learner
node_server -->|"renders"| node_dashboard
node_server -->|"renders"| node_info
node_server -->|"renders"| node_activity
node_server -->|"mounts"| node_auth
node_server -->|"mounts"| node_content_api
node_server -->|"queries"| node_db_pool
node_auth -->|"queries"| node_db_pool
node_content_api -->|"queries"| node_db_pool
node_db_pool -->|"connects"| node_mysql
node_student -->|"signs in"| node_account_pages
node_student -->|"selects course"| node_learner
node_learner -.->|"requests chapters"| node_content_api
node_student -->|"completes activities"| node_activity
node_activity -.->|"updates progress"| node_content_api
node_student -->|"reviews progress"| node_dashboard
node_shared -.->|"included by"| node_landing

click node_server "https://github.com/rajbhokare/sih---project/blob/main/app.js"
click node_shared "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/header.ejs"
click node_landing "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/index.ejs"
click node_info "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/about.ejs"
click node_account_pages "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/login.ejs"
click node_auth "https://github.com/rajbhokare/sih---project/blob/main/BACKEND/routes/auth.js"
click node_learner "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/learn.ejs"
click node_content_api "https://github.com/rajbhokare/sih---project/blob/main/BACKEND/routes/content.js"
click node_activity "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/activity.ejs"
click node_dashboard "https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/dashboard.ejs"
click node_db_pool "https://github.com/rajbhokare/sih---project/blob/main/BACKEND/config/db.js"

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_server,node_shared,node_landing,node_info toneBlue
class node_learner,node_content_api,node_activity,node_dashboard toneAmber
class node_account_pages,node_auth toneMint
class node_db_pool,node_mysql toneRose
class node_student toneIndigo
```

## Components

### Web application

- [Express app](https://github.com/rajbhokare/sih---project/blob/main/app.js): `app.js`
- [Shared layout](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/header.ejs): `FRONTEND/header.ejs`
- [Landing page](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/index.ejs): `FRONTEND/index.ejs`
- [Info pages](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/about.ejs): `FRONTEND/about.ejs`

### Learning experience

- [Class and subject selector](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/learn.ejs): `FRONTEND/learn.ejs`
- [Curriculum API](https://github.com/rajbhokare/sih---project/blob/main/BACKEND/routes/content.js): `BACKEND/routes/content.js`
- [Activity viewer](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/activity.ejs): `FRONTEND/activity.ejs`
- [Progress dashboard](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/dashboard.ejs): `FRONTEND/dashboard.ejs`

### Accounts and progress

- [Login and signup](https://github.com/rajbhokare/sih---project/blob/main/FRONTEND/login.ejs): `FRONTEND/login.ejs`
- [Authentication API](https://github.com/rajbhokare/sih---project/blob/main/BACKEND/routes/auth.js): `BACKEND/routes/auth.js`

### Persistence

- [MySQL pool](https://github.com/rajbhokare/sih---project/blob/main/BACKEND/config/db.js): `BACKEND/config/db.js`
- **MySQL database**

### Other components

- **Student**

## Connections

- Student → Express app: visits (evidence: `README.md`)
- Express app → Landing page: renders (evidence: `app.js`)
- Express app → Login and signup: renders (evidence: `app.js`)
- Express app → Class and subject selector: renders (evidence: `app.js`)
- Express app → Progress dashboard: renders (evidence: `app.js`)
- Express app → Info pages: renders (evidence: `app.js`)
- Express app → Activity viewer: renders (evidence: `app.js`)
- Express app → Authentication API: mounts (evidence: `app.js`)
- Express app → Curriculum API: mounts (evidence: `app.js`)
- Express app → MySQL pool: queries (evidence: `app.js`)
- Authentication API → MySQL pool: queries (evidence: `BACKEND/routes/auth.js`)
- Curriculum API → MySQL pool: queries (evidence: `BACKEND/routes/content.js`)
- MySQL pool → MySQL database: connects (evidence: `BACKEND/config/db.js`)
- Student → Login and signup: signs in (evidence: `README.md`)
- Student → Class and subject selector: selects course (evidence: `README.md`)
- Class and subject selector → Curriculum API: requests chapters (evidence: `README.md`)
- Student → Activity viewer: completes activities (evidence: `README.md`)
- Activity viewer → Curriculum API: updates progress (evidence: `README.md`)
- Student → Progress dashboard: reviews progress (evidence: `README.md`)
- Shared layout → Landing page: included by (evidence: `README.md`)
