# raghava-183/vfstr-course-dashboard architecture

> Architecture diagram of the GitHub repository raghava-183/vfstr-course-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raghava-183/vfstr-course-dashboard
- Repository: https://github.com/raghava-183/vfstr-course-dashboard

## Overview

This is a Next.js course dashboard for faculty-managed teaching videos and student learning materials. Students register or sign in, browse subjects and units, watch recordings, review topics and activities, and track videos watched. Faculty manage video links, topic lists, and student accounts. The graph includes the documented seeded syllabus and Postgres persistence; unsampled implementation details are represented only where the README or source index supports them.

Main entry points: [`lib/db.ts`](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/db.ts) (Course and user queries), [`app/actions/auth.ts`](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/auth.ts) (Auth actions), [`components/UnitVideos.tsx`](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/components/UnitVideos.tsx) (Video player and topics), [`app/(app)/admin/page.tsx`](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/admin/page.tsx) (Admin console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_login["Login form<br/>[LoginForm.tsx]"]
  node_register["Registration form<br/>[RegisterForm.tsx]"]
  node_authactions["Auth actions<br/>[auth.ts]"]
  node_session["Session service<br/>[auth.ts]"]
end

subgraph group_learning["Course learning"]
  node_dashboard["Subject dashboard<br/>[page.tsx]"]
  node_subject["Subject units<br/>[page.tsx]"]
  node_unit["Unit learning page<br/>[page.tsx]"]
  node_player["Video player and topics<br/>[UnitVideos.tsx]"]
  node_embed["Video link resolver<br/>[video.ts]"]
  node_progress["Watch progress action<br/>[progress.ts]"]
  node_syllabus["Seeded syllabus<br/>[seed-data.mjs]"]
end

subgraph group_management["Faculty management"]
  node_adminpage["Admin console<br/>[page.tsx]"]
  node_editor["Video and topic editor<br/>[VideoEditor.tsx]"]
  node_adminactions["Admin actions<br/>[admin.ts]"]
end

subgraph group_data["Application data"]
  node_database["Course and user queries<br/>[db.ts]"]
  node_sql["Postgres query layer<br/>[sql.ts]"]
  node_postgres[("Postgres")]
end

node_student(("Student"))
node_faculty(("Faculty admin"))

node_student -->|"signs in"| node_login
node_student -->|"registers"| node_register
node_faculty -->|"manages course"| node_adminpage
node_login -->|"submits credentials"| node_authactions
node_register -->|"submits details"| node_authactions
node_authactions -->|"checks or creates user"| node_database
node_authactions -->|"creates session"| node_session
node_dashboard -->|"loads subjects and units"| node_database
node_subject -->|"loads subject units"| node_database
node_unit -->|"loads unit content"| node_database
node_unit -->|"renders videos"| node_player
node_player -->|"resolves video link"| node_embed
node_player -->|"marks watched"| node_progress
node_progress -->|"updates watch state"| node_database
node_adminpage -->|"loads course and students"| node_database
node_adminpage -->|"renders editors"| node_editor
node_editor -->|"saves or deletes video"| node_adminactions
node_adminactions -->|"mutates course data"| node_database
node_database -->|"executes queries"| node_sql
node_sql -->|"reads and writes"| node_postgres
node_syllabus -.->|"seeds course content"| node_postgres

click node_login "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(auth)/login/LoginForm.tsx"
click node_register "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(auth)/register/RegisterForm.tsx"
click node_authactions "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/auth.ts"
click node_session "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/auth.ts"
click node_dashboard "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/dashboard/page.tsx"
click node_subject "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/subject/%5Bslug%5D/page.tsx"
click node_unit "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/subject/%5Bslug%5D/unit/%5Bnumber%5D/page.tsx"
click node_player "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/components/UnitVideos.tsx"
click node_embed "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/video.ts"
click node_progress "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/progress.ts"
click node_adminpage "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/admin/page.tsx"
click node_editor "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/components/VideoEditor.tsx"
click node_adminactions "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/admin.ts"
click node_syllabus "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/scripts/seed-data.mjs"
click node_database "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/db.ts"
click node_sql "https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/sql.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_login,node_register,node_authactions,node_session toneBlue
class node_dashboard,node_subject,node_unit,node_player,node_embed,node_progress,node_syllabus toneAmber
class node_adminpage,node_editor,node_adminactions toneMint
class node_database,node_sql,node_postgres toneRose
class node_student,node_faculty toneIndigo
```

## Components

### Access and identity

- [Login form](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(auth)/login/LoginForm.tsx): `app/(auth)/login/LoginForm.tsx`
- [Registration form](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(auth)/register/RegisterForm.tsx): `app/(auth)/register/RegisterForm.tsx`
- [Auth actions](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/auth.ts): `app/actions/auth.ts`
- [Session service](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/auth.ts): `lib/auth.ts`

### Course learning

- [Subject dashboard](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/dashboard/page.tsx): `app/(app)/dashboard/page.tsx`
- [Subject units](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/subject/%5Bslug%5D/page.tsx): `app/(app)/subject/[slug]/page.tsx`
- [Unit learning page](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/subject/%5Bslug%5D/unit/%5Bnumber%5D/page.tsx): `app/(app)/subject/[slug]/unit/[number]/page.tsx`
- [Video player and topics](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/components/UnitVideos.tsx): `components/UnitVideos.tsx`
- [Video link resolver](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/video.ts): `lib/video.ts`
- [Watch progress action](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/progress.ts): `app/actions/progress.ts`
- [Seeded syllabus](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/scripts/seed-data.mjs): `scripts/seed-data.mjs`

### Faculty management

- [Admin console](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/(app)/admin/page.tsx): `app/(app)/admin/page.tsx`
- [Video and topic editor](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/components/VideoEditor.tsx): `components/VideoEditor.tsx`
- [Admin actions](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/app/actions/admin.ts): `app/actions/admin.ts`

### Application data

- [Course and user queries](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/db.ts): `lib/db.ts`
- [Postgres query layer](https://github.com/raghava-183/vfstr-course-dashboard/blob/main/lib/sql.ts): `lib/sql.ts`
- **Postgres**

### Other components

- **Student**
- **Faculty admin**

## Connections

- Student → Login form: signs in (evidence: `README.md`)
- Student → Registration form: registers (evidence: `README.md`)
- Faculty admin → Admin console: manages course (evidence: `README.md`)
- Login form → Auth actions: submits credentials (evidence: `app/(auth)/login/LoginForm.tsx`)
- Registration form → Auth actions: submits details (evidence: `app/(auth)/register/RegisterForm.tsx`)
- Auth actions → Course and user queries: checks or creates user (evidence: `app/actions/auth.ts`)
- Auth actions → Session service: creates session (evidence: `app/actions/auth.ts`)
- Subject dashboard → Course and user queries: loads subjects and units (evidence: `app/(app)/dashboard/page.tsx`)
- Subject units → Course and user queries: loads subject units (evidence: `app/(app)/subject/[slug]/page.tsx`)
- Unit learning page → Course and user queries: loads unit content (evidence: `app/(app)/subject/[slug]/unit/[number]/page.tsx`)
- Unit learning page → Video player and topics: renders videos (evidence: `app/(app)/subject/[slug]/unit/[number]/page.tsx`)
- Video player and topics → Video link resolver: resolves video link (evidence: `components/UnitVideos.tsx`)
- Video player and topics → Watch progress action: marks watched (evidence: `components/UnitVideos.tsx`)
- Watch progress action → Course and user queries: updates watch state (evidence: `app/actions/progress.ts`)
- Admin console → Course and user queries: loads course and students (evidence: `app/(app)/admin/page.tsx`)
- Admin console → Video and topic editor: renders editors (evidence: `app/(app)/admin/page.tsx`)
- Video and topic editor → Admin actions: saves or deletes video (evidence: `components/VideoEditor.tsx`)
- Admin actions → Course and user queries: mutates course data (evidence: `app/actions/admin.ts`)
- Course and user queries → Postgres query layer: executes queries (evidence: `lib/db.ts`)
- Postgres query layer → Postgres: reads and writes (evidence: `README.md`)
- Seeded syllabus → Postgres: seeds course content (evidence: `README.md`)
