# guna-saikumar/vidya-learning-app-1 architecture

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

- Interactive diagram: https://gitdiagram.com/guna-saikumar/vidya-learning-app-1
- Repository: https://github.com/guna-saikumar/vidya-learning-app-1

## Overview

Vidya is a learning platform with student and administrator mobile apps backed by an API and shared packages. Students authenticate, browse curriculum, and use learning features such as quizzes, tasks, bookmarks, notifications, and progress tracking. Administrators authenticate, manage curriculum and teaching materials, and preview or publish materials. The sampled evidence confirms several authentication, curriculum, and publishing links; some student feature-to-service links are shown as unverified because their implementations were not sampled.

Main entry points: [`apps/student-mobile/App.tsx`](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/App.tsx) (App shell), [`apps/admin-mobile/App.tsx`](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/App.tsx) (App shell), [`apps/api/src/auth/admin-auth.controller.ts`](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-auth.controller.ts) (Auth routes), [`apps/api/src/app.module.ts`](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/app.module.ts) (API modules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student app"]
  node_student_app["App shell<br/>[App.tsx]"]
  node_student_auth["Session auth<br/>[useAuth.tsx]"]
  node_student_login["Login service<br/>[authService.ts]"]
  node_student_browse["Curriculum browsing"]
  node_student_learn["Chapter learning<br/>[LearnScreen.tsx]"]
  node_student_quiz["Quizzes<br/>[quizService.ts]"]
  node_student_progress["Learning progress<br/>[progressService.ts]"]
  node_student_tasks["Tasks<br/>[TasksScreen.tsx]"]
  node_student_notifications["Notifications"]
  node_student_bookmarks["Bookmarks"]
end

subgraph group_admin["Admin app"]
  node_admin_app["App shell<br/>[App.tsx]"]
  node_admin_auth["Session auth<br/>[useAdminAuth.tsx]"]
  node_admin_login["Login service<br/>[authService.ts]"]
  node_admin_curriculum["Curriculum editor<br/>[ChaptersScreen.tsx]"]
  node_admin_materials["Material authoring"]
  node_admin_content["Content editor"]
  node_admin_publish["Preview and publish"]
  node_admin_material_service["Material service"]
  node_admin_dashboard["Admin dashboard"]
end

subgraph group_backend["API backend"]
  node_api["HTTP API<br/>[main.ts]"]
  node_api_modules["API modules<br/>[app.module.ts]"]
  node_api_auth_routes["Auth routes"]
  node_api_admin_auth["Admin auth logic"]
  node_api_auth_service["Student auth logic<br/>[auth.service.ts]"]
  node_api_guards["Access guards"]
  node_api_curriculum["Curriculum endpoint"]
  node_db[("PostgreSQL access<br/>[prisma.service.ts]")]
  node_mailer["Email delivery<br/>[mailer.service.ts]"]
end

subgraph group_shared["Shared packages"]
  node_curriculum_service["Curriculum queries"]
  node_curriculum_data["Curriculum data<br/>[curriculum.data.ts]"]
  node_api_client["API client<br/>[client.ts]"]
  node_admin_api_client["Admin auth client<br/>[admin-auth.ts]"]
end

node_student_actor(("Student"))
node_admin_actor(("Administrator"))

node_student_actor -->|"uses"| node_student_app
node_student_app -->|"provides session"| node_student_auth
node_student_auth -->|"delegates auth"| node_student_login
node_student_login -->|"calls API"| node_api_client
node_student_app -.->|"routes to"| node_student_browse
node_student_app -.->|"routes to"| node_student_learn
node_student_learn -.->|"uses quiz operations"| node_student_quiz
node_student_app -.->|"shows progress"| node_student_progress
node_student_app -.->|"routes to"| node_student_tasks
node_student_app -.->|"routes to"| node_student_notifications
node_student_app -.->|"routes to"| node_student_bookmarks
node_admin_actor -->|"uses"| node_admin_app
node_admin_app -->|"provides session"| node_admin_auth
node_admin_auth -->|"delegates auth"| node_admin_login
node_admin_login -->|"calls auth API"| node_admin_api_client
node_admin_api_client -->|"uses client"| node_api_client
node_admin_app -->|"routes to"| node_admin_curriculum
node_admin_app -->|"routes to"| node_admin_materials
node_admin_app -->|"routes to"| node_admin_content
node_admin_app -->|"routes to"| node_admin_publish
node_admin_publish -->|"loads and updates"| node_admin_material_service
node_admin_app -.->|"routes to"| node_admin_dashboard
node_api -->|"starts module"| node_api_modules
node_api_modules -->|"registers auth module"| node_api_auth_routes
node_api_auth_routes -->|"delegates admin auth"| node_api_admin_auth
node_api_auth_routes -->|"guards profile route"| node_api_guards
node_api_admin_auth -->|"reads and writes users"| node_db
node_api_admin_auth -->|"sends OTP email"| node_mailer
node_api_auth_routes -.->|"student auth route"| node_api_auth_service
node_api_modules -->|"registers controller"| node_api_curriculum
node_api_curriculum -->|"queries classes"| node_curriculum_service
node_curriculum_service -->|"reads data"| node_curriculum_data

click node_student_app "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/App.tsx"
click node_student_auth "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/hooks/useAuth.tsx"
click node_student_login "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/authService.ts"
click node_student_browse "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/SubjectIndexScreen.tsx"
click node_student_learn "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/LearnScreen.tsx"
click node_student_quiz "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/quizService.ts"
click node_student_progress "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/progressService.ts"
click node_student_tasks "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/TasksScreen.tsx"
click node_student_notifications "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/notificationService.ts"
click node_student_bookmarks "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/BookmarksScreen.tsx"
click node_admin_app "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/App.tsx"
click node_admin_auth "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/hooks/useAdminAuth.tsx"
click node_admin_login "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/services/authService.ts"
click node_admin_curriculum "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/ChaptersScreen.tsx"
click node_admin_materials "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/AddEditMaterialScreen.tsx"
click node_admin_content "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/ContentEditorScreen.tsx"
click node_admin_publish "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/PreviewPublishScreen.tsx"
click node_admin_material_service "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/services/materialsService.ts"
click node_admin_dashboard "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/DashboardScreen.tsx"
click node_api "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/main.ts"
click node_api_modules "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/app.module.ts"
click node_api_auth_routes "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-auth.controller.ts"
click node_api_admin_auth "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-auth.service.ts"
click node_api_auth_service "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/auth.service.ts"
click node_api_guards "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-role.guard.ts"
click node_api_curriculum "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/curriculum/curriculum.controller.ts"
click node_curriculum_service "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/curriculum/src/curriculum.service.ts"
click node_curriculum_data "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/curriculum/src/curriculum.data.ts"
click node_api_client "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/api-client/src/client.ts"
click node_admin_api_client "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/api-client/src/admin-auth.ts"
click node_db "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/prisma/prisma.service.ts"
click node_mailer "https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/mailer/mailer.service.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_student_app,node_student_auth,node_student_login,node_student_browse,node_student_learn,node_student_quiz,node_student_progress,node_student_tasks,node_student_notifications,node_student_bookmarks toneBlue
class node_admin_app,node_admin_auth,node_admin_login,node_admin_curriculum,node_admin_materials,node_admin_content,node_admin_publish,node_admin_material_service,node_admin_dashboard toneAmber
class node_api,node_api_modules,node_api_auth_routes,node_api_admin_auth,node_api_auth_service,node_api_guards,node_api_curriculum,node_db,node_mailer toneMint
class node_curriculum_service,node_curriculum_data,node_api_client,node_admin_api_client toneRose
class node_student_actor,node_admin_actor toneIndigo
```

## Components

### Student app

- [App shell](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/App.tsx): `apps/student-mobile/App.tsx`
- [Session auth](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/hooks/useAuth.tsx): `apps/student-mobile/src/hooks/useAuth.tsx`
- [Login service](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/authService.ts): `apps/student-mobile/src/services/authService.ts`
- [Curriculum browsing](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/SubjectIndexScreen.tsx): `apps/student-mobile/src/screens/SubjectIndexScreen.tsx`
- [Chapter learning](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/LearnScreen.tsx): `apps/student-mobile/src/screens/LearnScreen.tsx`
- [Quizzes](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/quizService.ts): `apps/student-mobile/src/services/quizService.ts`
- [Learning progress](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/progressService.ts): `apps/student-mobile/src/services/progressService.ts`
- [Tasks](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/TasksScreen.tsx): `apps/student-mobile/src/screens/TasksScreen.tsx`
- [Notifications](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/services/notificationService.ts): `apps/student-mobile/src/services/notificationService.ts`
- [Bookmarks](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/student-mobile/src/screens/BookmarksScreen.tsx): `apps/student-mobile/src/screens/BookmarksScreen.tsx`

### Admin app

- [App shell](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/App.tsx): `apps/admin-mobile/App.tsx`
- [Session auth](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/hooks/useAdminAuth.tsx): `apps/admin-mobile/src/hooks/useAdminAuth.tsx`
- [Login service](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/services/authService.ts): `apps/admin-mobile/src/services/authService.ts`
- [Curriculum editor](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/ChaptersScreen.tsx): `apps/admin-mobile/src/screens/ChaptersScreen.tsx`
- [Material authoring](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/AddEditMaterialScreen.tsx): `apps/admin-mobile/src/screens/AddEditMaterialScreen.tsx`
- [Content editor](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/ContentEditorScreen.tsx): `apps/admin-mobile/src/screens/ContentEditorScreen.tsx`
- [Preview and publish](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/PreviewPublishScreen.tsx): `apps/admin-mobile/src/screens/PreviewPublishScreen.tsx`
- [Material service](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/services/materialsService.ts): `apps/admin-mobile/src/services/materialsService.ts`
- [Admin dashboard](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/admin-mobile/src/screens/DashboardScreen.tsx): `apps/admin-mobile/src/screens/DashboardScreen.tsx`

### API backend

- [HTTP API](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/main.ts): `apps/api/src/main.ts`
- [API modules](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/app.module.ts): `apps/api/src/app.module.ts`
- [Auth routes](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-auth.controller.ts): `apps/api/src/auth/admin-auth.controller.ts`
- [Admin auth logic](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-auth.service.ts): `apps/api/src/auth/admin-auth.service.ts`
- [Student auth logic](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`
- [Access guards](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/auth/admin-role.guard.ts): `apps/api/src/auth/admin-role.guard.ts`
- [Curriculum endpoint](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/curriculum/curriculum.controller.ts): `apps/api/src/curriculum/curriculum.controller.ts`
- [PostgreSQL access](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`
- [Email delivery](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/apps/api/src/mailer/mailer.service.ts): `apps/api/src/mailer/mailer.service.ts`

### Shared packages

- [Curriculum queries](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/curriculum/src/curriculum.service.ts): `packages/curriculum/src/curriculum.service.ts`
- [Curriculum data](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/curriculum/src/curriculum.data.ts): `packages/curriculum/src/curriculum.data.ts`
- [API client](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/api-client/src/client.ts): `packages/api-client/src/client.ts`
- [Admin auth client](https://github.com/guna-saikumar/vidya-learning-app-1/blob/main/packages/api-client/src/admin-auth.ts): `packages/api-client/src/admin-auth.ts`

### Other components

- **Student**
- **Administrator**

## Connections

- Student → App shell: uses
- App shell → Session auth: provides session (evidence: `apps/student-mobile/App.tsx`)
- Session auth → Login service: delegates auth (evidence: `apps/student-mobile/src/hooks/useAuth.tsx`)
- Login service → API client: calls API (evidence: `apps/student-mobile/src/services/authService.ts`)
- App shell → Curriculum browsing: routes to
- App shell → Chapter learning: routes to
- Chapter learning → Quizzes: uses quiz operations
- App shell → Learning progress: shows progress (evidence: `apps/student-mobile/App.tsx`)
- App shell → Tasks: routes to
- App shell → Notifications: routes to
- App shell → Bookmarks: routes to
- Administrator → App shell: uses
- App shell → Session auth: provides session (evidence: `apps/admin-mobile/App.tsx`)
- Session auth → Login service: delegates auth (evidence: `apps/admin-mobile/src/hooks/useAdminAuth.tsx`)
- Login service → Admin auth client: calls auth API (evidence: `apps/admin-mobile/src/services/authService.ts`)
- Admin auth client → API client: uses client (evidence: `packages/api-client/src/admin-auth.ts`)
- App shell → Curriculum editor: routes to
- App shell → Material authoring: routes to
- App shell → Content editor: routes to
- App shell → Preview and publish: routes to
- Preview and publish → Material service: loads and updates (evidence: `apps/admin-mobile/src/screens/PreviewPublishScreen.tsx`)
- App shell → Admin dashboard: routes to
- HTTP API → API modules: starts module (evidence: `apps/api/src/main.ts`)
- API modules → Auth routes: registers auth module (evidence: `apps/api/src/app.module.ts`)
- Auth routes → Admin auth logic: delegates admin auth (evidence: `apps/api/src/auth/admin-auth.controller.ts`)
- Auth routes → Access guards: guards profile route (evidence: `apps/api/src/auth/admin-auth.controller.ts`)
- Admin auth logic → PostgreSQL access: reads and writes users (evidence: `apps/api/src/auth/admin-auth.service.ts`)
- Admin auth logic → Email delivery: sends OTP email (evidence: `apps/api/src/auth/admin-auth.service.ts`)
- Auth routes → Student auth logic: student auth route
- API modules → Curriculum endpoint: registers controller (evidence: `apps/api/src/app.module.ts`)
- Curriculum endpoint → Curriculum queries: queries classes (evidence: `apps/api/src/curriculum/curriculum.controller.ts`)
- Curriculum queries → Curriculum data: reads data (evidence: `packages/curriculum/src/curriculum.service.ts`)
