# hiptran24/synaplearn-summary architecture

> Architecture diagram of the GitHub repository hiptran24/synaplearn-summary, 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/hiptran24/synaplearn-summary
- Repository: https://github.com/hiptran24/synaplearn-summary

## Overview

SynapLearn turns uploaded, pasted, or linked study material into AI summaries and quizzes, then records attempts for progress views. The map also includes authentication, premium payments, notifications, and administration because these are major documented product areas. The README documents capabilities and provider routing; source excerpts/index additionally substantiate several service-to-service and persistence links. Some controllers and integrations were not sampled, so their detailed internal calls are omitted.

Main entry points: [`Models/Entities/AppDbContext.cs`](https://github.com/hiptran24/synaplearn-summary/blob/main/Models/Entities/AppDbContext.cs) (Application database), [`Services/Content/SummaryProcessingService.cs`](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Content/SummaryProcessingService.cs) (Content processing), [`Services/Quiz/QuizGenerationService.cs`](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Quiz/QuizGenerationService.cs) (Quiz generation), [`Services/Auth/AuthService.cs`](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Auth/AuthService.cs) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning workflow"]
  node_summary_api["Summary API"]
  node_content_processor["Content processing"]
  node_safety["Safety review"]
  node_ai_summary["AI summary"]
  node_ai_providers{{"AI providers"}}
  node_content_api["Content API"]
  node_quiz_api["Quiz API<br/>[QuizController.cs]"]
  node_quiz_generation["Quiz generation"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_auth_service["Authentication service<br/>[AuthService.cs]"]
  node_otp["Email OTP<br/>[EmailOtpService.cs]"]
  node_email["SMTP email<br/>[SmtpEmailSender.cs]"]
end

subgraph group_engagement["Progress and communication"]
  node_dashboard["Dashboard analytics"]
  node_profile["Profile and notifications"]
  node_notification_service["Notification service"]
end

subgraph group_operations["Operations and commerce"]
  node_admin["Admin portal API<br/>[AdminController.cs]"]
  node_payments["Payment checkout"]
  node_premium["Premium subscription"]
end

subgraph group_persistence["Persistence"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
  node_mysql[("MySQL")]
end

node_learner(("Learner"))
node_browser["Web interface<br/>[upload.js]"]

node_learner -->|"uses"| node_browser
node_browser -.->|"submits content"| node_summary_api
node_summary_api -->|"processes input"| node_content_processor
node_content_processor -->|"reviews safety"| node_safety
node_content_processor -->|"requests summary"| node_ai_summary
node_ai_summary -.->|"routes AI"| node_ai_providers
node_content_processor -->|"stores results"| node_database
node_learner -.->|"requests quiz"| node_quiz_api
node_quiz_api -.->|"generates or submits"| node_quiz_generation
node_quiz_generation -->|"generates questions"| node_ai_summary
node_quiz_generation -->|"reads and records"| node_database
node_learner -.->|"browses content"| node_content_api
node_content_api -.->|"reads content"| node_database
node_learner -.->|"authenticates"| node_auth_api
node_auth_api -.->|"delegates auth"| node_auth_service
node_auth_service -->|"reads and writes users"| node_database
node_auth_service -->|"verifies email"| node_otp
node_otp -->|"sends codes"| node_email
node_learner -.->|"views progress"| node_dashboard
node_dashboard -->|"queries activity"| node_database
node_learner -.->|"manages profile"| node_profile
node_profile -.->|"manages notices"| node_notification_service
node_notification_service -->|"reads and writes"| node_database
node_notification_service -.->|"sends email"| node_email
node_admin -->|"manages operations"| node_database
node_learner -.->|"buys premium"| node_payments
node_payments -->|"updates subscription"| node_premium
node_payments -->|"records transactions"| node_database
node_database -.->|"persists data"| node_mysql

click node_browser "https://github.com/hiptran24/synaplearn-summary/blob/main/wwwroot/js/upload.js"
click node_summary_api "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/SummaryController.cs"
click node_content_processor "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Content/SummaryProcessingService.cs"
click node_safety "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Content/KeywordContentSafetyService.cs"
click node_ai_summary "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/AI/OllamaSummaryService.cs"
click node_content_api "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/ContentsController.cs"
click node_quiz_api "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/QuizController.cs"
click node_quiz_generation "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Quiz/QuizGenerationService.cs"
click node_dashboard "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/DashboardController.cs"
click node_profile "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/ProfileController.cs"
click node_notification_service "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Notifications/SystemNotificationService.cs"
click node_auth_api "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/AuthController.cs"
click node_auth_service "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Auth/AuthService.cs"
click node_otp "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Otp/EmailOtpService.cs"
click node_email "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Email/SmtpEmailSender.cs"
click node_admin "https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/AdminController.cs"
click node_payments "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Payments/PayOSPaymentService.cs"
click node_premium "https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Payments/PremiumSubscriptionService.cs"
click node_database "https://github.com/hiptran24/synaplearn-summary/blob/main/Models/Entities/AppDbContext.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_summary_api,node_content_processor,node_safety,node_ai_summary,node_ai_providers,node_content_api,node_quiz_api,node_quiz_generation toneBlue
class node_auth_api,node_auth_service,node_otp,node_email toneAmber
class node_dashboard,node_profile,node_notification_service toneMint
class node_admin,node_payments,node_premium toneRose
class node_database,node_mysql,node_learner toneIndigo
class node_browser toneTeal
```

## Components

### Learning workflow

- [Summary API](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/SummaryController.cs): `Controllers/SummaryController.cs`
- [Content processing](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Content/SummaryProcessingService.cs): `Services/Content/SummaryProcessingService.cs`
- [Safety review](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Content/KeywordContentSafetyService.cs): `Services/Content/KeywordContentSafetyService.cs`
- [AI summary](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/AI/OllamaSummaryService.cs): `Services/AI/OllamaSummaryService.cs`
- **AI providers**
- [Content API](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/ContentsController.cs): `Controllers/ContentsController.cs`
- [Quiz API](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/QuizController.cs): `Controllers/QuizController.cs`
- [Quiz generation](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Quiz/QuizGenerationService.cs): `Services/Quiz/QuizGenerationService.cs`

### Identity and access

- [Authentication API](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`
- [Authentication service](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Auth/AuthService.cs): `Services/Auth/AuthService.cs`
- [Email OTP](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Otp/EmailOtpService.cs): `Services/Otp/EmailOtpService.cs`
- [SMTP email](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Email/SmtpEmailSender.cs): `Services/Email/SmtpEmailSender.cs`

### Progress and communication

- [Dashboard analytics](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/DashboardController.cs): `Controllers/DashboardController.cs`
- [Profile and notifications](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/ProfileController.cs): `Controllers/ProfileController.cs`
- [Notification service](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Notifications/SystemNotificationService.cs): `Services/Notifications/SystemNotificationService.cs`

### Operations and commerce

- [Admin portal API](https://github.com/hiptran24/synaplearn-summary/blob/main/Controllers/AdminController.cs): `Controllers/AdminController.cs`
- [Payment checkout](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Payments/PayOSPaymentService.cs): `Services/Payments/PayOSPaymentService.cs`
- [Premium subscription](https://github.com/hiptran24/synaplearn-summary/blob/main/Services/Payments/PremiumSubscriptionService.cs): `Services/Payments/PremiumSubscriptionService.cs`

### Persistence

- [Application database](https://github.com/hiptran24/synaplearn-summary/blob/main/Models/Entities/AppDbContext.cs): `Models/Entities/AppDbContext.cs`
- **MySQL**

### Other components

- **Learner**
- [Web interface](https://github.com/hiptran24/synaplearn-summary/blob/main/wwwroot/js/upload.js): `wwwroot/js/upload.js`

## Connections

- Learner → Web interface: uses
- Web interface → Summary API: submits content
- Summary API → Content processing: processes input
- Content processing → Safety review: reviews safety (evidence: `Services/Content/SummaryProcessingService.cs`)
- Content processing → AI summary: requests summary (evidence: `Services/Content/SummaryProcessingService.cs`)
- AI summary → AI providers: routes AI
- Content processing → Application database: stores results (evidence: `Services/Content/SummaryProcessingService.cs`)
- Learner → Quiz API: requests quiz
- Quiz API → Quiz generation: generates or submits
- Quiz generation → AI summary: generates questions (evidence: `Services/Quiz/QuizGenerationService.cs`)
- Quiz generation → Application database: reads and records (evidence: `Services/Quiz/QuizGenerationService.cs`)
- Learner → Content API: browses content
- Content API → Application database: reads content
- Learner → Authentication API: authenticates
- Authentication API → Authentication service: delegates auth
- Authentication service → Application database: reads and writes users (evidence: `Services/Auth/AuthService.cs`)
- Authentication service → Email OTP: verifies email (evidence: `Services/Auth/AuthService.cs`)
- Email OTP → SMTP email: sends codes (evidence: `Services/Otp/EmailOtpService.cs`)
- Learner → Dashboard analytics: views progress
- Dashboard analytics → Application database: queries activity (evidence: `Controllers/DashboardController.cs`)
- Learner → Profile and notifications: manages profile
- Profile and notifications → Notification service: manages notices
- Notification service → Application database: reads and writes (evidence: `Services/Notifications/SystemNotificationService.cs`)
- Notification service → SMTP email: sends email (evidence: `Services/Notifications/SystemNotificationService.cs`)
- Admin portal API → Application database: manages operations (evidence: `Controllers/AdminController.cs`)
- Learner → Payment checkout: buys premium
- Payment checkout → Premium subscription: updates subscription (evidence: `Services/Payments/PayOSPaymentService.cs`)
- Payment checkout → Application database: records transactions (evidence: `Services/Payments/PayOSPaymentService.cs`)
- Application database → MySQL: persists data
