# quangpham10212004/do_an_2026 architecture

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

- Interactive diagram: https://gitdiagram.com/quangpham10212004/do_an_2026
- Repository: https://github.com/quangpham10212004/do_an_2026

## Overview

MentorHub is a microservices learning and mentor–mentee platform. A mentee enters through the Next.js app, authenticates, builds a profile, discovers ranked mentors, then can book mentoring, pay, and continue learning through courses and roadmaps. Mentors also complete AI interview verification; CV parsing and goal-enrichment help refine mentee profiles. The README documents service boundaries and the browser-to-API proxy; sampled source confirms selected service calls and AI fallbacks, but not every cross-service route, so uncertain links are omitted.

Main entry points: [`frontend/src/app`](https://github.com/quangpham10212004/do_an_2026/tree/main/frontend/src/app) (Next.js app), [`frontend/src/app/api/[service]/[...path]/route.js`](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/app/api/%5Bservice%5D/%5B...path%5D/route.js) (API proxy), [`payment-service/src/main/java/com/mmp/payment/service/PaymentService.java`](https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/service/PaymentService.java) (Payment service), [`mentoring-service/src/main/java/com/mmp/mentoring/service/SessionService.java`](https://github.com/quangpham10212004/do_an_2026/blob/main/mentoring-service/src/main/java/com/mmp/mentoring/service/SessionService.java) (Mentoring service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Next.js app"]
  node_proxy["API proxy<br/>[route.js]"]
  node_auth_ui["Auth client<br/>[api.js]"]
  node_profile_ui["Profile client<br/>[api.js]"]
  node_matching_ui["Matching client<br/>[api.js]"]
  node_ai_ui["AI client<br/>[api.js]"]
  node_learning_ui["Learning client<br/>[api.js]"]
  node_mentoring_ui["Mentoring client<br/>[api.js]"]
  node_payment_ui["Payment client<br/>[api.js]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Auth service"]
  node_auth_data[("Auth repositories")]
  node_profile["Profile service"]
  node_profile_data[("Profile data<br/>[MenteeProfile.java]")]
end

subgraph group_discovery["AI discovery"]
  node_embedding["Embedding refresh"]
  node_matching["Matching pipeline"]
  node_matching_routes["Matching API<br/>[matching.py]"]
end

subgraph group_mentoring["Mentoring and payment"]
  node_mentoring["Mentoring service"]
  node_mentoring_data[("Session data")]
  node_payment["Payment service"]
  node_payment_data[("Transaction data<br/>[Transaction.java]")]
  node_gateway["Sandbox gateway"]
  node_referrals["Referral service"]
end

subgraph group_learning_ai["Learning and AI"]
  node_mentor_verify["AI interview<br/>[engine.py]"]
  node_cv_enrich["CV and enrichment<br/>[engine.py]"]
  node_cv_storage[("CV file storage<br/>[storage.py]")]
  node_learning["Learning service"]
  node_learning_data[("Course progress data")]
end

node_browser(("Browser user"))
node_deepseek["DeepSeek API"]
node_postgres[("PostgreSQL and pgvector")]

node_browser -->|"uses"| node_frontend
node_frontend -->|"requests API"| node_proxy
node_frontend -->|"calls"| node_auth_ui
node_frontend -->|"calls"| node_profile_ui
node_frontend -->|"calls"| node_matching_ui
node_frontend -->|"calls"| node_ai_ui
node_frontend -->|"calls"| node_learning_ui
node_frontend -->|"calls"| node_mentoring_ui
node_frontend -->|"calls"| node_payment_ui
node_proxy -->|"forwards requests"| node_auth
node_proxy -->|"forwards requests"| node_profile
node_proxy -->|"forwards requests"| node_matching_routes
node_proxy -->|"forwards requests"| node_mentor_verify
node_proxy -->|"forwards requests"| node_cv_enrich
node_proxy -->|"forwards requests"| node_learning
node_proxy -->|"forwards requests"| node_mentoring
node_proxy -->|"forwards requests"| node_payment
node_auth -->|"reads and writes"| node_auth_data
node_auth -.->|"registers referral"| node_referrals
node_profile -->|"reads and writes"| node_profile_data
node_profile -->|"refreshes vector"| node_embedding
node_embedding -->|"requests embedding"| node_matching
node_embedding -->|"stores vector"| node_profile_data
node_matching_routes -->|"runs ranking"| node_matching
node_matching -->|"retrieves profile vectors"| node_postgres
node_cv_enrich -->|"stores CV"| node_cv_storage
node_cv_enrich -.->|"parses or enriches"| node_deepseek
node_mentor_verify -.->|"interviews"| node_deepseek
node_learning -->|"reads and writes"| node_learning_data
node_mentoring -->|"reads and writes"| node_mentoring_data
node_mentoring -->|"requests refund"| node_payment
node_payment -->|"loads session"| node_mentoring
node_payment -->|"reads and writes"| node_payment_data
node_payment -->|"charges or refunds"| node_gateway
node_payment -->|"uses referral rules"| node_referrals

click node_frontend "https://github.com/quangpham10212004/do_an_2026/tree/main/frontend/src/app"
click node_proxy "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/app/api/%5Bservice%5D/%5B...path%5D/route.js"
click node_auth_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/auth/api.js"
click node_profile_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/profile/api.js"
click node_matching_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/matching/api.js"
click node_ai_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/ai/api.js"
click node_learning_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/learning/api.js"
click node_mentoring_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/mentoring/api.js"
click node_payment_ui "https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/payment/api.js"
click node_auth "https://github.com/quangpham10212004/do_an_2026/blob/main/auth-service/src/main/java/com/mmp/auth/controller/AuthController.java"
click node_auth_data "https://github.com/quangpham10212004/do_an_2026/blob/main/auth-service/src/main/java/com/mmp/auth/repository/UserRepository.java"
click node_profile "https://github.com/quangpham10212004/do_an_2026/blob/main/profile-service/src/main/java/com/mmp/profile/controller/ProfileController.java"
click node_profile_data "https://github.com/quangpham10212004/do_an_2026/blob/main/profile-service/src/main/java/com/mmp/profile/entity/MenteeProfile.java"
click node_embedding "https://github.com/quangpham10212004/do_an_2026/blob/main/profile-service/src/main/java/com/mmp/profile/service/EmbeddingService.java"
click node_matching "https://github.com/quangpham10212004/do_an_2026/blob/main/matching-service/app/services/matching_pipeline.py"
click node_matching_routes "https://github.com/quangpham10212004/do_an_2026/blob/main/matching-service/app/routers/matching.py"
click node_mentor_verify "https://github.com/quangpham10212004/do_an_2026/blob/main/ai-service/app/interview/engine.py"
click node_cv_enrich "https://github.com/quangpham10212004/do_an_2026/blob/main/ai-service/app/cv/engine.py"
click node_cv_storage "https://github.com/quangpham10212004/do_an_2026/blob/main/ai-service/app/storage.py"
click node_learning "https://github.com/quangpham10212004/do_an_2026/blob/main/learning-service/src/main/java/com/mmp/learning/service/LearningService.java"
click node_learning_data "https://github.com/quangpham10212004/do_an_2026/blob/main/learning-service/src/main/java/com/mmp/learning/entity/CourseProgress.java"
click node_mentoring "https://github.com/quangpham10212004/do_an_2026/blob/main/mentoring-service/src/main/java/com/mmp/mentoring/service/SessionService.java"
click node_mentoring_data "https://github.com/quangpham10212004/do_an_2026/blob/main/mentoring-service/src/main/java/com/mmp/mentoring/entity/MentoringSession.java"
click node_payment "https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/service/PaymentService.java"
click node_payment_data "https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/entity/Transaction.java"
click node_gateway "https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/gateway/SandboxPaymentGateway.java"
click node_referrals "https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/service/ReferralService.java"

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_frontend,node_proxy,node_auth_ui,node_profile_ui,node_matching_ui,node_ai_ui,node_learning_ui,node_mentoring_ui,node_payment_ui,node_browser toneBlue
class node_auth,node_auth_data,node_profile,node_profile_data,node_postgres toneAmber
class node_embedding,node_matching,node_matching_routes,node_deepseek toneMint
class node_mentoring,node_mentoring_data,node_payment,node_payment_data,node_gateway,node_referrals toneRose
class node_mentor_verify,node_cv_enrich,node_cv_storage,node_learning,node_learning_data toneIndigo
```

## Components

### User experience

- [Next.js app](https://github.com/quangpham10212004/do_an_2026/tree/main/frontend/src/app): `frontend/src/app`
- [API proxy](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/app/api/%5Bservice%5D/%5B...path%5D/route.js): `frontend/src/app/api/[service]/[...path]/route.js`
- [Auth client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/auth/api.js): `frontend/src/features/auth/api.js`
- [Profile client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/profile/api.js): `frontend/src/features/profile/api.js`
- [Matching client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/matching/api.js): `frontend/src/features/matching/api.js`
- [AI client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/ai/api.js): `frontend/src/features/ai/api.js`
- [Learning client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/learning/api.js): `frontend/src/features/learning/api.js`
- [Mentoring client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/mentoring/api.js): `frontend/src/features/mentoring/api.js`
- [Payment client](https://github.com/quangpham10212004/do_an_2026/blob/main/frontend/src/features/payment/api.js): `frontend/src/features/payment/api.js`

### Identity and profiles

- [Auth service](https://github.com/quangpham10212004/do_an_2026/blob/main/auth-service/src/main/java/com/mmp/auth/controller/AuthController.java): `auth-service/src/main/java/com/mmp/auth/controller/AuthController.java`
- [Auth repositories](https://github.com/quangpham10212004/do_an_2026/blob/main/auth-service/src/main/java/com/mmp/auth/repository/UserRepository.java): `auth-service/src/main/java/com/mmp/auth/repository/UserRepository.java`
- [Profile service](https://github.com/quangpham10212004/do_an_2026/blob/main/profile-service/src/main/java/com/mmp/profile/controller/ProfileController.java): `profile-service/src/main/java/com/mmp/profile/controller/ProfileController.java`
- [Profile data](https://github.com/quangpham10212004/do_an_2026/blob/main/profile-service/src/main/java/com/mmp/profile/entity/MenteeProfile.java): `profile-service/src/main/java/com/mmp/profile/entity/MenteeProfile.java`

### AI discovery

- [Embedding refresh](https://github.com/quangpham10212004/do_an_2026/blob/main/profile-service/src/main/java/com/mmp/profile/service/EmbeddingService.java): `profile-service/src/main/java/com/mmp/profile/service/EmbeddingService.java`
- [Matching pipeline](https://github.com/quangpham10212004/do_an_2026/blob/main/matching-service/app/services/matching_pipeline.py): `matching-service/app/services/matching_pipeline.py`
- [Matching API](https://github.com/quangpham10212004/do_an_2026/blob/main/matching-service/app/routers/matching.py): `matching-service/app/routers/matching.py`

### Mentoring and payment

- [Mentoring service](https://github.com/quangpham10212004/do_an_2026/blob/main/mentoring-service/src/main/java/com/mmp/mentoring/service/SessionService.java): `mentoring-service/src/main/java/com/mmp/mentoring/service/SessionService.java`
- [Session data](https://github.com/quangpham10212004/do_an_2026/blob/main/mentoring-service/src/main/java/com/mmp/mentoring/entity/MentoringSession.java): `mentoring-service/src/main/java/com/mmp/mentoring/entity/MentoringSession.java`
- [Payment service](https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/service/PaymentService.java): `payment-service/src/main/java/com/mmp/payment/service/PaymentService.java`
- [Transaction data](https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/entity/Transaction.java): `payment-service/src/main/java/com/mmp/payment/entity/Transaction.java`
- [Sandbox gateway](https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/gateway/SandboxPaymentGateway.java): `payment-service/src/main/java/com/mmp/payment/gateway/SandboxPaymentGateway.java`
- [Referral service](https://github.com/quangpham10212004/do_an_2026/blob/main/payment-service/src/main/java/com/mmp/payment/service/ReferralService.java): `payment-service/src/main/java/com/mmp/payment/service/ReferralService.java`

### Learning and AI

- [AI interview](https://github.com/quangpham10212004/do_an_2026/blob/main/ai-service/app/interview/engine.py): `ai-service/app/interview/engine.py`
- [CV and enrichment](https://github.com/quangpham10212004/do_an_2026/blob/main/ai-service/app/cv/engine.py): `ai-service/app/cv/engine.py`
- [CV file storage](https://github.com/quangpham10212004/do_an_2026/blob/main/ai-service/app/storage.py): `ai-service/app/storage.py`
- [Learning service](https://github.com/quangpham10212004/do_an_2026/blob/main/learning-service/src/main/java/com/mmp/learning/service/LearningService.java): `learning-service/src/main/java/com/mmp/learning/service/LearningService.java`
- [Course progress data](https://github.com/quangpham10212004/do_an_2026/blob/main/learning-service/src/main/java/com/mmp/learning/entity/CourseProgress.java): `learning-service/src/main/java/com/mmp/learning/entity/CourseProgress.java`

### Other components

- **Browser user**
- **DeepSeek API**
- **PostgreSQL and pgvector**

## Connections

- Browser user → Next.js app: uses
- Next.js app → API proxy: requests API
- Next.js app → Auth client: calls
- Next.js app → Profile client: calls
- Next.js app → Matching client: calls
- Next.js app → AI client: calls
- Next.js app → Learning client: calls
- Next.js app → Mentoring client: calls
- Next.js app → Payment client: calls
- API proxy → Auth service: forwards requests
- API proxy → Profile service: forwards requests
- API proxy → Matching API: forwards requests
- API proxy → AI interview: forwards requests
- API proxy → CV and enrichment: forwards requests
- API proxy → Learning service: forwards requests
- API proxy → Mentoring service: forwards requests
- API proxy → Payment service: forwards requests
- Auth service → Auth repositories: reads and writes
- Auth service → Referral service: registers referral
- Profile service → Profile data: reads and writes
- Profile service → Embedding refresh: refreshes vector
- Embedding refresh → Matching pipeline: requests embedding
- Embedding refresh → Profile data: stores vector
- Matching API → Matching pipeline: runs ranking
- Matching pipeline → PostgreSQL and pgvector: retrieves profile vectors
- CV and enrichment → CV file storage: stores CV
- CV and enrichment → DeepSeek API: parses or enriches
- AI interview → DeepSeek API: interviews
- Learning service → Course progress data: reads and writes
- Mentoring service → Session data: reads and writes
- Mentoring service → Payment service: requests refund
- Payment service → Mentoring service: loads session
- Payment service → Transaction data: reads and writes
- Payment service → Sandbox gateway: charges or refunds
- Payment service → Referral service: uses referral rules
