# shirodkarfalashree/favproct architecture

> Architecture diagram of the GitHub repository shirodkarfalashree/favproct, 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/shirodkarfalashree/favproct
- Repository: https://github.com/shirodkarfalashree/favproct

## Overview

FAVPROCT is a multi-organization assessment platform. Users enter through the role-aware web app: administrators manage question banks, create exams, and allot them; students take allotted exams; teachers evaluate submissions and review results. The backend exposes API routes for these operations and persists organization, user, exam, cohort, and attempt data. The graph preserves the major role-specific product areas visible in the file tree; some page-to-API relationships are shown as unverified because the excerpts do not expose those calls.

Main entry points: [`Backend/src/app.js`](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/app.js) (API application), [`Frontend/src/App.jsx`](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/App.jsx) (Role-based routing), [`Frontend/src/services/api.js`](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/services/api.js) (API client), [`Backend/src/controllers/admin.controller.js`](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/admin.controller.js) (Admin management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Role-based routing<br/>[App.jsx]"]
  node_authstate["Session state<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_landing["Landing and signup<br/>[LandingPage.jsx]"]
  node_adminui["Admin workspace<br/>[ExamCreation.jsx]"]
  node_questionui["Question bank UI<br/>[QuestionBank.jsx]"]
  node_studentui["Student exam portal<br/>[ExamPortal.jsx]"]
  node_teacherui["Teacher evaluation<br/>[EvaluateExam.jsx]"]
  node_superui["Superadmin workspace"]
end

subgraph group_assess["Assessment workflows"]
  node_server["API application<br/>[app.js]"]
  node_examflow["Exam generation and allotment"]
  node_attemptflow["Student attempt and grading"]
  node_adminflow["Admin management"]
  node_questionflow["Question bank management"]
  node_cohortflow["Cohort management"]
end

subgraph group_org["Organization and access"]
  node_authflow["Authentication<br/>[auth.controller.js]"]
  node_orgflow["Organization provisioning"]
end

subgraph group_data["Persistence and integrations"]
  node_users[("User records<br/>[User.js]")]
  node_exams[("Generated exams<br/>[GeneratedExam.js]")]
  node_attempts[("Student exam records<br/>[StudentExam.js]")]
  node_cohorts[("Cohort records<br/>[Cohort.js]")]
  node_organizations[("Organization records<br/>[Organization.js]")]
  node_questionbanks[("Question bank records<br/>[Questionbank.js]")]
  node_email["Email delivery<br/>[emailService.js]"]
end

node_visitors(("Users"))
node_http{{"HTTP API"}}
node_mongo[("MongoDB")]
node_smtp{{"SMTP service"}}

node_visitors -->|"open app"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_studentui
node_app -->|"routes to"| node_teacherui
node_app -->|"routes to"| node_superui
node_app -->|"provides session"| node_authstate
node_landing -->|"uses session"| node_authstate
node_authstate -->|"sends auth requests"| node_api
node_adminui -->|"calls API"| node_api
node_questionui -->|"calls API"| node_api
node_studentui -->|"calls API"| node_api
node_teacherui -->|"calls API"| node_api
node_superui -->|"calls API"| node_api
node_api -.->|"sends requests"| node_http
node_http -.->|"routes requests"| node_server
node_server -->|"mounts routes"| node_authflow
node_server -->|"mounts routes"| node_orgflow
node_server -->|"mounts routes"| node_questionflow
node_server -->|"mounts routes"| node_examflow
node_server -->|"mounts routes"| node_cohortflow
node_server -->|"mounts routes"| node_adminflow
node_server -->|"mounts routes"| node_attemptflow
node_authflow -->|"reads and writes"| node_users
node_authflow -->|"reads organization"| node_organizations
node_orgflow -->|"creates organization"| node_organizations
node_orgflow -->|"provisions admin"| node_users
node_orgflow -->|"sends invitation"| node_email
node_examflow -->|"creates and reads"| node_exams
node_examflow -->|"assigns users"| node_users
node_examflow -->|"creates allotments"| node_attempts
node_examflow -->|"notifies assignees"| node_email
node_attemptflow -->|"updates attempts"| node_attempts
node_attemptflow -->|"loads exam"| node_exams
node_attemptflow -->|"loads student"| node_users
node_adminflow -->|"manages users"| node_users
node_adminflow -->|"reads attempts"| node_attempts
node_adminflow -->|"counts cohorts"| node_cohorts
node_adminflow -->|"reads exams"| node_exams
node_adminflow -->|"sends notices"| node_email
node_questionflow -.->|"manages bank data"| node_questionbanks
node_cohortflow -->|"manages cohorts"| node_cohorts
node_email -->|"sends mail"| node_smtp
node_mongo -.->|"stores records"| node_users
node_mongo -.->|"stores records"| node_exams
node_mongo -.->|"stores records"| node_attempts

click node_app "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/App.jsx"
click node_authstate "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/context/AuthContext.jsx"
click node_api "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/services/api.js"
click node_landing "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/LandingPage.jsx"
click node_adminui "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/admin/ExamCreation.jsx"
click node_questionui "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/admin/QuestionBank.jsx"
click node_studentui "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/student/ExamPortal.jsx"
click node_teacherui "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/teacher/EvaluateExam.jsx"
click node_superui "https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/superadmin/SuperAdminDashboard.jsx"
click node_server "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/app.js"
click node_examflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/generateExam.controller.js"
click node_attemptflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/studentExam.controller.js"
click node_adminflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/admin.controller.js"
click node_questionflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/questionBank.controller.js"
click node_cohortflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/cohort.controller.js"
click node_authflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/auth.controller.js"
click node_orgflow "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/routes/organization.routes.js"
click node_users "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/User.js"
click node_exams "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/GeneratedExam.js"
click node_attempts "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/StudentExam.js"
click node_cohorts "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/Cohort.js"
click node_organizations "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/Organization.js"
click node_questionbanks "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/Questionbank.js"
click node_email "https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/utils/emailService.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_app,node_authstate,node_api,node_landing,node_adminui,node_questionui,node_studentui,node_teacherui,node_superui,node_visitors toneBlue
class node_server,node_examflow,node_attemptflow,node_adminflow,node_questionflow,node_cohortflow,node_mongo toneAmber
class node_authflow,node_orgflow,node_http toneMint
class node_users,node_exams,node_attempts,node_cohorts,node_organizations,node_questionbanks,node_email toneRose
class node_smtp toneIndigo
```

## Components

### Web application

- [Role-based routing](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Session state](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/context/AuthContext.jsx): `Frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/services/api.js): `Frontend/src/services/api.js`
- [Landing and signup](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/LandingPage.jsx): `Frontend/src/pages/LandingPage.jsx`
- [Admin workspace](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/admin/ExamCreation.jsx): `Frontend/src/pages/admin/ExamCreation.jsx`
- [Question bank UI](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/admin/QuestionBank.jsx): `Frontend/src/pages/admin/QuestionBank.jsx`
- [Student exam portal](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/student/ExamPortal.jsx): `Frontend/src/pages/student/ExamPortal.jsx`
- [Teacher evaluation](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/teacher/EvaluateExam.jsx): `Frontend/src/pages/teacher/EvaluateExam.jsx`
- [Superadmin workspace](https://github.com/shirodkarfalashree/favproct/blob/main/Frontend/src/pages/superadmin/SuperAdminDashboard.jsx): `Frontend/src/pages/superadmin/SuperAdminDashboard.jsx`

### Assessment workflows

- [API application](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/app.js): `Backend/src/app.js`
- [Exam generation and allotment](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/generateExam.controller.js): `Backend/src/controllers/generateExam.controller.js`
- [Student attempt and grading](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/studentExam.controller.js): `Backend/src/controllers/studentExam.controller.js`
- [Admin management](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/admin.controller.js): `Backend/src/controllers/admin.controller.js`
- [Question bank management](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/questionBank.controller.js): `Backend/src/controllers/questionBank.controller.js`
- [Cohort management](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/cohort.controller.js): `Backend/src/controllers/cohort.controller.js`

### Organization and access

- [Authentication](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/controllers/auth.controller.js): `Backend/src/controllers/auth.controller.js`
- [Organization provisioning](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/routes/organization.routes.js): `Backend/src/routes/organization.routes.js`

### Persistence and integrations

- [User records](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/User.js): `Backend/src/models/User.js`
- [Generated exams](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/GeneratedExam.js): `Backend/src/models/GeneratedExam.js`
- [Student exam records](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/StudentExam.js): `Backend/src/models/StudentExam.js`
- [Cohort records](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/Cohort.js): `Backend/src/models/Cohort.js`
- [Organization records](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/Organization.js): `Backend/src/models/Organization.js`
- [Question bank records](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/models/Questionbank.js): `Backend/src/models/Questionbank.js`
- [Email delivery](https://github.com/shirodkarfalashree/favproct/blob/main/Backend/src/utils/emailService.js): `Backend/src/utils/emailService.js`

### Other components

- **Users**
- **HTTP API**
- **MongoDB**
- **SMTP service**

## Connections

- Users → Role-based routing: open app (evidence: `Frontend/src/App.jsx`)
- Role-based routing → Landing and signup: routes to (evidence: `Frontend/src/App.jsx`)
- Role-based routing → Admin workspace: routes to (evidence: `Frontend/src/App.jsx`)
- Role-based routing → Student exam portal: routes to (evidence: `Frontend/src/App.jsx`)
- Role-based routing → Teacher evaluation: routes to (evidence: `Frontend/src/App.jsx`)
- Role-based routing → Superadmin workspace: routes to (evidence: `Frontend/src/App.jsx`)
- Role-based routing → Session state: provides session (evidence: `Frontend/src/App.jsx`)
- Landing and signup → Session state: uses session (evidence: `Frontend/src/pages/LandingPage.jsx`)
- Session state → API client: sends auth requests (evidence: `Frontend/src/context/AuthContext.jsx`)
- Admin workspace → API client: calls API (evidence: `Frontend/src/pages/admin/ExamCreation.jsx`)
- Question bank UI → API client: calls API (evidence: `Frontend/src/pages/admin/QuestionBank.jsx`)
- Student exam portal → API client: calls API (evidence: `Frontend/src/pages/student/ExamPortal.jsx`)
- Teacher evaluation → API client: calls API (evidence: `Frontend/src/pages/teacher/EvaluateExam.jsx`)
- Superadmin workspace → API client: calls API (evidence: `Frontend/src/pages/superadmin/SuperAdminDashboard.jsx`)
- API client → HTTP API: sends requests
- HTTP API → API application: routes requests
- API application → Authentication: mounts routes (evidence: `Backend/src/app.js`)
- API application → Organization provisioning: mounts routes (evidence: `Backend/src/app.js`)
- API application → Question bank management: mounts routes (evidence: `Backend/src/app.js`)
- API application → Exam generation and allotment: mounts routes (evidence: `Backend/src/app.js`)
- API application → Cohort management: mounts routes (evidence: `Backend/src/app.js`)
- API application → Admin management: mounts routes (evidence: `Backend/src/app.js`)
- API application → Student attempt and grading: mounts routes (evidence: `Backend/src/app.js`)
- Authentication → User records: reads and writes (evidence: `Backend/src/controllers/auth.controller.js`)
- Authentication → Organization records: reads organization (evidence: `Backend/src/controllers/auth.controller.js`)
- Organization provisioning → Organization records: creates organization (evidence: `Backend/src/routes/organization.routes.js`)
- Organization provisioning → User records: provisions admin (evidence: `Backend/src/routes/organization.routes.js`)
- Organization provisioning → Email delivery: sends invitation (evidence: `Backend/src/routes/organization.routes.js`)
- Exam generation and allotment → Generated exams: creates and reads (evidence: `Backend/src/controllers/generateExam.controller.js`)
- Exam generation and allotment → User records: assigns users (evidence: `Backend/src/controllers/generateExam.controller.js`)
- Exam generation and allotment → Student exam records: creates allotments (evidence: `Backend/src/controllers/generateExam.controller.js`)
- Exam generation and allotment → Email delivery: notifies assignees (evidence: `Backend/src/controllers/generateExam.controller.js`)
- Student attempt and grading → Student exam records: updates attempts (evidence: `Backend/src/controllers/studentExam.controller.js`)
- Student attempt and grading → Generated exams: loads exam (evidence: `Backend/src/controllers/studentExam.controller.js`)
- Student attempt and grading → User records: loads student (evidence: `Backend/src/controllers/studentExam.controller.js`)
- Admin management → User records: manages users (evidence: `Backend/src/controllers/admin.controller.js`)
- Admin management → Student exam records: reads attempts (evidence: `Backend/src/controllers/admin.controller.js`)
- Admin management → Cohort records: counts cohorts (evidence: `Backend/src/controllers/admin.controller.js`)
- Admin management → Generated exams: reads exams (evidence: `Backend/src/controllers/admin.controller.js`)
- Admin management → Email delivery: sends notices (evidence: `Backend/src/controllers/admin.controller.js`)
- Question bank management → Question bank records: manages bank data
- Cohort management → Cohort records: manages cohorts (evidence: `Backend/src/controllers/cohort.controller.js`)
- Email delivery → SMTP service: sends mail (evidence: `Backend/src/utils/emailService.js`)
- MongoDB → User records: stores records
- MongoDB → Generated exams: stores records
- MongoDB → Student exam records: stores records
