# bastiandev9-dotcom/lms architecture

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

- Interactive diagram: https://gitdiagram.com/bastiandev9-dotcom/lms
- Repository: https://github.com/bastiandev9-dotcom/lms

## Overview

SiManis is a school LMS for students, teachers, and administrators. Users work through role-specific Next.js pages; the frontend API client sends requests through same-origin API handlers to the Bun/Elysia backend, which exposes authentication and school-management capabilities backed by PostgreSQL. The product spans account activation and role-based access, academic administration, courses and learning progress, attendance and grading, and collaboration. The README documents these capabilities; the graph preserves them, but several route and service implementations were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`BackEnd/src/index.ts`](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/index.ts) (Elysia API server), [`BackEnd/src/db/schema.ts`](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/db/schema.ts) (LMS database), [`FrontEnd/lib/api/client.ts`](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/lib/api/client.ts) (API client), [`BackEnd/src/routes/auth-route.ts`](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/auth-route.ts) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_admin_ui["Admin workspace<br/>[page.tsx]"]
  node_teacher_ui["Teacher workspace<br/>[page.tsx]"]
  node_student_ui["Student workspace<br/>[page.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_bff["Same-origin API handlers<br/>[route.ts]"]
  node_auth_session["Session handlers<br/>[route.ts]"]
end

subgraph group_api["API and access"]
  node_api_server["Elysia API server<br/>[index.ts]"]
  node_auth_routes["Authentication routes<br/>[auth-route.ts]"]
  node_access_control["JWT and role access<br/>[auth-middleware.ts]"]
  node_auth_services["Account and identity<br/>[auth-service.ts]"]
end

subgraph group_learning["Learning and school domains"]
  node_admin_routes["Roster administration"]
  node_academic_domains["Academic administration"]
  node_course_domains["Courses and progress<br/>[modules-route.ts]"]
  node_attendance_grades["Attendance and grading"]
  node_collaboration["Chat and discussions<br/>[chat-route.ts]"]
  node_reviews_notices["Reviews and notifications"]
end

subgraph group_data["Persistence"]
  node_relational_db[("LMS database<br/>[schema.ts]")]
  node_file_db[("File storage database<br/>[storage-schema.ts]")]
end

node_admin(("Administrators"))
node_teachers(("Teachers"))
node_students(("Students"))

node_admin -.->|"uses"| node_admin_ui
node_teachers -.->|"uses"| node_teacher_ui
node_students -.->|"uses"| node_student_ui
node_admin_ui -.->|"requests data"| node_api_client
node_teacher_ui -.->|"requests data"| node_api_client
node_student_ui -.->|"requests data"| node_api_client
node_api_client -->|"calls proxy"| node_bff
node_api_client -->|"calls session API"| node_auth_session
node_bff -.->|"forwards requests"| node_api_server
node_auth_session -.->|"uses backend"| node_api_server
node_api_server -->|"registers routes"| node_auth_routes
node_api_server -->|"registers routes"| node_admin_routes
node_api_server -->|"registers routes"| node_academic_domains
node_api_server -->|"registers routes"| node_course_domains
node_api_server -->|"registers routes"| node_attendance_grades
node_api_server -->|"registers routes"| node_collaboration
node_auth_routes -->|"applies access"| node_access_control
node_admin_routes -->|"applies access"| node_access_control
node_auth_routes -->|"delegates auth"| node_auth_services
node_auth_services -->|"reads and writes"| node_relational_db
node_access_control -.->|"loads user"| node_relational_db
node_reviews_notices -->|"reads and writes"| node_relational_db
node_attendance_grades -.->|"persists records"| node_relational_db
node_course_domains -.->|"persists learning data"| node_relational_db
node_collaboration -.->|"persists conversations"| node_relational_db
node_admin_routes -.->|"manages roster"| node_relational_db
node_api_server -.->|"uses uploads"| node_file_db

click node_admin_ui "https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/admin/dashboard/page.tsx"
click node_teacher_ui "https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/teacher/dashboard/page.tsx"
click node_student_ui "https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/student/dashboard/page.tsx"
click node_api_client "https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/lib/api/client.ts"
click node_bff "https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/api/v1/%5B...path%5D/route.ts"
click node_auth_session "https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/api/auth/login/route.ts"
click node_api_server "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/index.ts"
click node_auth_routes "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/auth-route.ts"
click node_access_control "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/middleware/auth-middleware.ts"
click node_auth_services "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/services/auth-service.ts"
click node_admin_routes "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/admin-users-route.ts"
click node_academic_domains "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/academic-periods-route.ts"
click node_course_domains "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/modules-route.ts"
click node_attendance_grades "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/attendance-route.ts"
click node_collaboration "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/chat-route.ts"
click node_reviews_notices "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/services/reviews-notifications-services.ts"
click node_relational_db "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/db/schema.ts"
click node_file_db "https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/db/storage-schema.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_ui,node_teacher_ui,node_student_ui,node_api_client,node_bff,node_auth_session toneBlue
class node_api_server,node_auth_routes,node_access_control,node_auth_services toneAmber
class node_admin_routes,node_academic_domains,node_course_domains,node_attendance_grades,node_collaboration,node_reviews_notices toneMint
class node_relational_db,node_file_db toneRose
class node_admin,node_teachers,node_students toneIndigo
```

## Components

### Web application

- [Admin workspace](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/admin/dashboard/page.tsx): `FrontEnd/app/admin/dashboard/page.tsx`
- [Teacher workspace](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/teacher/dashboard/page.tsx): `FrontEnd/app/teacher/dashboard/page.tsx`
- [Student workspace](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/student/dashboard/page.tsx): `FrontEnd/app/student/dashboard/page.tsx`
- [API client](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/lib/api/client.ts): `FrontEnd/lib/api/client.ts`
- [Same-origin API handlers](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/api/v1/%5B...path%5D/route.ts): `FrontEnd/app/api/v1/[...path]/route.ts`
- [Session handlers](https://github.com/bastiandev9-dotcom/lms/blob/main/FrontEnd/app/api/auth/login/route.ts): `FrontEnd/app/api/auth/login/route.ts`

### API and access

- [Elysia API server](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/index.ts): `BackEnd/src/index.ts`
- [Authentication routes](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/auth-route.ts): `BackEnd/src/routes/auth-route.ts`
- [JWT and role access](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/middleware/auth-middleware.ts): `BackEnd/src/middleware/auth-middleware.ts`
- [Account and identity](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/services/auth-service.ts): `BackEnd/src/services/auth-service.ts`

### Learning and school domains

- [Roster administration](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/admin-users-route.ts): `BackEnd/src/routes/admin-users-route.ts`
- [Academic administration](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/academic-periods-route.ts): `BackEnd/src/routes/academic-periods-route.ts`
- [Courses and progress](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/modules-route.ts): `BackEnd/src/routes/modules-route.ts`
- [Attendance and grading](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/attendance-route.ts): `BackEnd/src/routes/attendance-route.ts`
- [Chat and discussions](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/routes/chat-route.ts): `BackEnd/src/routes/chat-route.ts`
- [Reviews and notifications](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/services/reviews-notifications-services.ts): `BackEnd/src/services/reviews-notifications-services.ts`

### Persistence

- [LMS database](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/db/schema.ts): `BackEnd/src/db/schema.ts`
- [File storage database](https://github.com/bastiandev9-dotcom/lms/blob/main/BackEnd/src/db/storage-schema.ts): `BackEnd/src/db/storage-schema.ts`

### Other components

- **Administrators**
- **Teachers**
- **Students**

## Connections

- Administrators → Admin workspace: uses (evidence: `README.md`)
- Teachers → Teacher workspace: uses (evidence: `README.md`)
- Students → Student workspace: uses (evidence: `README.md`)
- Admin workspace → API client: requests data
- Teacher workspace → API client: requests data
- Student workspace → API client: requests data
- API client → Same-origin API handlers: calls proxy (evidence: `FrontEnd/lib/api/client.ts`)
- API client → Session handlers: calls session API (evidence: `FrontEnd/lib/api/client.ts`)
- Same-origin API handlers → Elysia API server: forwards requests (evidence: `README.md`)
- Session handlers → Elysia API server: uses backend (evidence: `README.md`)
- Elysia API server → Authentication routes: registers routes (evidence: `BackEnd/src/index.ts`)
- Elysia API server → Roster administration: registers routes (evidence: `BackEnd/src/index.ts`)
- Elysia API server → Academic administration: registers routes (evidence: `BackEnd/src/index.ts`)
- Elysia API server → Courses and progress: registers routes (evidence: `BackEnd/src/index.ts`)
- Elysia API server → Attendance and grading: registers routes (evidence: `BackEnd/src/index.ts`)
- Elysia API server → Chat and discussions: registers routes (evidence: `BackEnd/src/index.ts`)
- Authentication routes → JWT and role access: applies access (evidence: `BackEnd/src/routes/auth-route.ts`)
- Roster administration → JWT and role access: applies access (evidence: `BackEnd/src/routes/admin-users-route.ts`)
- Authentication routes → Account and identity: delegates auth (evidence: `BackEnd/src/routes/auth-route.ts`)
- Account and identity → LMS database: reads and writes (evidence: `BackEnd/src/services/auth-service.ts`)
- JWT and role access → LMS database: loads user
- Reviews and notifications → LMS database: reads and writes (evidence: `BackEnd/src/services/reviews-notifications-services.ts`)
- Attendance and grading → LMS database: persists records
- Courses and progress → LMS database: persists learning data
- Chat and discussions → LMS database: persists conversations
- Roster administration → LMS database: manages roster
- Elysia API server → File storage database: uses uploads
