# b-mathali/coworking_space architecture

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

- Interactive diagram: https://gitdiagram.com/b-mathali/coworking_space
- Repository: https://github.com/b-mathali/coworking_space

## Overview

CoworkSpace is a coworking-seat reservation product: users find a space, choose a time slot and seat, then reserve it; paid bookings continue through Stripe Checkout, while free bookings confirm immediately. Admins manage spaces, seat plans, users, and reservations. The Angular frontend calls a NestJS API backed by MySQL, with notification and email capabilities. The README documents the main workflows; source excerpts show reservation rules, auth, and selected controller/service calls, but most frontend feature implementations and several backend services were not sampled.

Main entry points: [`frontend/src/app/app.routes.ts`](https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/app.routes.ts) (App routing), [`frontend/src/app/features/admin`](https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/admin) (Admin console), [`backend/src/reservations/reservations.service.ts`](https://github.com/b-mathali/coworking_space/blob/main/backend/src/reservations/reservations.service.ts) (Reservation rules), [`backend/src/payments/payments.service.ts`](https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/payments.service.ts) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_routes["App routing<br/>[app.routes.ts]"]
  node_authui["Login and account"]
  node_spacesui["Space browsing"]
  node_bookingui["Seat booking"]
  node_adminui["Admin console"]
  node_authclient["Auth client<br/>[auth.service.ts]"]
  node_paymentui["Payment result"]
end

subgraph group_booking["Booking domain"]
  node_spacesapi["Space API"]
  node_seatsapi["Seat map API"]
  node_reservationsapi["Reservation API"]
  node_reservationlogic["Reservation rules"]
  node_paymentsapi["Payments API"]
  node_paymentslogic["Payment processing"]
  node_invoice["PDF invoices<br/>[invoice.service.ts]"]
end

subgraph group_operations["Operations and identity"]
  node_authapi["Auth API<br/>[auth.controller.ts]"]
  node_adminapi["Admin API"]
  node_notifications["Booking notifications"]
  node_users[("User accounts<br/>[user.entity.ts]")]
end

subgraph group_platform["Persistence and integrations"]
  node_db[("MySQL database")]
  node_stripe["Stripe"]
  node_mail["SMTP email"]
end

node_visitor(("User or admin"))

node_visitor -->|"uses"| node_routes
node_routes -->|"routes to"| node_authui
node_routes -->|"routes to"| node_spacesui
node_routes -->|"routes to"| node_bookingui
node_routes -->|"routes to"| node_adminui
node_routes -->|"routes to"| node_paymentui
node_authui -.->|"uses"| node_authclient
node_authclient -->|"calls"| node_authapi
node_spacesui -.->|"browses spaces"| node_spacesapi
node_bookingui -->|"loads seat map"| node_seatsapi
node_bookingui -->|"submits booking"| node_reservationsapi
node_adminui -->|"manages spaces"| node_spacesapi
node_adminui -->|"edits seat plan"| node_seatsapi
node_adminui -->|"manages users"| node_adminapi
node_adminui -->|"views reservations"| node_adminapi
node_adminapi -->|"lists or cancels"| node_reservationlogic
node_reservationsapi -->|"delegates to"| node_reservationlogic
node_reservationlogic -->|"reads and writes"| node_db
node_reservationlogic -->|"creates payment record"| node_paymentslogic
node_reservationlogic -->|"notifies confirmation"| node_notifications
node_paymentsapi -->|"delegates to"| node_paymentslogic
node_paymentslogic -->|"checks out"| node_stripe
node_paymentslogic -->|"updates payment"| node_db
node_paymentui -->|"returns from checkout"| node_paymentsapi
node_paymentslogic -->|"creates invoice"| node_invoice
node_invoice -->|"downloaded by user"| node_paymentui
node_notifications -->|"sends email"| node_mail
node_notifications -.->|"stores notifications"| node_db
node_authapi -.->|"authenticates accounts"| node_users
node_adminapi -.->|"manages accounts"| node_users
node_spacesapi -.->|"reads and writes"| node_db
node_seatsapi -.->|"reads and writes"| node_db

click node_routes "https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/app.routes.ts"
click node_authui "https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/auth"
click node_spacesui "https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/spaces"
click node_bookingui "https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/reservations"
click node_adminui "https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/admin"
click node_authclient "https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/core/services/auth.service.ts"
click node_paymentui "https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/features/payments/payment-result/payment-result.component.ts"
click node_spacesapi "https://github.com/b-mathali/coworking_space/blob/main/backend/src/spaces/spaces.controller.ts"
click node_seatsapi "https://github.com/b-mathali/coworking_space/blob/main/backend/src/seats/seats.controller.ts"
click node_reservationsapi "https://github.com/b-mathali/coworking_space/blob/main/backend/src/reservations/reservations.controller.ts"
click node_reservationlogic "https://github.com/b-mathali/coworking_space/blob/main/backend/src/reservations/reservations.service.ts"
click node_paymentsapi "https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/payments.controller.ts"
click node_paymentslogic "https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/payments.service.ts"
click node_authapi "https://github.com/b-mathali/coworking_space/blob/main/backend/src/auth/auth.controller.ts"
click node_adminapi "https://github.com/b-mathali/coworking_space/blob/main/backend/src/admin/admin.controller.ts"
click node_notifications "https://github.com/b-mathali/coworking_space/blob/main/backend/src/notifications/booking-notifications.service.ts"
click node_users "https://github.com/b-mathali/coworking_space/blob/main/backend/src/users/entities/user.entity.ts"
click node_invoice "https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/invoice.service.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_routes,node_authui,node_spacesui,node_bookingui,node_adminui,node_authclient,node_paymentui,node_visitor toneBlue
class node_spacesapi,node_seatsapi,node_reservationsapi,node_reservationlogic,node_paymentsapi,node_paymentslogic,node_invoice toneAmber
class node_authapi,node_adminapi,node_notifications,node_users toneMint
class node_db,node_stripe,node_mail toneRose
```

## Components

### Angular client

- [App routing](https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Login and account](https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/auth): `frontend/src/app/features/auth`
- [Space browsing](https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/spaces): `frontend/src/app/features/spaces`
- [Seat booking](https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/reservations): `frontend/src/app/features/reservations`
- [Admin console](https://github.com/b-mathali/coworking_space/tree/main/frontend/src/app/features/admin): `frontend/src/app/features/admin`
- [Auth client](https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/core/services/auth.service.ts): `frontend/src/app/core/services/auth.service.ts`
- [Payment result](https://github.com/b-mathali/coworking_space/blob/main/frontend/src/app/features/payments/payment-result/payment-result.component.ts): `frontend/src/app/features/payments/payment-result/payment-result.component.ts`

### Booking domain

- [Space API](https://github.com/b-mathali/coworking_space/blob/main/backend/src/spaces/spaces.controller.ts): `backend/src/spaces/spaces.controller.ts`
- [Seat map API](https://github.com/b-mathali/coworking_space/blob/main/backend/src/seats/seats.controller.ts): `backend/src/seats/seats.controller.ts`
- [Reservation API](https://github.com/b-mathali/coworking_space/blob/main/backend/src/reservations/reservations.controller.ts): `backend/src/reservations/reservations.controller.ts`
- [Reservation rules](https://github.com/b-mathali/coworking_space/blob/main/backend/src/reservations/reservations.service.ts): `backend/src/reservations/reservations.service.ts`
- [Payments API](https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/payments.controller.ts): `backend/src/payments/payments.controller.ts`
- [Payment processing](https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/payments.service.ts): `backend/src/payments/payments.service.ts`
- [PDF invoices](https://github.com/b-mathali/coworking_space/blob/main/backend/src/payments/invoice.service.ts): `backend/src/payments/invoice.service.ts`

### Operations and identity

- [Auth API](https://github.com/b-mathali/coworking_space/blob/main/backend/src/auth/auth.controller.ts): `backend/src/auth/auth.controller.ts`
- [Admin API](https://github.com/b-mathali/coworking_space/blob/main/backend/src/admin/admin.controller.ts): `backend/src/admin/admin.controller.ts`
- [Booking notifications](https://github.com/b-mathali/coworking_space/blob/main/backend/src/notifications/booking-notifications.service.ts): `backend/src/notifications/booking-notifications.service.ts`
- [User accounts](https://github.com/b-mathali/coworking_space/blob/main/backend/src/users/entities/user.entity.ts): `backend/src/users/entities/user.entity.ts`

### Persistence and integrations

- **MySQL database**
- **Stripe**
- **SMTP email**

### Other components

- **User or admin**

## Connections

- User or admin → App routing: uses (evidence: `frontend/src/app/app.routes.ts`)
- App routing → Login and account: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routing → Space browsing: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routing → Seat booking: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routing → Admin console: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routing → Payment result: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Login and account → Auth client: uses
- Auth client → Auth API: calls (evidence: `frontend/src/app/core/services/auth.service.ts`)
- Space browsing → Space API: browses spaces
- Seat booking → Seat map API: loads seat map (evidence: `README.md`)
- Seat booking → Reservation API: submits booking (evidence: `README.md`)
- Admin console → Space API: manages spaces (evidence: `README.md`)
- Admin console → Seat map API: edits seat plan (evidence: `README.md`)
- Admin console → Admin API: manages users (evidence: `README.md`)
- Admin console → Admin API: views reservations (evidence: `README.md`)
- Admin API → Reservation rules: lists or cancels (evidence: `backend/src/admin/admin.controller.ts`)
- Reservation API → Reservation rules: delegates to (evidence: `backend/src/reservations/reservations.controller.ts`)
- Reservation rules → MySQL database: reads and writes (evidence: `backend/src/reservations/reservations.service.ts`)
- Reservation rules → Payment processing: creates payment record (evidence: `backend/src/reservations/reservations.service.ts`)
- Reservation rules → Booking notifications: notifies confirmation (evidence: `backend/src/reservations/reservations.service.ts`)
- Payments API → Payment processing: delegates to (evidence: `backend/src/payments/payments.controller.ts`)
- Payment processing → Stripe: checks out (evidence: `README.md`)
- Payment processing → MySQL database: updates payment (evidence: `backend/src/payments/payments.service.ts`)
- Payment result → Payments API: returns from checkout (evidence: `README.md`)
- Payment processing → PDF invoices: creates invoice (evidence: `README.md`)
- PDF invoices → Payment result: downloaded by user (evidence: `README.md`)
- Booking notifications → SMTP email: sends email (evidence: `README.md`)
- Booking notifications → MySQL database: stores notifications
- Auth API → User accounts: authenticates accounts
- Admin API → User accounts: manages accounts (evidence: `backend/src/admin/admin.controller.ts`)
- Space API → MySQL database: reads and writes
- Seat map API → MySQL database: reads and writes
