# vk-official/eduplus-kerala architecture

> Architecture diagram of the GitHub repository vk-official/eduplus-kerala, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vk-official/eduplus-kerala
- Repository: https://github.com/vk-official/eduplus-kerala

## Overview

1. **Overall shape**
   - This is a **Next.js App Router** application with a mostly server-rendered page structure and a shared component library.
   - The app is organized around a public education portal plus authenticated educator/admin areas.

2. **Primary route boundaries**
   - Public-facing routes live under `app/` and include the landing page, textbooks, vault landing, bookmarks, dashboard, teacher profiles, and legal pages.
   - Special-purpose areas are split into distinct route groups: `app/admin`, `app/teacher/[name]`, `app/vault/[id]`, and `app/file/[id]`.

3. **Public content and discovery layer**
   - The root page and marketing/content pages (`about`, `privacy`, `terms`) are driven by reusable presentation components like `HeroSection`, `FaqSection`, `LeaderboardSection`, `SpecialitiesSection`, and `MarqueeBanner`.
   - `app/sitemap.ts` and `app/robots.ts` indicate the site is SEO-aware and meant to be indexed as a public resource hub.

4. **Textbook gateway subsystem**
   - `app/textbooks` appears to be the SCERT textbook discovery entry point described in the README.
   - Supporting UI such as `SearchInput`, `SidebarFilter`, `CustomSelect`, and `FileCard` suggests a filter-and-browse flow for locating official materials.

5. **Teacher Vault subsystem**
   - `app/vault` and `app/vault/[id]` form the educator resource library.
   - Components like `VaultGrid`, `VaultContent`, `UploadForm`, `DeleteMaterialButton`, and `ResourceActions` show the core flow: authenticated teachers upload, manage, and view shared materials.

6. **File detail and download flow**
   - `app/file/[id]` is a dedicated material detail page with `DownloadButton`, likely used to present metadata and trigger file retrieval.
   - This is a clear boundary between list/browse views and a deeper asset-specific experience.

7. **Teacher interaction layer**
   - `app/teacher/[name]` suggests public teacher profile pages.
   - `CommentSection`, `TeacherCommentDashboard`, and `ActivitySidebar` indicate a social/feedback layer around educators and their resources.

8. **Admin and moderation subsystem**
   - `app/admin` and `app/admin/dashboard` separate higher-privilege operations from normal user flows.
   - `SuperAdminDashboard`, `AdminAnnouncementSetter`, and `FeedbackWidget` imply moderation, announcements, and platform-level management of submissions or user feedback.

9. **Data and service layer**
   - `lib/supabase.ts` is the central backend integration point for **database and authentication**.
   - `lib/actions/admin.actions.ts` and `lib/actions/fetch.actions.ts` suggest server-side actions that mediate reads/writes between the UI and Supabase.
   - `lib/drive.ts` indicates an additional external storage or retrieval integration, likely for documents/files.

10. **Shared UI and presentation system**
   - `components/` contains the reusable shell and layout primitives: `header`, `BottomNav`, `NavLinks`, `PageWrapper`, `theme-provider`, `theme-toggle`, and `LiquidGlass`.
   - `components/ui/LoadingSpinner.tsx` plus `components.json` suggest a standardized UI component setup layered on Tailwind CSS.

11. **App shell and global concerns**
   - `app/layout.tsx`, `app/globals.css`, and `components/theme-provider.tsx` define the global shell, styling, and theme behavior.
   - `GSAPProvider` suggests selective animation support in the client-facing experience.

12. **Architecture summary for diagramming**
   - Think of the system as: **public content routes** and **authenticated resource-management routes** on top of a **shared Next.js UI shell**, all backed by **Supabase** and a file/drive integration.
   - The main data flows are: browse/search textbooks, upload/manage vault materials, open file detail pages, and submit feedback or moderation actions through admin tools.

