# ayushraaaj/scaleup architecture

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

- Interactive diagram: https://gitdiagram.com/ayushraaaj/scaleup
- Repository: https://github.com/ayushraaaj/scaleup

## Overview

ScaleUp is a mentorship platform. The documented learner flow is mentor discovery and booking, followed by video consultation, messaging/file sharing, session completion, and review; mentors also manage profiles, availability, posts, and sessions. The graph combines documented capabilities with source-visible routing, review writes, and messaging behavior. Many backend and frontend modules were indexed but not excerpted, so their internal calls are not asserted; their major documented feature areas remain represented.

Main entry points: [`frontend/services/axios.ts`](https://github.com/ayushraaaj/scaleup/blob/main/frontend/services/axios.ts) (HTTP client), [`backend/src/app.ts`](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/app.ts) (Express API), [`backend/src/controllers/review.controller.ts`](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/controllers/review.controller.ts) (Review lifecycle), [`frontend/hooks/message/useMessages.ts`](https://github.com/ayushraaaj/scaleup/blob/main/frontend/hooks/message/useMessages.ts) (Messaging client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learner and mentor experience"]
  node_web["Dashboard experience"]
  node_discovery["Mentor discovery"]
  node_booking_ui["Booking experience"]
  node_mentor_profile_ui["Mentor profile and availability"]
  node_sessions_ui["Session management"]
  node_review_ui["Review interface<br/>[ReviewModal.tsx]"]
  node_community["Posts and feed"]
  node_auth_ui["Sign-in and account<br/>[page.tsx]"]
  node_api_client["HTTP client<br/>[axios.ts]"]
end

subgraph group_api["HTTP API and domain"]
  node_api_app["Express API<br/>[app.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.router.ts]"]
  node_booking_routes["Booking routes<br/>[booking.router.ts]"]
  node_mentor_routes["Mentor routes<br/>[mentor.router.ts]"]
  node_message_routes["Message routes<br/>[message.router.ts]"]
  node_review_routes["Review routes<br/>[review.router.ts]"]
  node_review_logic["Review lifecycle"]
  node_review_store[("Review records<br/>[review.model.ts]")]
  node_booking_store[("Booking records<br/>[booking.model.ts]")]
  node_session_store[("Session records<br/>[session.model.ts]")]
  node_mentor_store[("Mentor records<br/>[mentor.model.ts]")]
end

subgraph group_realtime["Live consultation"]
  node_message_hook["Messaging client<br/>[useMessages.ts]"]
  node_video_ui["Video consultation"]
  node_socket_service["Socket service<br/>[socket.ts]"]
end

subgraph group_async["Background operations"]
  node_worker_process["Worker process<br/>[index.ts]"]
  node_outbox_worker["Outbox processing<br/>[outbox.worker.ts]"]
  node_email_worker["Email delivery<br/>[email.worker.ts]"]
  node_session_job["Session cleanup<br/>[sessionCleanup.ts]"]
end

node_user(("Learner or mentor"))
node_redis[("Redis")]
node_cloudinary[("Cloudinary")]
node_email_provider["Brevo email"]

node_user -.->|"browses mentors"| node_discovery
node_discovery -.->|"requests data"| node_api_client
node_user -.->|"books consultation"| node_booking_ui
node_booking_ui -.->|"submits booking"| node_api_client
node_user -.->|"sets availability"| node_mentor_profile_ui
node_user -.->|"manages session"| node_sessions_ui
node_user -.->|"joins consultation"| node_video_ui
node_user -.->|"exchanges messages"| node_message_hook
node_message_hook -->|"loads and sends"| node_api_client
node_message_hook -->|"emits and receives"| node_socket_service
node_user -.->|"rates mentor"| node_review_ui
node_review_ui -->|"submits review"| node_api_client
node_auth_ui -->|"authenticates"| node_api_client
node_api_client -.->|"sends requests"| node_api_app
node_api_app -->|"mounts routes"| node_auth_routes
node_api_app -->|"mounts routes"| node_mentor_routes
node_api_app -->|"mounts routes"| node_booking_routes
node_api_app -->|"mounts routes"| node_message_routes
node_api_app -->|"mounts routes"| node_review_routes
node_review_routes -->|"dispatches"| node_review_logic
node_review_logic -->|"reads and updates"| node_booking_store
node_review_logic -->|"checks completion"| node_session_store
node_review_logic -->|"creates and edits"| node_review_store
node_review_logic -->|"updates ratings"| node_mentor_store
node_video_ui -.->|"coordinates live session"| node_socket_service
node_worker_process -.->|"runs worker"| node_outbox_worker
node_worker_process -.->|"runs worker"| node_email_worker
node_outbox_worker -.->|"uses messaging"| node_redis
node_email_worker -.->|"sends email"| node_email_provider
node_session_job -.->|"expires sessions"| node_session_store
node_message_hook -.->|"shares files"| node_cloudinary
node_user -.->|"publishes and reads"| node_community
node_web -.->|"uses API"| node_api_client

click node_web "https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard"
click node_discovery "https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/mentors"
click node_booking_ui "https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/my-bookings"
click node_mentor_profile_ui "https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/mentor"
click node_sessions_ui "https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/my-sessions"
click node_review_ui "https://github.com/ayushraaaj/scaleup/blob/main/frontend/components/modals/ReviewModal.tsx"
click node_community "https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/feed"
click node_auth_ui "https://github.com/ayushraaaj/scaleup/blob/main/frontend/app/login/page.tsx"
click node_api_client "https://github.com/ayushraaaj/scaleup/blob/main/frontend/services/axios.ts"
click node_message_hook "https://github.com/ayushraaaj/scaleup/blob/main/frontend/hooks/message/useMessages.ts"
click node_video_ui "https://github.com/ayushraaaj/scaleup/blob/main/frontend/components/video/VideoConsultation.tsx"
click node_api_app "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/auth.router.ts"
click node_booking_routes "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/booking.router.ts"
click node_mentor_routes "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/mentor.router.ts"
click node_message_routes "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/message.router.ts"
click node_review_routes "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/review.router.ts"
click node_review_logic "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/controllers/review.controller.ts"
click node_review_store "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/review.model.ts"
click node_booking_store "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/booking.model.ts"
click node_session_store "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/session.model.ts"
click node_mentor_store "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/mentor.model.ts"
click node_socket_service "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/services/socket.ts"
click node_worker_process "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/workers/index.ts"
click node_outbox_worker "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/workers/outbox.worker.ts"
click node_email_worker "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/workers/email.worker.ts"
click node_session_job "https://github.com/ayushraaaj/scaleup/blob/main/backend/src/jobs/sessionCleanup.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_discovery,node_booking_ui,node_mentor_profile_ui,node_sessions_ui,node_review_ui,node_community,node_auth_ui,node_api_client toneBlue
class node_api_app,node_auth_routes,node_booking_routes,node_mentor_routes,node_message_routes,node_review_routes,node_review_logic,node_review_store,node_booking_store,node_session_store,node_mentor_store,node_redis,node_cloudinary toneAmber
class node_message_hook,node_video_ui,node_socket_service toneMint
class node_worker_process,node_outbox_worker,node_email_worker,node_session_job toneRose
class node_user,node_email_provider toneIndigo
```

## Components

### Learner and mentor experience

- [Dashboard experience](https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard): `frontend/app/dashboard`
- [Mentor discovery](https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/mentors): `frontend/app/dashboard/mentors`
- [Booking experience](https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/my-bookings): `frontend/app/dashboard/my-bookings`
- [Mentor profile and availability](https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/mentor): `frontend/app/dashboard/mentor`
- [Session management](https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/my-sessions): `frontend/app/dashboard/my-sessions`
- [Review interface](https://github.com/ayushraaaj/scaleup/blob/main/frontend/components/modals/ReviewModal.tsx): `frontend/components/modals/ReviewModal.tsx`
- [Posts and feed](https://github.com/ayushraaaj/scaleup/tree/main/frontend/app/dashboard/feed): `frontend/app/dashboard/feed`
- [Sign-in and account](https://github.com/ayushraaaj/scaleup/blob/main/frontend/app/login/page.tsx): `frontend/app/login/page.tsx`
- [HTTP client](https://github.com/ayushraaaj/scaleup/blob/main/frontend/services/axios.ts): `frontend/services/axios.ts`

### HTTP API and domain

- [Express API](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Authentication routes](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/auth.router.ts): `backend/src/routers/auth.router.ts`
- [Booking routes](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/booking.router.ts): `backend/src/routers/booking.router.ts`
- [Mentor routes](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/mentor.router.ts): `backend/src/routers/mentor.router.ts`
- [Message routes](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/message.router.ts): `backend/src/routers/message.router.ts`
- [Review routes](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/routers/review.router.ts): `backend/src/routers/review.router.ts`
- [Review lifecycle](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/controllers/review.controller.ts): `backend/src/controllers/review.controller.ts`
- [Review records](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/review.model.ts): `backend/src/models/review.model.ts`
- [Booking records](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/booking.model.ts): `backend/src/models/booking.model.ts`
- [Session records](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/session.model.ts): `backend/src/models/session.model.ts`
- [Mentor records](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/models/mentor.model.ts): `backend/src/models/mentor.model.ts`

### Live consultation

- [Messaging client](https://github.com/ayushraaaj/scaleup/blob/main/frontend/hooks/message/useMessages.ts): `frontend/hooks/message/useMessages.ts`
- [Video consultation](https://github.com/ayushraaaj/scaleup/blob/main/frontend/components/video/VideoConsultation.tsx): `frontend/components/video/VideoConsultation.tsx`
- [Socket service](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/services/socket.ts): `backend/src/services/socket.ts`

### Background operations

- [Worker process](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/workers/index.ts): `backend/src/workers/index.ts`
- [Outbox processing](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/workers/outbox.worker.ts): `backend/src/workers/outbox.worker.ts`
- [Email delivery](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/workers/email.worker.ts): `backend/src/workers/email.worker.ts`
- [Session cleanup](https://github.com/ayushraaaj/scaleup/blob/main/backend/src/jobs/sessionCleanup.ts): `backend/src/jobs/sessionCleanup.ts`

### Other components

- **Learner or mentor**
- **Redis**
- **Cloudinary**
- **Brevo email**

## Connections

- Learner or mentor → Mentor discovery: browses mentors (evidence: `README.md`)
- Mentor discovery → HTTP client: requests data (evidence: `README.md`)
- Learner or mentor → Booking experience: books consultation (evidence: `README.md`)
- Booking experience → HTTP client: submits booking (evidence: `README.md`)
- Learner or mentor → Mentor profile and availability: sets availability (evidence: `README.md`)
- Learner or mentor → Session management: manages session (evidence: `README.md`)
- Learner or mentor → Video consultation: joins consultation (evidence: `README.md`)
- Learner or mentor → Messaging client: exchanges messages (evidence: `README.md`)
- Messaging client → HTTP client: loads and sends (evidence: `frontend/hooks/message/useMessages.ts`)
- Messaging client → Socket service: emits and receives (evidence: `frontend/hooks/message/useMessages.ts`)
- Learner or mentor → Review interface: rates mentor (evidence: `README.md`)
- Review interface → HTTP client: submits review (evidence: `frontend/components/modals/ReviewModal.tsx`)
- Sign-in and account → HTTP client: authenticates (evidence: `frontend/app/login/page.tsx`)
- HTTP client → Express API: sends requests (evidence: `README.md`)
- Express API → Authentication routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Mentor routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Booking routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Message routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Review routes: mounts routes (evidence: `backend/src/app.ts`)
- Review routes → Review lifecycle: dispatches (evidence: `backend/src/routers/review.router.ts`)
- Review lifecycle → Booking records: reads and updates (evidence: `backend/src/controllers/review.controller.ts`)
- Review lifecycle → Session records: checks completion (evidence: `backend/src/controllers/review.controller.ts`)
- Review lifecycle → Review records: creates and edits (evidence: `backend/src/controllers/review.controller.ts`)
- Review lifecycle → Mentor records: updates ratings (evidence: `backend/src/controllers/review.controller.ts`)
- Video consultation → Socket service: coordinates live session (evidence: `README.md`)
- Worker process → Outbox processing: runs worker (evidence: `README.md`)
- Worker process → Email delivery: runs worker (evidence: `README.md`)
- Outbox processing → Redis: uses messaging (evidence: `README.md`)
- Email delivery → Brevo email: sends email (evidence: `README.md`)
- Session cleanup → Session records: expires sessions (evidence: `README.md`)
- Messaging client → Cloudinary: shares files (evidence: `README.md`)
- Learner or mentor → Posts and feed: publishes and reads (evidence: `README.md`)
- Dashboard experience → HTTP client: uses API (evidence: `README.md`)
