# firaoll77/360_bladez architecture

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

- Interactive diagram: https://gitdiagram.com/firaoll77/360_bladez
- Repository: https://github.com/firaoll77/360_bladez

## Overview

360_Bladez is a barbershop booking site for Addis Ababa. Customers choose a service, barber, date and slot, submit their details and payment proof, then can look up or cancel a booking; staff authenticate and manage appointments, barbers and schedules. The implementation separates page/UI entry points, server actions, booking and slot logic, and persistence. The README documents upload fallbacks and major features; some wiring—especially the upload request path—is not shown in the sampled source, so those links are marked unverified.

Main entry points: [`src/lib/actions.ts`](https://github.com/firaoll77/360_bladez/blob/main/src/lib/actions.ts) (Server actions), [`src/components/admin-dashboard.tsx`](https://github.com/firaoll77/360_bladez/blob/main/src/components/admin-dashboard.tsx) (Admin dashboard), [`src/app/(site)/book/page.tsx`](https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/book/page.tsx) (Booking page), [`src/components/booking-wizard.tsx`](https://github.com/firaoll77/360_bladez/blob/main/src/components/booking-wizard.tsx) (Booking wizard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site experience"]
  node_home["Landing page<br/>[page.tsx]"]
  node_hero["Hero<br/>[hero.tsx]"]
  node_site_sections["Services and hours<br/>[sections.tsx]"]
  node_site_layout["Site layout<br/>[layout.tsx]"]
  node_site_header["Site header<br/>[site-header.tsx]"]
  node_site_footer["Site footer<br/>[site-footer.tsx]"]
end

subgraph group_booking["Booking and scheduling"]
  node_book_page["Booking page<br/>[page.tsx]"]
  node_wizard["Booking wizard<br/>[booking-wizard.tsx]"]
  node_bookings_page["My Bookings page<br/>[page.tsx]"]
  node_booking_manager["Booking lookup"]
  node_booking_logic["Booking rules<br/>[bookings.ts]"]
  node_slot_logic["Slot calculation<br/>[slots.ts]"]
  node_time["EAT time rules<br/>[time.ts]"]
  node_ethiopian["Ethiopian calendar<br/>[ethiopian.ts]"]
end

subgraph group_operations["Staff operations"]
  node_admin_page["Management page<br/>[page.tsx]"]
  node_admin_login["Staff login<br/>[admin-login.tsx]"]
  node_dashboard["Admin dashboard"]
end

subgraph group_platform["Runtime and persistence"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_upload_api["Proof upload API<br/>[route.ts]"]
  node_db_client["Prisma client<br/>[db.ts]"]
  node_database[("SQLite database<br/>[schema.prisma]")]
end

node_customer(("Customer"))
node_staff(("Staff"))
node_cloudinary["Cloudinary"]
node_local_uploads["Local uploads"]

node_customer -->|"visits"| node_home
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_site_sections
node_site_layout -->|"renders"| node_site_header
node_site_layout -->|"renders"| node_site_footer
node_customer -->|"opens booking"| node_book_page
node_book_page -->|"renders"| node_wizard
node_book_page -->|"loads services and barbers"| node_db_client
node_book_page -->|"gets EAT dates"| node_time
node_wizard -->|"submits booking"| node_actions
node_wizard -->|"fetches schedule and availability"| node_actions
node_wizard -.->|"uploads proof"| node_upload_api
node_upload_api -.->|"stores proof"| node_cloudinary
node_upload_api -.->|"falls back to"| node_local_uploads
node_customer -->|"looks up booking"| node_bookings_page
node_bookings_page -->|"renders"| node_booking_manager
node_booking_manager -->|"looks up or cancels"| node_actions
node_booking_manager -->|"formats date"| node_ethiopian
node_staff -->|"opens management"| node_admin_page
node_admin_page -->|"checks access and fetches data"| node_actions
node_admin_page -->|"renders when unauthenticated"| node_admin_login
node_admin_page -->|"renders management"| node_dashboard
node_admin_login -->|"authenticates staff"| node_actions
node_dashboard -->|"manages appointments and barbers"| node_actions
node_dashboard -->|"loads barber schedule"| node_actions
node_dashboard -->|"formats appointment times"| node_time
node_dashboard -->|"formats calendar dates"| node_ethiopian
node_actions -->|"delegates booking operations"| node_booking_logic
node_actions -->|"reads and updates records"| node_db_client
node_booking_logic -->|"reads and writes appointments"| node_db_client
node_booking_logic -->|"checks slot conflicts"| node_slot_logic
node_booking_logic -->|"validates EAT dates"| node_time
node_slot_logic -->|"uses shop hours"| node_time
node_db_client -->|"persists records"| node_database

click node_home "https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/page.tsx"
click node_hero "https://github.com/firaoll77/360_bladez/blob/main/src/components/hero.tsx"
click node_site_sections "https://github.com/firaoll77/360_bladez/blob/main/src/components/sections.tsx"
click node_site_layout "https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/layout.tsx"
click node_site_header "https://github.com/firaoll77/360_bladez/blob/main/src/components/site-header.tsx"
click node_site_footer "https://github.com/firaoll77/360_bladez/blob/main/src/components/site-footer.tsx"
click node_book_page "https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/book/page.tsx"
click node_wizard "https://github.com/firaoll77/360_bladez/blob/main/src/components/booking-wizard.tsx"
click node_bookings_page "https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/bookings/page.tsx"
click node_booking_manager "https://github.com/firaoll77/360_bladez/blob/main/src/components/bookings-manager.tsx"
click node_actions "https://github.com/firaoll77/360_bladez/blob/main/src/lib/actions.ts"
click node_booking_logic "https://github.com/firaoll77/360_bladez/blob/main/src/lib/bookings.ts"
click node_slot_logic "https://github.com/firaoll77/360_bladez/blob/main/src/lib/slots.ts"
click node_time "https://github.com/firaoll77/360_bladez/blob/main/src/lib/time.ts"
click node_ethiopian "https://github.com/firaoll77/360_bladez/blob/main/src/lib/ethiopian.ts"
click node_upload_api "https://github.com/firaoll77/360_bladez/blob/main/src/app/api/upload/route.ts"
click node_local_uploads "https://github.com/firaoll77/360_bladez/tree/main/public/uploads"
click node_admin_page "https://github.com/firaoll77/360_bladez/blob/main/src/app/b360-mgmt/page.tsx"
click node_admin_login "https://github.com/firaoll77/360_bladez/blob/main/src/components/admin-login.tsx"
click node_dashboard "https://github.com/firaoll77/360_bladez/blob/main/src/components/admin-dashboard.tsx"
click node_db_client "https://github.com/firaoll77/360_bladez/blob/main/src/lib/db.ts"
click node_database "https://github.com/firaoll77/360_bladez/blob/main/prisma/schema.prisma"

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_home,node_hero,node_site_sections,node_site_layout,node_site_header,node_site_footer toneBlue
class node_book_page,node_wizard,node_bookings_page,node_booking_manager,node_booking_logic,node_slot_logic,node_time,node_ethiopian toneAmber
class node_admin_page,node_admin_login,node_dashboard toneMint
class node_actions,node_upload_api,node_db_client,node_database toneRose
class node_customer,node_staff,node_cloudinary toneIndigo
class node_local_uploads toneTeal
```

## Components

### Site experience

- [Landing page](https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/page.tsx): `src/app/(site)/page.tsx`
- [Hero](https://github.com/firaoll77/360_bladez/blob/main/src/components/hero.tsx): `src/components/hero.tsx`
- [Services and hours](https://github.com/firaoll77/360_bladez/blob/main/src/components/sections.tsx): `src/components/sections.tsx`
- [Site layout](https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/layout.tsx): `src/app/(site)/layout.tsx`
- [Site header](https://github.com/firaoll77/360_bladez/blob/main/src/components/site-header.tsx): `src/components/site-header.tsx`
- [Site footer](https://github.com/firaoll77/360_bladez/blob/main/src/components/site-footer.tsx): `src/components/site-footer.tsx`

### Booking and scheduling

- [Booking page](https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/book/page.tsx): `src/app/(site)/book/page.tsx`
- [Booking wizard](https://github.com/firaoll77/360_bladez/blob/main/src/components/booking-wizard.tsx): `src/components/booking-wizard.tsx`
- [My Bookings page](https://github.com/firaoll77/360_bladez/blob/main/src/app/(site)/bookings/page.tsx): `src/app/(site)/bookings/page.tsx`
- [Booking lookup](https://github.com/firaoll77/360_bladez/blob/main/src/components/bookings-manager.tsx): `src/components/bookings-manager.tsx`
- [Booking rules](https://github.com/firaoll77/360_bladez/blob/main/src/lib/bookings.ts): `src/lib/bookings.ts`
- [Slot calculation](https://github.com/firaoll77/360_bladez/blob/main/src/lib/slots.ts): `src/lib/slots.ts`
- [EAT time rules](https://github.com/firaoll77/360_bladez/blob/main/src/lib/time.ts): `src/lib/time.ts`
- [Ethiopian calendar](https://github.com/firaoll77/360_bladez/blob/main/src/lib/ethiopian.ts): `src/lib/ethiopian.ts`

### Staff operations

- [Management page](https://github.com/firaoll77/360_bladez/blob/main/src/app/b360-mgmt/page.tsx): `src/app/b360-mgmt/page.tsx`
- [Staff login](https://github.com/firaoll77/360_bladez/blob/main/src/components/admin-login.tsx): `src/components/admin-login.tsx`
- [Admin dashboard](https://github.com/firaoll77/360_bladez/blob/main/src/components/admin-dashboard.tsx): `src/components/admin-dashboard.tsx`

### Runtime and persistence

- [Server actions](https://github.com/firaoll77/360_bladez/blob/main/src/lib/actions.ts): `src/lib/actions.ts`
- [Proof upload API](https://github.com/firaoll77/360_bladez/blob/main/src/app/api/upload/route.ts): `src/app/api/upload/route.ts`
- [Prisma client](https://github.com/firaoll77/360_bladez/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [SQLite database](https://github.com/firaoll77/360_bladez/blob/main/prisma/schema.prisma): `prisma/schema.prisma`

### Other components

- **Customer**
- **Staff**
- **Cloudinary**
- [Local uploads](https://github.com/firaoll77/360_bladez/tree/main/public/uploads): `public/uploads`

## Connections

- Customer → Landing page: visits (evidence: `README.md`)
- Landing page → Hero: renders (evidence: `src/app/(site)/page.tsx`)
- Landing page → Services and hours: renders (evidence: `src/app/(site)/page.tsx`)
- Site layout → Site header: renders (evidence: `src/app/(site)/layout.tsx`)
- Site layout → Site footer: renders (evidence: `src/app/(site)/layout.tsx`)
- Customer → Booking page: opens booking (evidence: `README.md`)
- Booking page → Booking wizard: renders (evidence: `src/app/(site)/book/page.tsx`)
- Booking page → Prisma client: loads services and barbers (evidence: `src/app/(site)/book/page.tsx`)
- Booking page → EAT time rules: gets EAT dates (evidence: `src/app/(site)/book/page.tsx`)
- Booking wizard → Server actions: submits booking (evidence: `src/components/booking-wizard.tsx`)
- Booking wizard → Server actions: fetches schedule and availability (evidence: `src/components/booking-wizard.tsx`)
- Booking wizard → Proof upload API: uploads proof (evidence: `README.md`)
- Proof upload API → Cloudinary: stores proof (evidence: `README.md`)
- Proof upload API → Local uploads: falls back to (evidence: `README.md`)
- Customer → My Bookings page: looks up booking (evidence: `README.md`)
- My Bookings page → Booking lookup: renders (evidence: `src/app/(site)/bookings/page.tsx`)
- Booking lookup → Server actions: looks up or cancels (evidence: `src/components/bookings-manager.tsx`)
- Booking lookup → Ethiopian calendar: formats date (evidence: `src/components/bookings-manager.tsx`)
- Staff → Management page: opens management (evidence: `README.md`)
- Management page → Server actions: checks access and fetches data (evidence: `src/app/b360-mgmt/page.tsx`)
- Management page → Staff login: renders when unauthenticated (evidence: `src/app/b360-mgmt/page.tsx`)
- Management page → Admin dashboard: renders management (evidence: `src/app/b360-mgmt/page.tsx`)
- Staff login → Server actions: authenticates staff (evidence: `src/components/admin-login.tsx`)
- Admin dashboard → Server actions: manages appointments and barbers (evidence: `src/components/admin-dashboard.tsx`)
- Admin dashboard → Server actions: loads barber schedule (evidence: `src/components/admin-dashboard.tsx`)
- Admin dashboard → EAT time rules: formats appointment times (evidence: `src/components/admin-dashboard.tsx`)
- Admin dashboard → Ethiopian calendar: formats calendar dates (evidence: `src/components/admin-dashboard.tsx`)
- Server actions → Booking rules: delegates booking operations (evidence: `src/lib/actions.ts`)
- Server actions → Prisma client: reads and updates records (evidence: `src/lib/actions.ts`)
- Booking rules → Prisma client: reads and writes appointments (evidence: `src/lib/bookings.ts`)
- Booking rules → Slot calculation: checks slot conflicts (evidence: `src/lib/bookings.ts`)
- Booking rules → EAT time rules: validates EAT dates (evidence: `src/lib/bookings.ts`)
- Slot calculation → EAT time rules: uses shop hours (evidence: `src/lib/slots.ts`)
- Prisma client → SQLite database: persists records (evidence: `README.md`)
