# rohanislambd/mentor-lagbe architecture

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

- Interactive diagram: https://gitdiagram.com/rohanislambd/mentor-lagbe
- Repository: https://github.com/rohanislambd/mentor-lagbe

## Overview

MentorLagbe is a Bangladesh-focused tuition and mentorship marketplace. Visitors browse and filter listings, inspect a tuition, and students can apply; tutors create listings and review applicants, while admins moderate listings and manage users. Pro subscriptions provide upgraded placement and verified status. The graph includes the documented role workspaces and payment flow; some route and integration links rely on the README because their implementation files were not sampled.

Main entry points: [`src/lib/api/tuitons..ts`](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/api/tuitons..ts) (Tuition API Client), [`src/app/page.tsx`](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/page.tsx) (Home Experience), [`src/lib/auth-client.ts`](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/auth-client.ts) (Auth Client), [`src/lib/auth.ts`](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/auth.ts) (Auth Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Public Discovery"]
  node_home["Home Experience<br/>[page.tsx]"]
  node_home_sections["Home Sections"]
  node_browse["Tuition Directory<br/>[page.tsx]"]
  node_tuition_detail["Tuition Details<br/>[page.tsx]"]
end

subgraph group_identity["Identity and Access"]
  node_sign_up["Registration<br/>[page.tsx]"]
  node_sign_in["Sign In<br/>[page.tsx]"]
  node_auth_client["Auth Client<br/>[auth-client.ts]"]
  node_auth_service["Auth Service<br/>[auth.ts]"]
  node_mongo[("MongoDB")]
  node_role_guard["Role Access Guard<br/>[proxy.ts]"]
end

subgraph group_marketplace["Tuition Marketplace"]
  node_apply["Application Form"]
  node_application_actions["Application Actions<br/>[application.ts]"]
  node_tuition_api["Tuition API Client<br/>[tuitons..ts]"]
end

subgraph group_workspaces["Role Workspaces"]
  node_student_workspace["Student Workspace"]
  node_tutor_workspace["Tutor Workspace"]
  node_admin_workspace["Admin Workspace"]
end

subgraph group_subscriptions["Plans and Payments"]
  node_pricing["Plan Selection<br/>[page.tsx]"]
  node_checkout["Subscription Checkout"]
  node_payment_actions["Payment Actions<br/>[payment.ts]"]
end

node_visitor(("Visitor / Member"))
node_backend["Marketplace Backend"]
node_stripe["Stripe"]

node_visitor -->|"visits"| node_home
node_home -->|"loads listings"| node_tuition_api
node_home -->|"renders"| node_home_sections
node_visitor -->|"searches listings"| node_browse
node_browse -.->|"loads listings"| node_tuition_api
node_visitor -->|"opens listing"| node_tuition_detail
node_tuition_detail -->|"loads detail"| node_tuition_api
node_visitor -->|"registers"| node_sign_up
node_visitor -->|"signs in"| node_sign_in
node_sign_up -->|"uses"| node_auth_client
node_sign_in -->|"uses"| node_auth_client
node_auth_client -->|"connects to"| node_auth_service
node_auth_service -->|"persists identity"| node_mongo
node_visitor -->|"requests workspace"| node_role_guard
node_role_guard -->|"checks session"| node_auth_service
node_visitor -->|"submits application"| node_apply
node_apply -->|"creates application"| node_application_actions
node_application_actions -->|"sends mutation"| node_backend
node_tuition_api -->|"fetches tuition data"| node_backend
node_student_workspace -->|"loads applications"| node_tuition_api
node_tutor_workspace -->|"loads tutor data"| node_tuition_api
node_visitor -->|"tracks applications"| node_student_workspace
node_visitor -->|"posts and reviews"| node_tutor_workspace
node_visitor -->|"moderates platform"| node_admin_workspace
node_visitor -->|"chooses plan"| node_pricing
node_pricing -.->|"starts checkout"| node_checkout
node_checkout -->|"requests checkout"| node_payment_actions
node_payment_actions -->|"sends payment request"| node_backend
node_backend -.->|"creates subscription"| node_stripe

click node_home "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/page.tsx"
click node_home_sections "https://github.com/rohanislambd/mentor-lagbe/tree/main/src/components/home"
click node_browse "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/browse-tuitions/page.tsx"
click node_tuition_detail "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/browse-tuitions/%5Bid%5D/page.tsx"
click node_sign_up "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/(auth)/sign-up/page.tsx"
click node_sign_in "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/(auth)/sign-in/page.tsx"
click node_auth_client "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/auth-client.ts"
click node_auth_service "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/auth.ts"
click node_role_guard "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/proxy.ts"
click node_apply "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/components/tuitions/ApplyTuitionModal.tsx"
click node_application_actions "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/actions%20api/application.ts"
click node_tuition_api "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/api/tuitons..ts"
click node_student_workspace "https://github.com/rohanislambd/mentor-lagbe/tree/main/src/app/dashboard/student"
click node_tutor_workspace "https://github.com/rohanislambd/mentor-lagbe/tree/main/src/app/dashboard/tutor"
click node_admin_workspace "https://github.com/rohanislambd/mentor-lagbe/tree/main/src/app/dashboard/admin"
click node_pricing "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/pricing/page.tsx"
click node_checkout "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/components/payment/PaymentCheckout.tsx"
click node_payment_actions "https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/actions%20api/payment.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_home,node_home_sections,node_browse,node_tuition_detail toneBlue
class node_sign_up,node_sign_in,node_auth_client,node_auth_service,node_mongo,node_role_guard toneAmber
class node_apply,node_application_actions,node_tuition_api toneMint
class node_student_workspace,node_tutor_workspace,node_admin_workspace toneRose
class node_pricing,node_checkout,node_payment_actions,node_visitor,node_backend,node_stripe toneIndigo
```

## Components

### Public Discovery

- [Home Experience](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Home Sections](https://github.com/rohanislambd/mentor-lagbe/tree/main/src/components/home): `src/components/home`
- [Tuition Directory](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/browse-tuitions/page.tsx): `src/app/browse-tuitions/page.tsx`
- [Tuition Details](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/browse-tuitions/%5Bid%5D/page.tsx): `src/app/browse-tuitions/[id]/page.tsx`

### Identity and Access

- [Registration](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/(auth)/sign-up/page.tsx): `src/app/(auth)/sign-up/page.tsx`
- [Sign In](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/(auth)/sign-in/page.tsx): `src/app/(auth)/sign-in/page.tsx`
- [Auth Client](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`
- [Auth Service](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- **MongoDB**
- [Role Access Guard](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/proxy.ts): `src/proxy.ts`

### Tuition Marketplace

- [Application Form](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/components/tuitions/ApplyTuitionModal.tsx): `src/components/tuitions/ApplyTuitionModal.tsx`
- [Application Actions](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/actions%20api/application.ts): `src/lib/actions api/application.ts`
- [Tuition API Client](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/api/tuitons..ts): `src/lib/api/tuitons..ts`

### Role Workspaces

- [Student Workspace](https://github.com/rohanislambd/mentor-lagbe/tree/main/src/app/dashboard/student): `src/app/dashboard/student`
- [Tutor Workspace](https://github.com/rohanislambd/mentor-lagbe/tree/main/src/app/dashboard/tutor): `src/app/dashboard/tutor`
- [Admin Workspace](https://github.com/rohanislambd/mentor-lagbe/tree/main/src/app/dashboard/admin): `src/app/dashboard/admin`

### Plans and Payments

- [Plan Selection](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/app/pricing/page.tsx): `src/app/pricing/page.tsx`
- [Subscription Checkout](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/components/payment/PaymentCheckout.tsx): `src/components/payment/PaymentCheckout.tsx`
- [Payment Actions](https://github.com/rohanislambd/mentor-lagbe/blob/main/src/lib/actions%20api/payment.ts): `src/lib/actions api/payment.ts`

### Other components

- **Visitor / Member**
- **Marketplace Backend**
- **Stripe**

## Connections

- Visitor / Member → Home Experience: visits (evidence: `README.md`)
- Home Experience → Tuition API Client: loads listings (evidence: `src/app/page.tsx`)
- Home Experience → Home Sections: renders (evidence: `src/app/page.tsx`)
- Visitor / Member → Tuition Directory: searches listings (evidence: `README.md`)
- Tuition Directory → Tuition API Client: loads listings
- Visitor / Member → Tuition Details: opens listing (evidence: `README.md`)
- Tuition Details → Tuition API Client: loads detail (evidence: `src/app/browse-tuitions/[id]/page.tsx`)
- Visitor / Member → Registration: registers (evidence: `README.md`)
- Visitor / Member → Sign In: signs in (evidence: `README.md`)
- Registration → Auth Client: uses (evidence: `src/app/(auth)/sign-up/page.tsx`)
- Sign In → Auth Client: uses (evidence: `src/app/(auth)/sign-in/page.tsx`)
- Auth Client → Auth Service: connects to (evidence: `src/lib/auth-client.ts`)
- Auth Service → MongoDB: persists identity (evidence: `src/lib/auth.ts`)
- Visitor / Member → Role Access Guard: requests workspace (evidence: `README.md`)
- Role Access Guard → Auth Service: checks session (evidence: `src/proxy.ts`)
- Visitor / Member → Application Form: submits application (evidence: `README.md`)
- Application Form → Application Actions: creates application (evidence: `src/components/tuitions/ApplyTuitionModal.tsx`)
- Application Actions → Marketplace Backend: sends mutation (evidence: `src/lib/actions api/application.ts`)
- Tuition API Client → Marketplace Backend: fetches tuition data (evidence: `src/lib/api/tuitons..ts`)
- Student Workspace → Tuition API Client: loads applications (evidence: `src/app/dashboard/student/page.tsx`)
- Tutor Workspace → Tuition API Client: loads tutor data (evidence: `src/app/dashboard/tutor/page.tsx`)
- Visitor / Member → Student Workspace: tracks applications (evidence: `README.md`)
- Visitor / Member → Tutor Workspace: posts and reviews (evidence: `README.md`)
- Visitor / Member → Admin Workspace: moderates platform (evidence: `README.md`)
- Visitor / Member → Plan Selection: chooses plan (evidence: `README.md`)
- Plan Selection → Subscription Checkout: starts checkout
- Subscription Checkout → Payment Actions: requests checkout (evidence: `src/components/payment/PaymentCheckout.tsx`)
- Payment Actions → Marketplace Backend: sends payment request (evidence: `src/lib/actions api/payment.ts`)
- Marketplace Backend → Stripe: creates subscription (evidence: `README.md`)
