# dhanik29/code-young-project architecture

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

- Interactive diagram: https://gitdiagram.com/dhanik29/code-young-project
- Repository: https://github.com/dhanik29/code-young-project

## Overview

Codeyoung is a full-stack trial-class appointment booking system. A parent uses the React booking flow to request a locally specified time; the backend validates the request, converts it to UTC, checks mentor availability and daily quotas, assigns a mentor, and persists the booking. The confirmation presents parent- and mentor-local times and a meeting link; a separate dashboard lists bookings. The README also documents mentor profiles, slot availability, health checks, and confirmation emails. Backend service wiring is supported by sampled booking code; some frontend and API links reflect documented capabilities and the visible route structure.

Main entry points: [`frontend/src/App.jsx`](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/App.jsx) (React app), [`backend/src/routes/index.js`](https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/index.js) (Route assembly), [`backend/src/services/booking.service.js`](https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/booking.service.js) (Booking assignment), [`frontend/src/pages/BookingPage.jsx`](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/BookingPage.jsx) (Booking form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Booking frontend"]
  node_app_ui["React app<br/>[App.jsx]"]
  node_home["Home page<br/>[HomePage.jsx]"]
  node_booking_page["Booking form<br/>[BookingPage.jsx]"]
  node_slot_hook["Slot loading<br/>[useSlots.js]"]
  node_slot_picker["Slot picker<br/>[SlotPicker.jsx]"]
  node_success_page["Confirmation page<br/>[SuccessPage.jsx]"]
  node_dashboard["Bookings dashboard"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_api["API surface"]
  node_api_app["Express API<br/>[app.js]"]
  node_route_index["Route assembly<br/>[index.js]"]
  node_booking_routes["Booking routes<br/>[booking.routes.js]"]
  node_slot_routes["Slot routes<br/>[slot.routes.js]"]
  node_mentor_routes["Mentor routes<br/>[mentor.routes.js]"]
  node_health_routes["Health routes<br/>[health.routes.js]"]
  node_booking_controller["Booking controller"]
  node_slot_controller["Slot controller<br/>[slot.controller.js]"]
  node_mentor_controller["Mentor controller"]
  node_health_controller["Health controller"]
end

subgraph group_domain["Booking domain"]
  node_booking_service["Booking assignment<br/>[booking.service.js]"]
  node_slot_service["Slot availability<br/>[slot.service.js]"]
  node_mentor_service["Mentor directory<br/>[mentor.service.js]"]
  node_timezone["Timezone conversion<br/>[timezone.js]"]
  node_meeting["Meeting link<br/>[meetingLink.js]"]
end

subgraph group_state["Persistence and notices"]
  node_db_client["Prisma client<br/>[db.js]"]
  node_database[("Booking database<br/>[db.js]")]
  node_email_service["Confirmation email<br/>[email.service.js]"]
end

node_parent(("Parent"))

node_parent -->|"uses"| node_app_ui
node_app_ui -->|"routes"| node_home
node_app_ui -->|"routes"| node_booking_page
node_app_ui -->|"routes"| node_success_page
node_app_ui -->|"routes"| node_dashboard
node_booking_page -->|"loads slots"| node_slot_hook
node_slot_hook -->|"requests slots"| node_api_client
node_booking_page -->|"selects time"| node_slot_picker
node_booking_page -->|"submits booking"| node_api_client
node_dashboard -->|"fetches bookings"| node_api_client
node_api_client -->|"HTTP requests"| node_api_app
node_api_app -->|"mounts routes"| node_route_index
node_route_index -->|"dispatches"| node_booking_routes
node_route_index -->|"dispatches"| node_slot_routes
node_route_index -->|"dispatches"| node_mentor_routes
node_route_index -->|"dispatches"| node_health_routes
node_booking_routes -->|"invokes"| node_booking_controller
node_slot_routes -->|"invokes"| node_slot_controller
node_mentor_routes -->|"invokes"| node_mentor_controller
node_health_routes -->|"invokes"| node_health_controller
node_booking_controller -->|"calls"| node_booking_service
node_slot_controller -->|"calls"| node_slot_service
node_mentor_controller -->|"calls"| node_mentor_service
node_booking_service -->|"converts times"| node_timezone
node_booking_service -->|"generates link"| node_meeting
node_booking_service -->|"reads and writes"| node_db_client
node_slot_service -->|"checks availability"| node_db_client
node_mentor_service -->|"queries mentors"| node_db_client
node_db_client -->|"persists records"| node_database
node_booking_service -->|"sends confirmations"| node_email_service
node_success_page -->|"shows result"| node_parent
node_dashboard -->|"shows bookings"| node_parent

click node_app_ui "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/HomePage.jsx"
click node_booking_page "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/BookingPage.jsx"
click node_slot_hook "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/hooks/useSlots.js"
click node_slot_picker "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/components/SlotPicker.jsx"
click node_success_page "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/SuccessPage.jsx"
click node_dashboard "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/BookingsListPage.jsx"
click node_api_client "https://github.com/dhanik29/code-young-project/blob/main/frontend/src/services/api.js"
click node_api_app "https://github.com/dhanik29/code-young-project/blob/main/backend/src/app.js"
click node_route_index "https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/index.js"
click node_booking_routes "https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/booking.routes.js"
click node_slot_routes "https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/slot.routes.js"
click node_mentor_routes "https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/mentor.routes.js"
click node_health_routes "https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/health.routes.js"
click node_booking_controller "https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/booking.controller.js"
click node_slot_controller "https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/slot.controller.js"
click node_mentor_controller "https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/mentor.controller.js"
click node_health_controller "https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/health.controller.js"
click node_booking_service "https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/booking.service.js"
click node_slot_service "https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/slot.service.js"
click node_mentor_service "https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/mentor.service.js"
click node_timezone "https://github.com/dhanik29/code-young-project/blob/main/backend/src/utils/timezone.js"
click node_meeting "https://github.com/dhanik29/code-young-project/blob/main/backend/src/utils/meetingLink.js"
click node_db_client "https://github.com/dhanik29/code-young-project/blob/main/backend/src/db.js"
click node_database "https://github.com/dhanik29/code-young-project/blob/main/backend/src/db.js"
click node_email_service "https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/email.service.js"

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_app_ui,node_home,node_booking_page,node_slot_hook,node_slot_picker,node_success_page,node_dashboard,node_api_client toneBlue
class node_api_app,node_route_index,node_booking_routes,node_slot_routes,node_mentor_routes,node_health_routes,node_booking_controller,node_slot_controller,node_mentor_controller,node_health_controller toneAmber
class node_booking_service,node_slot_service,node_mentor_service,node_timezone,node_meeting toneMint
class node_db_client,node_database,node_email_service toneRose
class node_parent toneIndigo
```

## Components

### Booking frontend

- [React app](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home page](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/HomePage.jsx): `frontend/src/pages/HomePage.jsx`
- [Booking form](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/BookingPage.jsx): `frontend/src/pages/BookingPage.jsx`
- [Slot loading](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/hooks/useSlots.js): `frontend/src/hooks/useSlots.js`
- [Slot picker](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/components/SlotPicker.jsx): `frontend/src/components/SlotPicker.jsx`
- [Confirmation page](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/SuccessPage.jsx): `frontend/src/pages/SuccessPage.jsx`
- [Bookings dashboard](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/pages/BookingsListPage.jsx): `frontend/src/pages/BookingsListPage.jsx`
- [HTTP client](https://github.com/dhanik29/code-young-project/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API surface

- [Express API](https://github.com/dhanik29/code-young-project/blob/main/backend/src/app.js): `backend/src/app.js`
- [Route assembly](https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/index.js): `backend/src/routes/index.js`
- [Booking routes](https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/booking.routes.js): `backend/src/routes/booking.routes.js`
- [Slot routes](https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/slot.routes.js): `backend/src/routes/slot.routes.js`
- [Mentor routes](https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/mentor.routes.js): `backend/src/routes/mentor.routes.js`
- [Health routes](https://github.com/dhanik29/code-young-project/blob/main/backend/src/routes/health.routes.js): `backend/src/routes/health.routes.js`
- [Booking controller](https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/booking.controller.js): `backend/src/controllers/booking.controller.js`
- [Slot controller](https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/slot.controller.js): `backend/src/controllers/slot.controller.js`
- [Mentor controller](https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/mentor.controller.js): `backend/src/controllers/mentor.controller.js`
- [Health controller](https://github.com/dhanik29/code-young-project/blob/main/backend/src/controllers/health.controller.js): `backend/src/controllers/health.controller.js`

### Booking domain

- [Booking assignment](https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/booking.service.js): `backend/src/services/booking.service.js`
- [Slot availability](https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/slot.service.js): `backend/src/services/slot.service.js`
- [Mentor directory](https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/mentor.service.js): `backend/src/services/mentor.service.js`
- [Timezone conversion](https://github.com/dhanik29/code-young-project/blob/main/backend/src/utils/timezone.js): `backend/src/utils/timezone.js`
- [Meeting link](https://github.com/dhanik29/code-young-project/blob/main/backend/src/utils/meetingLink.js): `backend/src/utils/meetingLink.js`

### Persistence and notices

- [Prisma client](https://github.com/dhanik29/code-young-project/blob/main/backend/src/db.js): `backend/src/db.js`
- [Booking database](https://github.com/dhanik29/code-young-project/blob/main/backend/src/db.js): `backend/src/db.js`
- [Confirmation email](https://github.com/dhanik29/code-young-project/blob/main/backend/src/services/email.service.js): `backend/src/services/email.service.js`

### Other components

- **Parent**

## Connections

- Parent → React app: uses
- React app → Home page: routes
- React app → Booking form: routes
- React app → Confirmation page: routes
- React app → Bookings dashboard: routes
- Booking form → Slot loading: loads slots
- Slot loading → HTTP client: requests slots
- Booking form → Slot picker: selects time
- Booking form → HTTP client: submits booking
- Bookings dashboard → HTTP client: fetches bookings
- HTTP client → Express API: HTTP requests
- Express API → Route assembly: mounts routes
- Route assembly → Booking routes: dispatches
- Route assembly → Slot routes: dispatches
- Route assembly → Mentor routes: dispatches
- Route assembly → Health routes: dispatches
- Booking routes → Booking controller: invokes
- Slot routes → Slot controller: invokes
- Mentor routes → Mentor controller: invokes
- Health routes → Health controller: invokes
- Booking controller → Booking assignment: calls
- Slot controller → Slot availability: calls
- Mentor controller → Mentor directory: calls
- Booking assignment → Timezone conversion: converts times
- Booking assignment → Meeting link: generates link
- Booking assignment → Prisma client: reads and writes
- Slot availability → Prisma client: checks availability
- Mentor directory → Prisma client: queries mentors
- Prisma client → Booking database: persists records
- Booking assignment → Confirmation email: sends confirmations
- Confirmation page → Parent: shows result
- Bookings dashboard → Parent: shows bookings
