# azther0z/tutor-matcher architecture

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

- Interactive diagram: https://gitdiagram.com/azther0z/tutor-matcher
- Repository: https://github.com/azther0z/tutor-matcher

## Overview

Tutor Matcher is a tutor–student matchmaking platform organized around finding a tutor by subject, schedule, and price, then booking a continuous block of published 30-minute slots and paying from a wallet. The backend also supports profiles, tutor availability, messaging, classroom access, reviews and moderation, payouts, refunds, and administrative workflows. The tree and README establish these capabilities, while the excerpts show backend route registration and selected service calls; frontend-to-backend request wiring is not shown, so that connection is left unverified.

Main entry points: [`apps/backend/src/routes.ts`](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/routes.ts) (API route registry), [`apps/frontend/app/page.tsx`](https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/page.tsx) (Web app), [`apps/backend/src/lib/db.ts`](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/lib/db.ts) (PostgreSQL data), [`apps/backend/src/modules/admin/admin.controller.ts`](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/admin/admin.controller.ts) (Admin operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student and tutor experience"]
  node_web["Web app<br/>[page.tsx]"]
  node_signup["Sign in and signup<br/>[page.tsx]"]
  node_booking_ui["Booking experience<br/>[page.tsx]"]
  node_wallet_ui["Wallet experience<br/>[page.tsx]"]
  node_messaging_ui["Messaging experience<br/>[page.tsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_backend_routes["API route registry<br/>[routes.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.ts]"]
  node_auth_service["Account and reset logic<br/>[auth.service.ts]"]
  node_profile["Profiles and onboarding<br/>[profile.service.ts]"]
  node_email["Password reset delivery<br/>[email.ts]"]
end

subgraph group_learning["Discovery and lessons"]
  node_discovery["Tutor discovery"]
  node_availability["Tutor availability"]
  node_booking["Lesson booking<br/>[booking.service.ts]"]
  node_classroom["Classroom sessions"]
end

subgraph group_money["Wallet and payments"]
  node_wallet["Wallet and top-ups<br/>[wallet.service.ts]"]
  node_payout["Payouts<br/>[payout.service.ts]"]
  node_refund["Refund decisions<br/>[refund.service.ts]"]
  node_database[("PostgreSQL data<br/>[db.ts]")]
end

subgraph group_trust["Safety and administration"]
  node_reviews["Reviews and replies<br/>[review.service.ts]"]
  node_review_moderation["Review moderation"]
  node_admin["Admin operations"]
end

node_member(("Student or tutor"))

node_member -->|"uses"| node_web
node_web -.->|"offers account access"| node_signup
node_web -.->|"starts booking"| node_booking_ui
node_web -.->|"opens wallet"| node_wallet_ui
node_web -.->|"opens messages"| node_messaging_ui
node_web -.->|"calls API"| node_backend_routes
node_backend_routes -->|"mounts"| node_auth_routes
node_backend_routes -.->|"routes discovery"| node_discovery
node_backend_routes -.->|"routes bookings"| node_booking
node_backend_routes -.->|"routes wallet"| node_wallet
node_backend_routes -.->|"routes payouts"| node_payout
node_backend_routes -.->|"routes profiles"| node_profile
node_backend_routes -->|"routes reviews"| node_reviews
node_backend_routes -.->|"routes classroom"| node_classroom
node_backend_routes -.->|"routes messages"| node_messaging_ui
node_auth_routes -->|"dispatches auth"| node_auth_service
node_auth_service -->|"reads and writes"| node_database
node_auth_service -->|"sends reset email"| node_email
node_discovery -->|"queries tutors"| node_database
node_booking -.->|"persists bookings"| node_database
node_availability -.->|"stores schedules"| node_database
node_wallet -.->|"stores balances"| node_database
node_payout -.->|"stores payouts"| node_database
node_refund -.->|"stores refunds"| node_database
node_reviews -.->|"supports moderation"| node_review_moderation
node_backend_routes -->|"mounts admin routes"| node_admin
node_admin -->|"reviews top-ups"| node_wallet
node_admin -->|"reviews refunds"| node_refund
node_admin -->|"moderates flagged reviews"| node_review_moderation

click node_web "https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/page.tsx"
click node_signup "https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/(auth)/signup/page.tsx"
click node_booking_ui "https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/bookings/%5Bid%5D/page.tsx"
click node_wallet_ui "https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/wallet/page.tsx"
click node_messaging_ui "https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/messages/page.tsx"
click node_backend_routes "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/routes.ts"
click node_auth_routes "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/auth/auth.routes.ts"
click node_auth_service "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/auth/auth.service.ts"
click node_profile "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/profile/profile.service.ts"
click node_discovery "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/discovery/discovery-search.service.ts"
click node_availability "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/availability/availability.service.ts"
click node_booking "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/booking/booking.service.ts"
click node_classroom "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/classroom/classroom.service.ts"
click node_reviews "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/review/review.service.ts"
click node_review_moderation "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/review/review-moderation.service.ts"
click node_admin "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/admin/admin.controller.ts"
click node_wallet "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/wallet/wallet.service.ts"
click node_payout "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/payout/payout.service.ts"
click node_refund "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/refund/refund.service.ts"
click node_database "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/lib/db.ts"
click node_email "https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/lib/email.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_web,node_signup,node_booking_ui,node_wallet_ui,node_messaging_ui toneBlue
class node_backend_routes,node_auth_routes,node_auth_service,node_profile,node_email toneAmber
class node_discovery,node_availability,node_booking,node_classroom toneMint
class node_wallet,node_payout,node_refund,node_database toneRose
class node_reviews,node_review_moderation,node_admin,node_member toneIndigo
```

## Components

### Student and tutor experience

- [Web app](https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/page.tsx): `apps/frontend/app/page.tsx`
- [Sign in and signup](https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/(auth)/signup/page.tsx): `apps/frontend/app/(auth)/signup/page.tsx`
- [Booking experience](https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/bookings/%5Bid%5D/page.tsx): `apps/frontend/app/bookings/[id]/page.tsx`
- [Wallet experience](https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/wallet/page.tsx): `apps/frontend/app/wallet/page.tsx`
- [Messaging experience](https://github.com/azther0z/tutor-matcher/blob/main/apps/frontend/app/messages/page.tsx): `apps/frontend/app/messages/page.tsx`

### Identity and profiles

- [API route registry](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/routes.ts): `apps/backend/src/routes.ts`
- [Authentication routes](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/auth/auth.routes.ts): `apps/backend/src/modules/auth/auth.routes.ts`
- [Account and reset logic](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/auth/auth.service.ts): `apps/backend/src/modules/auth/auth.service.ts`
- [Profiles and onboarding](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/profile/profile.service.ts): `apps/backend/src/modules/profile/profile.service.ts`
- [Password reset delivery](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/lib/email.ts): `apps/backend/src/lib/email.ts`

### Discovery and lessons

- [Tutor discovery](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/discovery/discovery-search.service.ts): `apps/backend/src/modules/discovery/discovery-search.service.ts`
- [Tutor availability](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/availability/availability.service.ts): `apps/backend/src/modules/availability/availability.service.ts`
- [Lesson booking](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/booking/booking.service.ts): `apps/backend/src/modules/booking/booking.service.ts`
- [Classroom sessions](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/classroom/classroom.service.ts): `apps/backend/src/modules/classroom/classroom.service.ts`

### Wallet and payments

- [Wallet and top-ups](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/wallet/wallet.service.ts): `apps/backend/src/modules/wallet/wallet.service.ts`
- [Payouts](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/payout/payout.service.ts): `apps/backend/src/modules/payout/payout.service.ts`
- [Refund decisions](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/refund/refund.service.ts): `apps/backend/src/modules/refund/refund.service.ts`
- [PostgreSQL data](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/lib/db.ts): `apps/backend/src/lib/db.ts`

### Safety and administration

- [Reviews and replies](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/review/review.service.ts): `apps/backend/src/modules/review/review.service.ts`
- [Review moderation](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/review/review-moderation.service.ts): `apps/backend/src/modules/review/review-moderation.service.ts`
- [Admin operations](https://github.com/azther0z/tutor-matcher/blob/main/apps/backend/src/modules/admin/admin.controller.ts): `apps/backend/src/modules/admin/admin.controller.ts`

### Other components

- **Student or tutor**

## Connections

- Student or tutor → Web app: uses (evidence: `README.md`)
- Web app → Sign in and signup: offers account access
- Web app → Booking experience: starts booking
- Web app → Wallet experience: opens wallet
- Web app → Messaging experience: opens messages
- Web app → API route registry: calls API
- API route registry → Authentication routes: mounts (evidence: `apps/backend/src/routes.ts`)
- API route registry → Tutor discovery: routes discovery (evidence: `apps/backend/src/routes.ts`)
- API route registry → Lesson booking: routes bookings (evidence: `apps/backend/src/routes.ts`)
- API route registry → Wallet and top-ups: routes wallet (evidence: `apps/backend/src/routes.ts`)
- API route registry → Payouts: routes payouts (evidence: `apps/backend/src/routes.ts`)
- API route registry → Profiles and onboarding: routes profiles (evidence: `apps/backend/src/routes.ts`)
- API route registry → Reviews and replies: routes reviews (evidence: `apps/backend/src/routes.ts`)
- API route registry → Classroom sessions: routes classroom (evidence: `apps/backend/src/routes.ts`)
- API route registry → Messaging experience: routes messages (evidence: `apps/backend/src/routes.ts`)
- Authentication routes → Account and reset logic: dispatches auth (evidence: `apps/backend/src/modules/auth/auth.routes.ts`)
- Account and reset logic → PostgreSQL data: reads and writes (evidence: `apps/backend/src/modules/auth/auth.service.ts`)
- Account and reset logic → Password reset delivery: sends reset email (evidence: `apps/backend/src/modules/auth/auth.service.ts`)
- Tutor discovery → PostgreSQL data: queries tutors (evidence: `apps/backend/src/modules/discovery/discovery-search.service.ts`)
- Lesson booking → PostgreSQL data: persists bookings
- Tutor availability → PostgreSQL data: stores schedules
- Wallet and top-ups → PostgreSQL data: stores balances
- Payouts → PostgreSQL data: stores payouts
- Refund decisions → PostgreSQL data: stores refunds
- Reviews and replies → Review moderation: supports moderation
- API route registry → Admin operations: mounts admin routes (evidence: `apps/backend/src/routes.ts`)
- Admin operations → Wallet and top-ups: reviews top-ups
- Admin operations → Refund decisions: reviews refunds
- Admin operations → Review moderation: moderates flagged reviews
