# ycr-latrelle/learnifypkt architecture

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

- Interactive diagram: https://gitdiagram.com/ycr-latrelle/learnifypkt
- Repository: https://github.com/ycr-latrelle/learnifypkt

## Overview

Learnify is a study-material application with a React client and ASP.NET API. Learners authenticate, organize subjects, and work with notes, flashcards, and quizzes; they can also generate study materials from uploaded files. The client routes users to study screens and maintains shared study data while calling API services. The API separates controllers from authentication, study, and AI services; quiz persistence in Firestore is visible in the sampled source. Several client screens and backend integrations are listed in the source index but not excerpted, so their internal links are omitted where unverified.

Main entry points: [`learnify-pocket/src/App.jsx`](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/App.jsx) (App routing), [`learnify-pocket/src/context/StudyDataContext.jsx`](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/context/StudyDataContext.jsx) (Study data), [`learnify-pocket/src/context/AuthContext.jsx`](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/context/AuthContext.jsx) (Auth state), [`Learnify.Api/Services/Authentication/FirebaseAuthenticationService.cs`](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Authentication/FirebaseAuthenticationService.cs) (Firebase auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth_ui["Authentication screens"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_subjects_ui["Subjects<br/>[SubjectsPage.jsx]"]
  node_subject_detail["Subject detail"]
  node_study_screens["Study screens<br/>[NotesPage.jsx]"]
  node_study_context["Study data"]
end

subgraph group_identity["Authentication"]
  node_auth_context["Auth state<br/>[AuthContext.jsx]"]
  node_auth_service["Auth client<br/>[AuthService.js]"]
  node_api_client["Authorized API<br/>[apiClient.js]"]
  node_auth_controller["Auth endpoints<br/>[AuthController.cs]"]
  node_auth_service_api["Firebase auth"]
  node_token_handler["Token validation"]
end

subgraph group_study["Study management"]
  node_subject_controller["Subject endpoints"]
  node_note_controller["Note endpoints<br/>[NotesController.cs]"]
  node_quiz_controller["Quiz endpoints"]
  node_flash_controller["Flashcard endpoints"]
  node_subject_service["Subject operations<br/>[SubjectService.cs]"]
  node_note_service["Note operations<br/>[NoteService.cs]"]
  node_quiz_service["Quiz operations<br/>[QuizService.cs]"]
  node_flash_service["Flashcard operations"]
end

subgraph group_generation["AI generation"]
  node_generation_ui["Tutor and upload<br/>[AITutorPage.jsx]"]
  node_generation_context["Generation client"]
  node_generation_controller["File generation"]
  node_extraction["File extraction"]
  node_ai_service["Study generation"]
end

node_learner(("Learner"))
node_firebase[("Firebase")]
node_firestore[("Firestore")]
node_openrouter["OpenRouter"]

node_learner -.->|"uses"| node_app
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_subjects_ui
node_app -->|"routes to"| node_subject_detail
node_app -->|"routes to"| node_study_screens
node_app -->|"uses"| node_auth_context
node_study_context -->|"fetches subjects"| node_subject_service
node_study_context -->|"creates notes"| node_note_service
node_study_context -->|"requests generation"| node_generation_context
node_auth_context -->|"uses"| node_api_client
node_auth_context -->|"observes auth"| node_firebase
node_auth_service -->|"authenticates"| node_firebase
node_auth_service -->|"calls endpoints"| node_auth_controller
node_auth_controller -->|"delegates to"| node_auth_service_api
node_auth_service_api -->|"uses"| node_firebase
node_auth_service_api -.->|"requests OTP"| node_token_handler
node_subject_controller -->|"delegates to"| node_subject_service
node_note_controller -->|"delegates to"| node_note_service
node_quiz_controller -->|"delegates to"| node_quiz_service
node_flash_controller -.->|"delegates to"| node_flash_service
node_quiz_service -->|"reads and writes"| node_firestore
node_generation_ui -.->|"requests materials"| node_generation_context
node_generation_context -.->|"uploads file"| node_generation_controller
node_generation_controller -->|"extracts content"| node_extraction
node_generation_controller -->|"generates materials"| node_ai_service
node_ai_service -->|"sends prompt"| node_openrouter

click node_app "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/App.jsx"
click node_auth_ui "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Authentication%20Page/AuthenticationCanvas.jsx"
click node_dashboard "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Dashboard/DashboardPage.jsx"
click node_subjects_ui "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Subjects/SubjectsPage.jsx"
click node_subject_detail "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Subjects/SubjectDetailPage.jsx"
click node_study_screens "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Notes/NotesPage.jsx"
click node_study_context "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/context/StudyDataContext.jsx"
click node_auth_context "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/context/AuthContext.jsx"
click node_auth_service "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/services/AuthService.js"
click node_api_client "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/services/apiClient.js"
click node_auth_controller "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/AuthController.cs"
click node_auth_service_api "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Authentication/FirebaseAuthenticationService.cs"
click node_token_handler "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Authentication/FirebaseAuthenticationHandler.cs"
click node_subject_controller "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/SubjectController.cs"
click node_note_controller "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/NotesController.cs"
click node_quiz_controller "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/QuizzesController.cs"
click node_flash_controller "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/FlashCardController.cs"
click node_subject_service "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/SubjectService.cs"
click node_note_service "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/NoteService.cs"
click node_quiz_service "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/QuizService.cs"
click node_flash_service "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/FlashCardService.cs"
click node_generation_ui "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Tutor/AITutorPage.jsx"
click node_generation_context "https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/services/StudyGenerationService.js"
click node_generation_controller "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/StudyFileGenerationController.cs"
click node_extraction "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/AI/StudyFileExtractionService.cs"
click node_ai_service "https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/AI/OpenRouterStudyService.cs"

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,node_auth_ui,node_dashboard,node_subjects_ui,node_subject_detail,node_study_screens,node_study_context toneBlue
class node_auth_context,node_auth_service,node_api_client,node_auth_controller,node_auth_service_api,node_token_handler,node_firebase,node_firestore toneAmber
class node_subject_controller,node_note_controller,node_quiz_controller,node_flash_controller,node_subject_service,node_note_service,node_quiz_service,node_flash_service,node_openrouter toneMint
class node_generation_ui,node_generation_context,node_generation_controller,node_extraction,node_ai_service toneRose
class node_learner toneIndigo
```

## Components

### Client experience

- [App routing](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/App.jsx): `learnify-pocket/src/App.jsx`
- [Authentication screens](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Authentication%20Page/AuthenticationCanvas.jsx): `learnify-pocket/src/pages/Authentication Page/AuthenticationCanvas.jsx`
- [Dashboard](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Dashboard/DashboardPage.jsx): `learnify-pocket/src/pages/Dashboard/DashboardPage.jsx`
- [Subjects](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Subjects/SubjectsPage.jsx): `learnify-pocket/src/pages/Subjects/SubjectsPage.jsx`
- [Subject detail](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Subjects/SubjectDetailPage.jsx): `learnify-pocket/src/pages/Subjects/SubjectDetailPage.jsx`
- [Study screens](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Notes/NotesPage.jsx): `learnify-pocket/src/pages/Notes/NotesPage.jsx`
- [Study data](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/context/StudyDataContext.jsx): `learnify-pocket/src/context/StudyDataContext.jsx`

### Authentication

- [Auth state](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/context/AuthContext.jsx): `learnify-pocket/src/context/AuthContext.jsx`
- [Auth client](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/services/AuthService.js): `learnify-pocket/src/services/AuthService.js`
- [Authorized API](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/services/apiClient.js): `learnify-pocket/src/services/apiClient.js`
- [Auth endpoints](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/AuthController.cs): `Learnify.Api/Controllers/AuthController.cs`
- [Firebase auth](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Authentication/FirebaseAuthenticationService.cs): `Learnify.Api/Services/Authentication/FirebaseAuthenticationService.cs`
- [Token validation](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Authentication/FirebaseAuthenticationHandler.cs): `Learnify.Api/Services/Authentication/FirebaseAuthenticationHandler.cs`

### Study management

- [Subject endpoints](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/SubjectController.cs): `Learnify.Api/Controllers/SubjectController.cs`
- [Note endpoints](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/NotesController.cs): `Learnify.Api/Controllers/NotesController.cs`
- [Quiz endpoints](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/QuizzesController.cs): `Learnify.Api/Controllers/QuizzesController.cs`
- [Flashcard endpoints](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/FlashCardController.cs): `Learnify.Api/Controllers/FlashCardController.cs`
- [Subject operations](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/SubjectService.cs): `Learnify.Api/Services/Study/SubjectService.cs`
- [Note operations](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/NoteService.cs): `Learnify.Api/Services/Study/NoteService.cs`
- [Quiz operations](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/QuizService.cs): `Learnify.Api/Services/Study/QuizService.cs`
- [Flashcard operations](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/Study/FlashCardService.cs): `Learnify.Api/Services/Study/FlashCardService.cs`

### AI generation

- [Tutor and upload](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/pages/Tutor/AITutorPage.jsx): `learnify-pocket/src/pages/Tutor/AITutorPage.jsx`
- [Generation client](https://github.com/ycr-latrelle/learnifypkt/blob/main/learnify-pocket/src/services/StudyGenerationService.js): `learnify-pocket/src/services/StudyGenerationService.js`
- [File generation](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Controllers/StudyFileGenerationController.cs): `Learnify.Api/Controllers/StudyFileGenerationController.cs`
- [File extraction](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/AI/StudyFileExtractionService.cs): `Learnify.Api/Services/AI/StudyFileExtractionService.cs`
- [Study generation](https://github.com/ycr-latrelle/learnifypkt/blob/main/Learnify.Api/Services/AI/OpenRouterStudyService.cs): `Learnify.Api/Services/AI/OpenRouterStudyService.cs`

### Other components

- **Learner**
- **Firebase**
- **Firestore**
- **OpenRouter**

## Connections

- Learner → App routing: uses
- App routing → Authentication screens: routes to (evidence: `learnify-pocket/src/App.jsx`)
- App routing → Dashboard: routes to (evidence: `learnify-pocket/src/App.jsx`)
- App routing → Subjects: routes to (evidence: `learnify-pocket/src/App.jsx`)
- App routing → Subject detail: routes to (evidence: `learnify-pocket/src/App.jsx`)
- App routing → Study screens: routes to (evidence: `learnify-pocket/src/App.jsx`)
- App routing → Auth state: uses (evidence: `learnify-pocket/src/App.jsx`)
- Study data → Subject operations: fetches subjects (evidence: `learnify-pocket/src/context/StudyDataContext.jsx`)
- Study data → Note operations: creates notes (evidence: `learnify-pocket/src/context/StudyDataContext.jsx`)
- Study data → Generation client: requests generation (evidence: `learnify-pocket/src/context/StudyDataContext.jsx`)
- Auth state → Authorized API: uses (evidence: `learnify-pocket/src/context/AuthContext.jsx`)
- Auth state → Firebase: observes auth (evidence: `learnify-pocket/src/context/AuthContext.jsx`)
- Auth client → Firebase: authenticates (evidence: `learnify-pocket/src/services/AuthService.js`)
- Auth client → Auth endpoints: calls endpoints (evidence: `learnify-pocket/src/services/AuthService.js`)
- Auth endpoints → Firebase auth: delegates to (evidence: `Learnify.Api/Controllers/AuthController.cs`)
- Firebase auth → Firebase: uses (evidence: `Learnify.Api/Services/Authentication/FirebaseAuthenticationService.cs`)
- Firebase auth → Token validation: requests OTP
- Subject endpoints → Subject operations: delegates to (evidence: `Learnify.Api/Controllers/SubjectController.cs`)
- Note endpoints → Note operations: delegates to (evidence: `Learnify.Api/Controllers/NotesController.cs`)
- Quiz endpoints → Quiz operations: delegates to (evidence: `Learnify.Api/Controllers/QuizzesController.cs`)
- Flashcard endpoints → Flashcard operations: delegates to
- Quiz operations → Firestore: reads and writes (evidence: `Learnify.Api/Services/Study/QuizService.cs`)
- Tutor and upload → Generation client: requests materials
- Generation client → File generation: uploads file
- File generation → File extraction: extracts content (evidence: `Learnify.Api/Controllers/StudyFileGenerationController.cs`)
- File generation → Study generation: generates materials (evidence: `Learnify.Api/Controllers/StudyFileGenerationController.cs`)
- Study generation → OpenRouter: sends prompt (evidence: `Learnify.Api/Services/AI/OpenRouterStudyService.cs`)
