# nhathuy1603/phuonganh_rental_clothes architecture

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

- Interactive diagram: https://gitdiagram.com/nhathuy1603/phuonganh_rental_clothes
- Repository: https://github.com/nhathuy1603/phuonganh_rental_clothes

## Overview

This is a clothing-rental storefront and operations app, with a separate makeup-services and appointment flow. Customers browse products, check rental availability, build a cart and submit bookings; they can also explore makeup services and request appointments. Admins manage rental bookings, products, categories and makeup operations, with finance and calendar views. The frontend uses seed data as a fallback and calls an API; backend persistence is represented by the server and database modules. Several pages and backend internals were not excerpted, so their detailed links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/App.tsx) (App coordinator), [`src/pages/admin/AdminDashboardPage.tsx`](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminDashboardPage.tsx) (Admin dashboard), [`src/services/catalog-service.ts`](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/catalog-service.ts) (Catalog data service), [`src/services/booking-service.ts`](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/booking-service.ts) (Rental booking logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_catalog_ui["Product catalog<br/>[CatalogPage.tsx]"]
  node_home_ui["Home and reviews<br/>[HomePage.tsx]"]
  node_contact_ui["Contact<br/>[ContactPage.tsx]"]
  node_product_modal["Product details<br/>[ProductModal.tsx]"]
end

subgraph group_rental["Rental operations"]
  node_cart["Cart and checkout<br/>[CartDrawer.tsx]"]
  node_booking_logic["Rental booking logic<br/>[booking-service.ts]"]
  node_admin["Admin dashboard"]
  node_admin_products["Product management"]
  node_admin_bookings["Booking management"]
  node_admin_finance["Finance view"]
  node_admin_calendar["Rental calendar"]
end

subgraph group_makeup["Makeup services"]
  node_makeup_ui["Makeup service pages<br/>[MakeupHubPage.tsx]"]
  node_makeup_detail["Makeup booking"]
  node_admin_makeup["Makeup services admin"]
end

subgraph group_data["Data and server"]
  node_catalog_service["Catalog data service<br/>[catalog-service.ts]"]
  node_seed_data["Seed data<br/>[seed-data.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_server["Backend API<br/>[index.ts]"]
  node_database[("Database access<br/>[db.ts]")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_app
node_app -->|"renders"| node_catalog_ui
node_app -->|"renders"| node_home_ui
node_app -->|"renders"| node_contact_ui
node_app -->|"renders"| node_product_modal
node_app -->|"renders"| node_cart
node_app -->|"renders"| node_admin
node_app -->|"renders"| node_makeup_ui
node_app -->|"renders"| node_makeup_detail
node_app -->|"loads data"| node_catalog_service
node_app -->|"creates bookings"| node_booking_logic
node_cart -->|"checks availability"| node_booking_logic
node_product_modal -->|"checks availability"| node_booking_logic
node_admin -->|"renders"| node_admin_products
node_admin -->|"renders"| node_admin_bookings
node_admin -->|"renders"| node_admin_finance
node_admin -->|"renders"| node_admin_calendar
node_admin -->|"renders"| node_admin_makeup
node_makeup_detail -->|"submits appointment"| node_app
node_admin_makeup -.->|"managed by"| node_admin
node_catalog_service -->|"requests data"| node_api_client
node_catalog_service -->|"falls back to"| node_seed_data
node_server -->|"uses"| node_database
node_api_client -.->|"sends requests"| node_server

click node_app "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/App.tsx"
click node_catalog_ui "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/CatalogPage.tsx"
click node_home_ui "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/HomePage.tsx"
click node_contact_ui "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/ContactPage.tsx"
click node_product_modal "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/components/product/ProductModal.tsx"
click node_cart "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/components/cart/CartDrawer.tsx"
click node_booking_logic "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/booking-service.ts"
click node_admin "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminDashboardPage.tsx"
click node_admin_products "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminProductsPage.tsx"
click node_admin_bookings "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminRentalBookingsPage.tsx"
click node_admin_finance "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminFinancePanel.tsx"
click node_admin_calendar "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminMakeupCalendarPage.tsx"
click node_makeup_ui "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/MakeupHubPage.tsx"
click node_makeup_detail "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/MakeupDetailPage.tsx"
click node_admin_makeup "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminMakeupServicesPage.tsx"
click node_catalog_service "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/catalog-service.ts"
click node_seed_data "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/data/seed-data.ts"
click node_api_client "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/api.ts"
click node_server "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/server/src/index.ts"
click node_database "https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/server/src/db.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_app,node_catalog_ui,node_home_ui,node_contact_ui,node_product_modal toneBlue
class node_cart,node_booking_logic,node_admin,node_admin_products,node_admin_bookings,node_admin_finance,node_admin_calendar toneAmber
class node_makeup_ui,node_makeup_detail,node_admin_makeup toneMint
class node_catalog_service,node_seed_data,node_api_client,node_server,node_database toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [App coordinator](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/App.tsx): `src/App.tsx`
- [Product catalog](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/CatalogPage.tsx): `src/pages/customer/CatalogPage.tsx`
- [Home and reviews](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/HomePage.tsx): `src/pages/customer/HomePage.tsx`
- [Contact](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/ContactPage.tsx): `src/pages/customer/ContactPage.tsx`
- [Product details](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/components/product/ProductModal.tsx): `src/components/product/ProductModal.tsx`

### Rental operations

- [Cart and checkout](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/components/cart/CartDrawer.tsx): `src/components/cart/CartDrawer.tsx`
- [Rental booking logic](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/booking-service.ts): `src/services/booking-service.ts`
- [Admin dashboard](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminDashboardPage.tsx): `src/pages/admin/AdminDashboardPage.tsx`
- [Product management](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminProductsPage.tsx): `src/pages/admin/AdminProductsPage.tsx`
- [Booking management](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminRentalBookingsPage.tsx): `src/pages/admin/AdminRentalBookingsPage.tsx`
- [Finance view](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminFinancePanel.tsx): `src/pages/admin/AdminFinancePanel.tsx`
- [Rental calendar](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminMakeupCalendarPage.tsx): `src/pages/admin/AdminMakeupCalendarPage.tsx`

### Makeup services

- [Makeup service pages](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/MakeupHubPage.tsx): `src/pages/customer/MakeupHubPage.tsx`
- [Makeup booking](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/customer/MakeupDetailPage.tsx): `src/pages/customer/MakeupDetailPage.tsx`
- [Makeup services admin](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/pages/admin/AdminMakeupServicesPage.tsx): `src/pages/admin/AdminMakeupServicesPage.tsx`

### Data and server

- [Catalog data service](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/catalog-service.ts): `src/services/catalog-service.ts`
- [Seed data](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/data/seed-data.ts): `src/data/seed-data.ts`
- [API client](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/src/services/api.ts): `src/services/api.ts`
- [Backend API](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/server/src/index.ts): `server/src/index.ts`
- [Database access](https://github.com/nhathuy1603/phuonganh_rental_clothes/blob/main/server/src/db.ts): `server/src/db.ts`

### Other components

- **Customer**

## Connections

- Customer → App coordinator: uses (evidence: `src/App.tsx`)
- App coordinator → Product catalog: renders (evidence: `src/App.tsx`)
- App coordinator → Home and reviews: renders (evidence: `src/App.tsx`)
- App coordinator → Contact: renders (evidence: `src/App.tsx`)
- App coordinator → Product details: renders (evidence: `src/App.tsx`)
- App coordinator → Cart and checkout: renders (evidence: `src/App.tsx`)
- App coordinator → Admin dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Makeup service pages: renders (evidence: `src/App.tsx`)
- App coordinator → Makeup booking: renders (evidence: `src/App.tsx`)
- App coordinator → Catalog data service: loads data (evidence: `src/App.tsx`)
- App coordinator → Rental booking logic: creates bookings (evidence: `src/App.tsx`)
- Cart and checkout → Rental booking logic: checks availability (evidence: `src/components/cart/CartDrawer.tsx`)
- Product details → Rental booking logic: checks availability (evidence: `src/services/booking-service.ts`)
- Admin dashboard → Product management: renders (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Booking management: renders (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Finance view: renders (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Rental calendar: renders (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Admin dashboard → Makeup services admin: renders (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Makeup booking → App coordinator: submits appointment (evidence: `src/App.tsx`)
- Makeup services admin → Admin dashboard: managed by (evidence: `src/pages/admin/AdminDashboardPage.tsx`)
- Catalog data service → API client: requests data (evidence: `src/services/catalog-service.ts`)
- Catalog data service → Seed data: falls back to (evidence: `src/services/catalog-service.ts`)
- Backend API → Database access: uses (evidence: `server/src/index.ts`)
- API client → Backend API: sends requests