Main entry points: [`lib/actions/fetch.actions.ts`](https://github.com/vk-official/eduplus-kerala/blob/main/lib/actions/fetch.actions.ts) (Server actions), [`app/layout.tsx`](https://github.com/vk-official/eduplus-kerala/blob/main/app/layout.tsx) (App shell), [`lib/supabase.ts`](https://github.com/vk-official/eduplus-kerala/blob/main/lib/supabase.ts) (Supabase), [`app/textbooks/page.tsx`](https://github.com/vk-official/eduplus-kerala/blob/main/app/textbooks/page.tsx) (Textbooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App routes"]
  node_app_root["Home<br/>route page<br/>[page.tsx]"]
  node_app_about["About<br/>route page<br/>[page.tsx]"]
  node_app_textbooks["Textbooks<br/>route page<br/>[page.tsx]"]
  node_app_vault["Vault<br/>route page<br/>[page.tsx]"]
  node_app_vault_item["Vault item<br/>route page<br/>[page.tsx]"]
  node_app_file_item["File detail<br/>route page<br/>[page.tsx]"]
  node_app_teacher["Teacher profile<br/>route page<br/>[page.tsx]"]
  node_app_admin["Admin<br/>route page<br/>[page.tsx]"]
  node_app_admin_dash["Admin dashboard<br/>route page<br/>[page.tsx]"]
  node_app_dashboard["Dashboard<br/>route page<br/>[page.tsx]"]
  node_app_bookmarks["Bookmarks<br/>route page<br/>[page.tsx]"]
  node_app_privacy["Privacy<br/>route page<br/>[page.tsx]"]
  node_app_terms["Terms<br/>route page<br/>[page.tsx]"]
end

subgraph group_ui["Shared UI"]
  node_app_shell["App shell<br/>layout<br/>[layout.tsx]"]
  node_ui_layout["Navigation shell<br/>layout components<br/>[header.tsx]"]
  node_ui_theme["Theme system<br/>ui infra<br/>[theme-provider.tsx]"]
  node_ui_presentations["Marketing sections<br/>content components<br/>[HeroSection.tsx]"]
  node_ui_textbook["Browse tools<br/>search/filter UI<br/>[SearchInput.tsx]"]
  node_ui_vault["Vault tools<br/>resource UI<br/>[VaultGrid.tsx]"]
  node_ui_teacher["Teacher tools<br/>feedback UI<br/>[CommentSection.tsx]"]
  node_ui_admin["Admin tools<br/>moderation UI"]
  node_ui_shared["Common UI<br/>shared primitives<br/>[LoadingSpinner.tsx]"]
end

subgraph group_services["Data services"]
  node_svc_actions["Server actions<br/>[fetch.actions.ts]"]
  node_svc_supabase[("Supabase<br/>backend client<br/>[supabase.ts]")]
  node_svc_drive["Drive access<br/>storage integration<br/>[drive.ts]"]
end

node_app_shell -->|"wraps"| node_ui_layout
node_app_shell -->|"provides theme"| node_ui_theme
node_app_root -->|"uses"| node_ui_presentations
node_app_about -->|"uses"| node_ui_presentations
node_app_textbooks -->|"uses"| node_ui_textbook
node_app_vault -->|"uses"| node_ui_vault
node_app_vault_item -->|"uses"| node_ui_vault
node_app_file_item -->|"uses"| node_ui_shared
node_app_teacher -->|"uses"| node_ui_teacher
node_app_admin_dash -->|"uses"| node_ui_admin
node_app_dashboard -->|"uses"| node_ui_layout
node_app_bookmarks -->|"uses"| node_ui_shared
node_app_admin -->|"invokes"| node_svc_actions
node_app_textbooks -->|"fetches"| node_svc_actions
node_app_vault -->|"fetches"| node_svc_actions
node_app_vault_item -->|"mutates"| node_svc_actions
node_app_file_item -->|"downloads from"| node_svc_drive
node_app_teacher -->|"reads/writes"| node_svc_supabase
node_ui_admin -->|"manages"| node_svc_supabase
node_svc_actions -->|"uses"| node_svc_supabase
node_svc_actions -->|"uses"| node_svc_drive
node_app_shell -->|"hosts"| node_app_root
node_app_shell -->|"hosts"| node_app_admin_dash

click node_app_root "https://github.com/vk-official/eduplus-kerala/blob/main/app/page.tsx"
click node_app_about "https://github.com/vk-official/eduplus-kerala/blob/main/app/about/page.tsx"
click node_app_textbooks "https://github.com/vk-official/eduplus-kerala/blob/main/app/textbooks/page.tsx"
click node_app_vault "https://github.com/vk-official/eduplus-kerala/blob/main/app/vault/page.tsx"
click node_app_vault_item "https://github.com/vk-official/eduplus-kerala/blob/main/app/vault/[id]/page.tsx"
click node_app_file_item "https://github.com/vk-official/eduplus-kerala/blob/main/app/file/[id]/page.tsx"
click node_app_teacher "https://github.com/vk-official/eduplus-kerala/blob/main/app/teacher/[name]/page.tsx"
click node_app_admin "https://github.com/vk-official/eduplus-kerala/blob/main/app/admin/page.tsx"
click node_app_admin_dash "https://github.com/vk-official/eduplus-kerala/blob/main/app/admin/dashboard/page.tsx"
click node_app_dashboard "https://github.com/vk-official/eduplus-kerala/blob/main/app/dashboard/page.tsx"
click node_app_bookmarks "https://github.com/vk-official/eduplus-kerala/blob/main/app/bookmarks/page.tsx"
click node_app_privacy "https://github.com/vk-official/eduplus-kerala/blob/main/app/privacy/page.tsx"
click node_app_terms "https://github.com/vk-official/eduplus-kerala/blob/main/app/terms/page.tsx"
click node_app_shell "https://github.com/vk-official/eduplus-kerala/blob/main/app/layout.tsx"
click node_ui_layout "https://github.com/vk-official/eduplus-kerala/blob/main/components/header.tsx"
click node_ui_theme "https://github.com/vk-official/eduplus-kerala/blob/main/components/theme-provider.tsx"
click node_ui_presentations "https://github.com/vk-official/eduplus-kerala/blob/main/components/HeroSection.tsx"
click node_ui_textbook "https://github.com/vk-official/eduplus-kerala/blob/main/components/SearchInput.tsx"
click node_ui_vault "https://github.com/vk-official/eduplus-kerala/blob/main/components/VaultGrid.tsx"
click node_ui_teacher "https://github.com/vk-official/eduplus-kerala/blob/main/components/CommentSection.tsx"
click node_ui_admin "https://github.com/vk-official/eduplus-kerala/blob/main/components/SuperAdminDashboard.tsx"
click node_ui_shared "https://github.com/vk-official/eduplus-kerala/blob/main/components/ui/LoadingSpinner.tsx"
click node_svc_actions "https://github.com/vk-official/eduplus-kerala/blob/main/lib/actions/fetch.actions.ts"
click node_svc_supabase "https://github.com/vk-official/eduplus-kerala/blob/main/lib/supabase.ts"
click node_svc_drive "https://github.com/vk-official/eduplus-kerala/blob/main/lib/drive.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_app_root,node_app_about,node_app_textbooks,node_app_vault,node_app_vault_item,node_app_file_item,node_app_teacher,node_app_admin,node_app_admin_dash,node_app_dashboard,node_app_bookmarks,node_app_privacy,node_app_terms toneBlue
class node_app_shell,node_ui_layout,node_ui_theme,node_ui_presentations,node_ui_textbook,node_ui_vault,node_ui_teacher,node_ui_admin,node_ui_shared toneAmber
class node_svc_actions,node_svc_supabase,node_svc_drive toneMint
```

## Components

### App routes

Next.js App Router boundaries for public, teacher, vault, file, and admin experiences.

- [Home](https://github.com/vk-official/eduplus-kerala/blob/main/app/page.tsx): route page · Public landing page and entry point for the education portal. · `app/page.tsx`
- [About](https://github.com/vk-official/eduplus-kerala/blob/main/app/about/page.tsx): route page · Public informational page. · `app/about/page.tsx`
- [Textbooks](https://github.com/vk-official/eduplus-kerala/blob/main/app/textbooks/page.tsx): route page · Discovery and browsing entry for official textbooks and materials. · `app/textbooks/page.tsx`
- [Vault](https://github.com/vk-official/eduplus-kerala/blob/main/app/vault/page.tsx): route page · Teacher resource library landing page. · `app/vault/page.tsx`
- [Vault item](https://github.com/vk-official/eduplus-kerala/blob/main/app/vault/[id]/page.tsx): route page · Individual vault material detail view. · `app/vault/[id]/page.tsx`
- [File detail](https://github.com/vk-official/eduplus-kerala/blob/main/app/file/[id]/page.tsx): route page · Dedicated file page for metadata and download actions. · `app/file/[id]/page.tsx`
- [Teacher profile](https://github.com/vk-official/eduplus-kerala/blob/main/app/teacher/[name]/page.tsx): route page · Public educator profile and feedback page. · `app/teacher/[name]/page.tsx`
- [Admin](https://github.com/vk-official/eduplus-kerala/blob/main/app/admin/page.tsx): route page · Entry point for privileged admin workflows. · `app/admin/page.tsx`
- [Admin dashboard](https://github.com/vk-official/eduplus-kerala/blob/main/app/admin/dashboard/page.tsx): route page · Higher-privilege moderation and platform management area. · `app/admin/dashboard/page.tsx`
- [Dashboard](https://github.com/vk-official/eduplus-kerala/blob/main/app/dashboard/page.tsx): route page · Authenticated user dashboard area. · `app/dashboard/page.tsx`
- [Bookmarks](https://github.com/vk-official/eduplus-kerala/blob/main/app/bookmarks/page.tsx): route page · Saved items and quick access page. · `app/bookmarks/page.tsx`
- [Privacy](https://github.com/vk-official/eduplus-kerala/blob/main/app/privacy/page.tsx): route page · Legal policy page. · `app/privacy/page.tsx`
- [Terms](https://github.com/vk-official/eduplus-kerala/blob/main/app/terms/page.tsx): route page · Legal terms page. · `app/terms/page.tsx`

### Shared UI

Reusable presentation, layout, and interaction components used across routes.

- [App shell](https://github.com/vk-official/eduplus-kerala/blob/main/app/layout.tsx): layout · Global layout, styling, and site metadata plumbing. · `app/layout.tsx`
- [Navigation shell](https://github.com/vk-official/eduplus-kerala/blob/main/components/header.tsx): layout components · Header, bottom nav, page wrapper, and shared navigation primitives. · `components/header.tsx`
- [Theme system](https://github.com/vk-official/eduplus-kerala/blob/main/components/theme-provider.tsx): ui infra · Theme provider and theme toggle used across the app. · `components/theme-provider.tsx`
- [Marketing sections](https://github.com/vk-official/eduplus-kerala/blob/main/components/HeroSection.tsx): content components · Reusable public-facing sections for landing and informational pages. · `components/HeroSection.tsx`
- [Browse tools](https://github.com/vk-official/eduplus-kerala/blob/main/components/SearchInput.tsx): search/filter UI · Search, filter, and material card controls for textbook discovery. · `components/SearchInput.tsx`
- [Vault tools](https://github.com/vk-official/eduplus-kerala/blob/main/components/VaultGrid.tsx): resource UI · Vault grid, content, upload, and material actions for educator resources. · `components/VaultGrid.tsx`
- [Teacher tools](https://github.com/vk-official/eduplus-kerala/blob/main/components/CommentSection.tsx): feedback UI · Teacher comments, activity, and profile-side widgets. · `components/CommentSection.tsx`
- [Admin tools](https://github.com/vk-official/eduplus-kerala/blob/main/components/SuperAdminDashboard.tsx): moderation UI · Admin dashboard, announcement, and feedback widgets. · `components/SuperAdminDashboard.tsx`
- [Common UI](https://github.com/vk-official/eduplus-kerala/blob/main/components/ui/LoadingSpinner.tsx): shared primitives · Shared utility components such as loading states and visual effects. · `components/ui/LoadingSpinner.tsx`

### Data services

Backend integration, server actions, and shared utilities.

- [Server actions](https://github.com/vk-official/eduplus-kerala/blob/main/lib/actions/fetch.actions.ts): actions · Server-side operations for fetching and admin mutations. · `lib/actions/fetch.actions.ts`
- [Supabase](https://github.com/vk-official/eduplus-kerala/blob/main/lib/supabase.ts): backend client · Primary database and authentication integration. · `lib/supabase.ts`
- [Drive access](https://github.com/vk-official/eduplus-kerala/blob/main/lib/drive.ts): storage integration · External file storage or retrieval integration for documents. · `lib/drive.ts`

## Connections

- App shell → Navigation shell: wraps · Global layout composes shared site chrome.
- App shell → Theme system: provides theme · Layout enables app-wide theming.
- Home → Marketing sections: uses · Landing page is built from reusable marketing sections.
- About → Marketing sections: uses · Informational pages reuse public content sections.
- Textbooks → Browse tools: uses · Textbook discovery relies on search, filtering, and cards.
- Vault → Vault tools: uses · Vault landing page uses resource browsing components.
- Vault item → Vault tools: uses · Vault detail view shares resource action and content patterns.
- File detail → Common UI: uses · File detail page uses shared UI primitives including download flow.
- Teacher profile → Teacher tools: uses · Teacher profile page centers on comments and activity widgets.
- Admin dashboard → Admin tools: uses · Admin dashboard is assembled from moderation and management widgets.
- Dashboard → Navigation shell: uses · Authenticated area shares the common navigation shell.
- Bookmarks → Common UI: uses · Bookmarks page uses shared UI primitives.
- Admin → Server actions: invokes · Admin entry routes into privileged server actions.
- Textbooks → Server actions: fetches · Textbook discovery pulls data through server actions.
- Vault → Server actions: fetches · Vault browsing reads resources via server actions.
- Vault item → Server actions: mutates · Vault item actions may update or manage materials.
- File detail → Drive access: downloads from · File detail pages connect to document retrieval.
- Teacher profile → Supabase: reads/writes · Teacher profile and feedback data are backed by Supabase.
- Admin tools → Supabase: manages · Admin widgets operate on platform data through Supabase.
- Server actions → Supabase: uses · Server actions mediate database and auth operations.
- Server actions → Drive access: uses · Actions coordinate file storage and retrieval.
- App shell → Home: hosts · Root layout surrounds the public entry page.
- App shell → Admin dashboard: hosts · Global shell also frames admin experience.
