# vamshikmouli/jdvsapp architecture

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

- Interactive diagram: https://gitdiagram.com/vamshikmouli/jdvsapp
- Repository: https://github.com/vamshikmouli/jdvsapp

## Overview

Jnana Deepika is a school ERP for administrators, staff, and parents. Its principal workflow is managing school records and operations through role-aware interfaces and API routes, with persistent data in PostgreSQL; parents also access attendance, fees, marks, and notices. The product includes distinct student enrollment, attendance, fee collection, assessment, staff/payroll, and communications capabilities. Relationships below are limited to README statements and shown or indexed source references; unsampled feature wiring is not inferred.

Main entry points: [`lib/db.ts`](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/db.ts) (PostgreSQL data), [`app/api/students/route.ts`](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/students/route.ts) (Student API), [`app/api/circulars/route.ts`](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/circulars/route.ts) (Notices and reminders), [`lib/services/fees.ts`](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/fees.ts) (Fee services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_admin["Admin workspace<br/>[page.tsx]"]
  node_parent["Parent portal<br/>[page.tsx]"]
  node_login["Sign-in<br/>[page.tsx]"]
  node_auth["Authentication<br/>[authOptions.ts]"]
end

subgraph group_school["School operations"]
  node_students["Student records<br/>[page.tsx]"]
  node_student_api["Student API<br/>[route.ts]"]
  node_enrollment["Enrollment<br/>[enrollment.ts]"]
  node_attendance["Attendance<br/>[page.tsx]"]
  node_attendance_api["Attendance API<br/>[route.ts]"]
  node_assessment["Marks and assessments<br/>[page.tsx]"]
  node_assessment_api["Assessment API<br/>[route.ts]"]
  node_staff_attendance["Staff attendance<br/>[service.ts]"]
end

subgraph group_finance["Fees and payroll"]
  node_fees["Fee management<br/>[account-ui.tsx]"]
  node_fees_api["Fee services<br/>[fees.ts]"]
  node_payroll["Payroll<br/>[route.ts]"]
end

subgraph group_community["Family and communication"]
  node_circulars["Notices and reminders<br/>[route.ts]"]
  node_whatsapp["WhatsApp integration<br/>[whatsapp.ts]"]
end

subgraph group_platform["Shared services"]
  node_rbac["Role permissions<br/>[roles.ts]"]
  node_database[("PostgreSQL data<br/>[db.ts]")]
end

node_actor(("School users"))

node_actor -->|"signs in"| node_login
node_login -->|"authenticates with"| node_auth
node_auth -->|"reads and writes"| node_database
node_actor -->|"uses"| node_admin
node_actor -->|"uses"| node_parent
node_students -.->|"manages records"| node_student_api
node_student_api -->|"upserts enrollment"| node_enrollment
node_student_api -->|"assigns class fees"| node_fees_api
node_student_api -->|"persists students"| node_database
node_assessment -.->|"manages assessments"| node_assessment_api
node_assessment_api -->|"accesses records"| node_database
node_fees_api -->|"reads and writes"| node_database
node_payroll -->|"reads and writes"| node_database
node_staff_attendance -->|"reads and writes"| node_database
node_circulars -->|"selects fee audience"| node_fees_api
node_circulars -.->|"notifies recipients"| node_whatsapp
node_circulars -->|"stores notices"| node_database
node_attendance -.->|"manages attendance"| node_attendance_api
node_admin -.->|"permission checks"| node_rbac

click node_admin "https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/dashboard/page.tsx"
click node_parent "https://github.com/vamshikmouli/jdvsapp/blob/master/app/parent/page.tsx"
click node_login "https://github.com/vamshikmouli/jdvsapp/blob/master/app/page.tsx"
click node_auth "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/auth/authOptions.ts"
click node_rbac "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/rbac/roles.ts"
click node_students "https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/students/page.tsx"
click node_student_api "https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/students/route.ts"
click node_enrollment "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/enrollment.ts"
click node_attendance "https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/attendance/page.tsx"
click node_attendance_api "https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/attendance/route.ts"
click node_assessment "https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/marks/page.tsx"
click node_assessment_api "https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/assessments/route.ts"
click node_fees "https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/fees/account-ui.tsx"
click node_fees_api "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/fees.ts"
click node_payroll "https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/payroll/route.ts"
click node_staff_attendance "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/staffAttendance/service.ts"
click node_circulars "https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/circulars/route.ts"
click node_whatsapp "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/whatsapp.ts"
click node_database "https://github.com/vamshikmouli/jdvsapp/blob/master/lib/db.ts"

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_admin,node_parent,node_login,node_auth,node_actor toneBlue
class node_students,node_student_api,node_enrollment,node_attendance,node_attendance_api,node_assessment,node_assessment_api,node_staff_attendance toneAmber
class node_fees,node_fees_api,node_payroll toneMint
class node_circulars,node_whatsapp toneRose
class node_rbac,node_database toneIndigo
```

## Components

### Access and shell

- [Admin workspace](https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/dashboard/page.tsx): `app/admin/dashboard/page.tsx`
- [Parent portal](https://github.com/vamshikmouli/jdvsapp/blob/master/app/parent/page.tsx): `app/parent/page.tsx`
- [Sign-in](https://github.com/vamshikmouli/jdvsapp/blob/master/app/page.tsx): `app/page.tsx`
- [Authentication](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/auth/authOptions.ts): `lib/auth/authOptions.ts`

### School operations

- [Student records](https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/students/page.tsx): `app/admin/students/page.tsx`
- [Student API](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/students/route.ts): `app/api/students/route.ts`
- [Enrollment](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/enrollment.ts): `lib/services/enrollment.ts`
- [Attendance](https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/attendance/page.tsx): `app/admin/attendance/page.tsx`
- [Attendance API](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/attendance/route.ts): `app/api/attendance/route.ts`
- [Marks and assessments](https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/marks/page.tsx): `app/admin/marks/page.tsx`
- [Assessment API](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/assessments/route.ts): `app/api/assessments/route.ts`
- [Staff attendance](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/staffAttendance/service.ts): `lib/staffAttendance/service.ts`

### Fees and payroll

- [Fee management](https://github.com/vamshikmouli/jdvsapp/blob/master/app/admin/fees/account-ui.tsx): `app/admin/fees/account-ui.tsx`
- [Fee services](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/fees.ts): `lib/services/fees.ts`
- [Payroll](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/payroll/route.ts): `app/api/payroll/route.ts`

### Family and communication

- [Notices and reminders](https://github.com/vamshikmouli/jdvsapp/blob/master/app/api/circulars/route.ts): `app/api/circulars/route.ts`
- [WhatsApp integration](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/services/whatsapp.ts): `lib/services/whatsapp.ts`

### Shared services

- [Role permissions](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/rbac/roles.ts): `lib/rbac/roles.ts`
- [PostgreSQL data](https://github.com/vamshikmouli/jdvsapp/blob/master/lib/db.ts): `lib/db.ts`

### Other components

- **School users**

## Connections

- School users → Sign-in: signs in (evidence: `README.md`)
- Sign-in → Authentication: authenticates with (evidence: `lib/auth/authOptions.ts`)
- Authentication → PostgreSQL data: reads and writes (evidence: `lib/auth/authOptions.ts`)
- School users → Admin workspace: uses (evidence: `README.md`)
- School users → Parent portal: uses (evidence: `README.md`)
- Student records → Student API: manages records
- Student API → Enrollment: upserts enrollment (evidence: `app/api/students/route.ts`)
- Student API → Fee services: assigns class fees (evidence: `app/api/students/route.ts`)
- Student API → PostgreSQL data: persists students (evidence: `app/api/students/route.ts`)
- Marks and assessments → Assessment API: manages assessments
- Assessment API → PostgreSQL data: accesses records (evidence: `app/api/assessments/route.ts`)
- Fee services → PostgreSQL data: reads and writes (evidence: `lib/services/fees.ts`)
- Payroll → PostgreSQL data: reads and writes (evidence: `app/api/payroll/route.ts`)
- Staff attendance → PostgreSQL data: reads and writes (evidence: `lib/staffAttendance/service.ts`)
- Notices and reminders → Fee services: selects fee audience (evidence: `app/api/circulars/route.ts`)
- Notices and reminders → WhatsApp integration: notifies recipients (evidence: `app/api/circulars/route.ts`)
- Notices and reminders → PostgreSQL data: stores notices (evidence: `app/api/circulars/route.ts`)
- Attendance → Attendance API: manages attendance
- Admin workspace → Role permissions: permission checks
