# laptop-iq/skillhub architecture

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

- Interactive diagram: https://gitdiagram.com/laptop-iq/skillhub
- Repository: https://github.com/laptop-iq/skillhub

## Overview

This repository implements an online course platform with learner-facing course discovery and learning, account verification, bookings and payment confirmation, plus an admin interface for course and booking management. The backend exposes authentication, course, booking, rating and progress routes; controllers and route handlers perform the domain operations and use MongoDB models. The principal runtime path is user or administrator navigation into the respective app, then backend APIs. The README is empty, and UI-to-API wiring is not established by the excerpts, so those links are omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/laptop-iq/skillhub/blob/main/client/src/App.jsx) (Learner app routes), [`admin/src/App.jsx`](https://github.com/laptop-iq/skillhub/blob/main/admin/src/App.jsx) (Admin app routes), [`backend/server.js`](https://github.com/laptop-iq/skillhub/blob/main/backend/server.js) (API server), [`backend/controllers/userController.js`](https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/userController.js) (Account operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learner["Learner experience"]
  node_learner_app["Learner app routes<br/>[App.jsx]"]
  node_course_browsing["Course browsing<br/>[CoursesPage.jsx]"]
  node_course_detail["Course detail"]
  node_home_course_detail["Home course detail"]
  node_about_content["About content<br/>[AboutPage.jsx]"]
  node_my_courses["My courses<br/>[MyCoursesPage.jsx]"]
  node_auth_flows["Account flows"]
  node_payment_verify["Payment confirmation"]
  node_progress_api["Progress API client<br/>[progressApi.js]"]
end

subgraph group_admin["Admin console"]
  node_admin_app["Admin app routes<br/>[App.jsx]"]
  node_admin_dashboard["Dashboard<br/>[DasboardPage.jsx]"]
  node_admin_course_add["Course creation<br/>[AddPage.jsx]"]
  node_admin_course_list["Course listing<br/>[ListPage.jsx]"]
  node_admin_bookings["Booking management<br/>[BookingsPage.jsx]"]
  node_admin_nav["Admin navigation<br/>[Navbar.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["API server<br/>[server.js]"]
  node_auth_routes["Auth and user routes<br/>[authRoute.js]"]
  node_user_controller["Account operations<br/>[userController.js]"]
  node_booking_routes["Booking routes<br/>[bookingRouter.js]"]
  node_booking_controller["Booking and checkout"]
  node_course_routes["Course routes<br/>[courseRouter.js]"]
  node_course_controller["Course operations"]
  node_rating_routes["Rating routes<br/>[ratingRoutes.js]"]
  node_rating_controller["Rating operations"]
  node_progress_routes["Progress handlers<br/>[progressRoutes.js]"]
  node_email_verification["Verification email<br/>[verifyMail.js]"]
end

subgraph group_domain["Domain data"]
  node_booking_model[("Booking records<br/>[bookingModel.js]")]
  node_course_model[("Course catalog<br/>[courseModel.js]")]
  node_user_model[("User accounts<br/>[userModel.js]")]
  node_session_model[("Login sessions<br/>[sessionModel.js]")]
  node_progress_model[("Learning progress<br/>[progressModel.js]")]
  node_rating_model[("Course ratings<br/>[rating.model.js]")]
end

node_learner_actor(("Learner"))
node_admin_actor(("Administrator"))

node_learner_actor -->|"uses"| node_learner_app
node_admin_actor -->|"uses"| node_admin_app
node_learner_app -->|"routes to"| node_course_browsing
node_learner_app -->|"routes to"| node_course_detail
node_learner_app -->|"routes to"| node_home_course_detail
node_learner_app -->|"routes to"| node_my_courses
node_learner_app -->|"routes to"| node_auth_flows
node_learner_app -->|"routes to"| node_payment_verify
node_admin_app -->|"routes to"| node_admin_dashboard
node_admin_app -->|"routes to"| node_admin_course_add
node_admin_app -->|"routes to"| node_admin_course_list
node_admin_app -->|"routes to"| node_admin_bookings
node_admin_course_add -->|"renders"| node_admin_nav
node_admin_course_list -->|"renders"| node_admin_nav
node_admin_bookings -->|"renders"| node_admin_nav
node_admin_dashboard -.->|"routed by"| node_admin_app
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_booking_routes
node_server -->|"mounts"| node_course_routes
node_server -->|"mounts"| node_rating_routes
node_server -->|"mounts"| node_progress_routes
node_auth_routes -->|"dispatches"| node_user_controller
node_booking_routes -->|"dispatches"| node_booking_controller
node_course_routes -->|"dispatches"| node_course_controller
node_rating_routes -->|"dispatches"| node_rating_controller
node_booking_controller -->|"reads and writes"| node_booking_model
node_booking_controller -.->|"uses"| node_course_model
node_booking_controller -->|"redirects via checkout"| node_learner_actor
node_course_controller -->|"reads and writes"| node_course_model
node_user_controller -->|"reads and writes"| node_user_model
node_user_controller -->|"manages"| node_session_model
node_user_controller -->|"sends verification"| node_email_verification
node_rating_controller -->|"reads and writes"| node_rating_model
node_rating_controller -->|"updates statistics"| node_course_model
node_progress_routes -->|"reads and writes"| node_progress_model

click node_learner_app "https://github.com/laptop-iq/skillhub/blob/main/client/src/App.jsx"
click node_course_browsing "https://github.com/laptop-iq/skillhub/blob/main/client/src/components/CoursesPage.jsx"
click node_course_detail "https://github.com/laptop-iq/skillhub/blob/main/client/src/pages/CourseDetailPage.jsx"
click node_home_course_detail "https://github.com/laptop-iq/skillhub/blob/main/client/src/pages/CourseDetailPageHome.jsx"
click node_about_content "https://github.com/laptop-iq/skillhub/blob/main/client/src/components/AboutPage.jsx"
click node_my_courses "https://github.com/laptop-iq/skillhub/blob/main/client/src/components/MyCoursesPage.jsx"
click node_auth_flows "https://github.com/laptop-iq/skillhub/tree/main/client/src/features/auth"
click node_payment_verify "https://github.com/laptop-iq/skillhub/blob/main/client/VerifyPaymentPage.jsx"
click node_progress_api "https://github.com/laptop-iq/skillhub/blob/main/client/src/features/api/progressApi.js"
click node_admin_app "https://github.com/laptop-iq/skillhub/blob/main/admin/src/App.jsx"
click node_admin_dashboard "https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/DasboardPage.jsx"
click node_admin_course_add "https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/AddPage.jsx"
click node_admin_course_list "https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/ListPage.jsx"
click node_admin_bookings "https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/BookingsPage.jsx"
click node_admin_nav "https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/Navbar.jsx"
click node_server "https://github.com/laptop-iq/skillhub/blob/main/backend/server.js"
click node_auth_routes "https://github.com/laptop-iq/skillhub/blob/main/backend/routes/authRoute.js"
click node_user_controller "https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/userController.js"
click node_booking_routes "https://github.com/laptop-iq/skillhub/blob/main/backend/routes/bookingRouter.js"
click node_booking_controller "https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/bookingController.js"
click node_course_routes "https://github.com/laptop-iq/skillhub/blob/main/backend/routes/courseRouter.js"
click node_course_controller "https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/courseController.js"
click node_rating_routes "https://github.com/laptop-iq/skillhub/blob/main/backend/routes/ratingRoutes.js"
click node_rating_controller "https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/rating.controller.js"
click node_progress_routes "https://github.com/laptop-iq/skillhub/blob/main/backend/routes/progressRoutes.js"
click node_booking_model "https://github.com/laptop-iq/skillhub/blob/main/backend/models/bookingModel.js"
click node_course_model "https://github.com/laptop-iq/skillhub/blob/main/backend/models/courseModel.js"
click node_user_model "https://github.com/laptop-iq/skillhub/blob/main/backend/models/userModel.js"
click node_session_model "https://github.com/laptop-iq/skillhub/blob/main/backend/models/sessionModel.js"
click node_progress_model "https://github.com/laptop-iq/skillhub/blob/main/backend/models/progressModel.js"
click node_rating_model "https://github.com/laptop-iq/skillhub/blob/main/backend/models/rating.model.js"
click node_email_verification "https://github.com/laptop-iq/skillhub/blob/main/backend/emailVerify/verifyMail.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_learner_app,node_course_browsing,node_course_detail,node_home_course_detail,node_about_content,node_my_courses,node_auth_flows,node_payment_verify,node_progress_api toneBlue
class node_admin_app,node_admin_dashboard,node_admin_course_add,node_admin_course_list,node_admin_bookings,node_admin_nav toneAmber
class node_server,node_auth_routes,node_user_controller,node_booking_routes,node_booking_controller,node_course_routes,node_course_controller,node_rating_routes,node_rating_controller,node_progress_routes,node_email_verification toneMint
class node_booking_model,node_course_model,node_user_model,node_session_model,node_progress_model,node_rating_model toneRose
class node_learner_actor,node_admin_actor toneIndigo
```

## Components

### Learner experience

- [Learner app routes](https://github.com/laptop-iq/skillhub/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Course browsing](https://github.com/laptop-iq/skillhub/blob/main/client/src/components/CoursesPage.jsx): `client/src/components/CoursesPage.jsx`
- [Course detail](https://github.com/laptop-iq/skillhub/blob/main/client/src/pages/CourseDetailPage.jsx): `client/src/pages/CourseDetailPage.jsx`
- [Home course detail](https://github.com/laptop-iq/skillhub/blob/main/client/src/pages/CourseDetailPageHome.jsx): `client/src/pages/CourseDetailPageHome.jsx`
- [About content](https://github.com/laptop-iq/skillhub/blob/main/client/src/components/AboutPage.jsx): `client/src/components/AboutPage.jsx`
- [My courses](https://github.com/laptop-iq/skillhub/blob/main/client/src/components/MyCoursesPage.jsx): `client/src/components/MyCoursesPage.jsx`
- [Account flows](https://github.com/laptop-iq/skillhub/tree/main/client/src/features/auth): `client/src/features/auth`
- [Payment confirmation](https://github.com/laptop-iq/skillhub/blob/main/client/VerifyPaymentPage.jsx): `client/VerifyPaymentPage.jsx`
- [Progress API client](https://github.com/laptop-iq/skillhub/blob/main/client/src/features/api/progressApi.js): `client/src/features/api/progressApi.js`

### Admin console

- [Admin app routes](https://github.com/laptop-iq/skillhub/blob/main/admin/src/App.jsx): `admin/src/App.jsx`
- [Dashboard](https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/DasboardPage.jsx): `admin/src/components/DasboardPage.jsx`
- [Course creation](https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/AddPage.jsx): `admin/src/components/AddPage.jsx`
- [Course listing](https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/ListPage.jsx): `admin/src/components/ListPage.jsx`
- [Booking management](https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/BookingsPage.jsx): `admin/src/components/BookingsPage.jsx`
- [Admin navigation](https://github.com/laptop-iq/skillhub/blob/main/admin/src/components/Navbar.jsx): `admin/src/components/Navbar.jsx`

### Backend API

- [API server](https://github.com/laptop-iq/skillhub/blob/main/backend/server.js): `backend/server.js`
- [Auth and user routes](https://github.com/laptop-iq/skillhub/blob/main/backend/routes/authRoute.js): `backend/routes/authRoute.js`
- [Account operations](https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Booking routes](https://github.com/laptop-iq/skillhub/blob/main/backend/routes/bookingRouter.js): `backend/routes/bookingRouter.js`
- [Booking and checkout](https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Course routes](https://github.com/laptop-iq/skillhub/blob/main/backend/routes/courseRouter.js): `backend/routes/courseRouter.js`
- [Course operations](https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/courseController.js): `backend/controllers/courseController.js`
- [Rating routes](https://github.com/laptop-iq/skillhub/blob/main/backend/routes/ratingRoutes.js): `backend/routes/ratingRoutes.js`
- [Rating operations](https://github.com/laptop-iq/skillhub/blob/main/backend/controllers/rating.controller.js): `backend/controllers/rating.controller.js`
- [Progress handlers](https://github.com/laptop-iq/skillhub/blob/main/backend/routes/progressRoutes.js): `backend/routes/progressRoutes.js`
- [Verification email](https://github.com/laptop-iq/skillhub/blob/main/backend/emailVerify/verifyMail.js): `backend/emailVerify/verifyMail.js`

### Domain data

- [Booking records](https://github.com/laptop-iq/skillhub/blob/main/backend/models/bookingModel.js): `backend/models/bookingModel.js`
- [Course catalog](https://github.com/laptop-iq/skillhub/blob/main/backend/models/courseModel.js): `backend/models/courseModel.js`
- [User accounts](https://github.com/laptop-iq/skillhub/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [Login sessions](https://github.com/laptop-iq/skillhub/blob/main/backend/models/sessionModel.js): `backend/models/sessionModel.js`
- [Learning progress](https://github.com/laptop-iq/skillhub/blob/main/backend/models/progressModel.js): `backend/models/progressModel.js`
- [Course ratings](https://github.com/laptop-iq/skillhub/blob/main/backend/models/rating.model.js): `backend/models/rating.model.js`

### Other components

- **Learner**
- **Administrator**

## Connections

- Learner → Learner app routes: uses
- Administrator → Admin app routes: uses
- Learner app routes → Course browsing: routes to (evidence: `client/src/App.jsx`)
- Learner app routes → Course detail: routes to (evidence: `client/src/App.jsx`)
- Learner app routes → Home course detail: routes to (evidence: `client/src/App.jsx`)
- Learner app routes → My courses: routes to (evidence: `client/src/App.jsx`)
- Learner app routes → Account flows: routes to (evidence: `client/src/App.jsx`)
- Learner app routes → Payment confirmation: routes to (evidence: `client/src/App.jsx`)
- Admin app routes → Dashboard: routes to (evidence: `admin/src/App.jsx`)
- Admin app routes → Course creation: routes to (evidence: `admin/src/App.jsx`)
- Admin app routes → Course listing: routes to (evidence: `admin/src/App.jsx`)
- Admin app routes → Booking management: routes to (evidence: `admin/src/App.jsx`)
- Course creation → Admin navigation: renders (evidence: `admin/src/pages/Add.jsx`)
- Course listing → Admin navigation: renders (evidence: `admin/src/pages/List.jsx`)
- Booking management → Admin navigation: renders (evidence: `admin/src/pages/Bookings.jsx`)
- Dashboard → Admin app routes: routed by
- API server → Auth and user routes: mounts (evidence: `backend/server.js`)
- API server → Booking routes: mounts (evidence: `backend/server.js`)
- API server → Course routes: mounts (evidence: `backend/server.js`)
- API server → Rating routes: mounts (evidence: `backend/server.js`)
- API server → Progress handlers: mounts (evidence: `backend/server.js`)
- Auth and user routes → Account operations: dispatches
- Booking routes → Booking and checkout: dispatches (evidence: `backend/routes/bookingRouter.js`)
- Course routes → Course operations: dispatches (evidence: `backend/routes/courseRouter.js`)
- Rating routes → Rating operations: dispatches (evidence: `backend/routes/ratingRoutes.js`)
- Booking and checkout → Booking records: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Booking and checkout → Course catalog: uses
- Booking and checkout → Learner: redirects via checkout (evidence: `backend/controllers/bookingController.js`)
- Course operations → Course catalog: reads and writes (evidence: `backend/controllers/courseController.js`)
- Account operations → User accounts: reads and writes (evidence: `backend/controllers/userController.js`)
- Account operations → Login sessions: manages (evidence: `backend/controllers/userController.js`)
- Account operations → Verification email: sends verification (evidence: `backend/controllers/userController.js`)
- Rating operations → Course ratings: reads and writes (evidence: `backend/controllers/rating.controller.js`)
- Rating operations → Course catalog: updates statistics (evidence: `backend/controllers/rating.controller.js`)
- Progress handlers → Learning progress: reads and writes (evidence: `backend/routes/progressRoutes.js`)
