# lucasffigueiredo/frontend-ebusworkspace architecture

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

- Interactive diagram: https://gitdiagram.com/lucasffigueiredo/frontend-ebusworkspace
- Repository: https://github.com/lucasffigueiredo/frontend-ebusworkspace

## Overview

E-bus WorkSpace is a Next.js frontend for reserving desks and meeting rooms, checking in with QR codes, and managing workplace usage. The main flow is Google sign-in, authenticated access to booking pages, and reservation operations against a backend API; separate branches cover check-in, spaces administration, metrics, profiles, and department selection. The graph reflects documented capabilities and indexed references. Some feature implementations were not sampled, so uncertain connections are omitted or marked unverified.

Main entry points: [`src/app`](https://github.com/lucasffigueiredo/frontend-ebusworkspace/tree/master/src/app) (App routes), [`src/core/services/serverApi.ts`](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/serverApi.ts) (Server API client), [`src/features/auth/hooks/useGoogleAuth.ts`](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/auth/hooks/useGoogleAuth.ts) (Google sign-in), [`src/core/services/auth.service.ts`](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/auth.service.ts) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_app_routes["App routes"]
  node_route_guard["Route protection<br/>[middleware.ts]"]
end

subgraph group_booking["Reservations and check-in"]
  node_home["Home dashboard<br/>[page.tsx]"]
  node_desk_booking["Desk booking"]
  node_room_booking["Room booking"]
  node_my_bookings["My bookings<br/>[MyBookingsPage.tsx]"]
  node_qr_checkin["QR check-in<br/>[useScanPage.ts]"]
  node_booking_actions["Booking actions<br/>[booking.actions.ts]"]
  node_booking_types["Booking data types<br/>[booking.types.ts]"]
end

subgraph group_management["Spaces and reporting"]
  node_space_admin["Space management<br/>[SpacesPage.tsx]"]
  node_space_actions["Space actions<br/>[space.actions.ts]"]
  node_metrics["Usage metrics<br/>[MetricsPage.tsx]"]
  node_department["Department selection"]
end

subgraph group_identity["Identity and profile"]
  node_google_login["Google sign-in<br/>[useGoogleAuth.ts]"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_login_handler["Login handler<br/>[route.ts]"]
  node_profile["User profile<br/>[ProfilePage.tsx]"]
  node_user_actions["User actions<br/>[user.actions.ts]"]
  node_user_store[("Local user state<br/>[user.service.ts]")]
end

subgraph group_platform["Data access"]
  node_server_api["Server API client<br/>[serverApi.ts]"]
end

node_employee(("Employee"))
node_backend["WorkSpace backend"]
node_google["Google OAuth"]

node_employee -->|"uses"| node_app_routes
node_app_routes -->|"routes to"| node_home
node_app_routes -->|"routes to"| node_my_bookings
node_app_routes -->|"routes to"| node_profile
node_employee -->|"signs in"| node_google_login
node_google_login -->|"authenticates with"| node_google
node_google_login -->|"calls"| node_auth_service
node_auth_service -->|"posts credentials"| node_login_handler
node_login_handler -->|"exchanges token"| node_backend
node_employee -->|"books desks"| node_desk_booking
node_employee -->|"books rooms"| node_room_booking
node_employee -->|"checks in"| node_qr_checkin
node_desk_booking -->|"invokes"| node_booking_actions
node_room_booking -->|"invokes"| node_booking_actions
node_booking_actions -->|"calls"| node_server_api
node_server_api -->|"sends API requests"| node_backend
node_employee -->|"manages reservations"| node_my_bookings
node_employee -->|"manages spaces"| node_space_admin
node_space_admin -->|"invokes"| node_space_actions
node_space_actions -->|"calls"| node_server_api
node_employee -->|"views usage"| node_metrics
node_employee -->|"selects department"| node_department
node_employee -->|"edits profile"| node_profile
node_profile -->|"invokes"| node_user_actions
node_user_actions -->|"calls"| node_server_api
node_auth_service -->|"persists session"| node_user_store
node_route_guard -.->|"guards access"| node_app_routes

click node_app_routes "https://github.com/lucasffigueiredo/frontend-ebusworkspace/tree/master/src/app"
click node_route_guard "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/middleware.ts"
click node_home "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/app/page.tsx"
click node_desk_booking "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/hooks/useDeskBookingPage.ts"
click node_room_booking "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/hooks/useRoomBookingPage.ts"
click node_my_bookings "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/pages/MyBookingsPage.tsx"
click node_qr_checkin "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/hooks/useScanPage.ts"
click node_booking_actions "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/actions/booking.actions.ts"
click node_booking_types "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/models/booking.types.ts"
click node_space_admin "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/spaces/pages/SpacesPage.tsx"
click node_space_actions "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/actions/space.actions.ts"
click node_metrics "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/metrics/pages/MetricsPage.tsx"
click node_department "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/spaces/hooks/useSelectDepartmentPage.ts"
click node_google_login "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/auth/hooks/useGoogleAuth.ts"
click node_auth_service "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/auth.service.ts"
click node_login_handler "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/app/api/auth/login/route.ts"
click node_profile "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/auth/pages/ProfilePage.tsx"
click node_user_actions "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/actions/user.actions.ts"
click node_user_store "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/user.service.ts"
click node_server_api "https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/serverApi.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_routes,node_route_guard toneBlue
class node_home,node_desk_booking,node_room_booking,node_my_bookings,node_qr_checkin,node_booking_actions,node_booking_types toneAmber
class node_space_admin,node_space_actions,node_metrics,node_department toneMint
class node_google_login,node_auth_service,node_login_handler,node_profile,node_user_actions,node_user_store toneRose
class node_server_api,node_employee,node_backend,node_google toneIndigo
```

## Components

### App and access

- [App routes](https://github.com/lucasffigueiredo/frontend-ebusworkspace/tree/master/src/app): `src/app`
- [Route protection](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/middleware.ts): `src/middleware.ts`

### Reservations and check-in

- [Home dashboard](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Desk booking](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/hooks/useDeskBookingPage.ts): `src/features/booking/hooks/useDeskBookingPage.ts`
- [Room booking](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/hooks/useRoomBookingPage.ts): `src/features/booking/hooks/useRoomBookingPage.ts`
- [My bookings](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/pages/MyBookingsPage.tsx): `src/features/booking/pages/MyBookingsPage.tsx`
- [QR check-in](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/booking/hooks/useScanPage.ts): `src/features/booking/hooks/useScanPage.ts`
- [Booking actions](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/actions/booking.actions.ts): `src/core/actions/booking.actions.ts`
- [Booking data types](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/models/booking.types.ts): `src/core/models/booking.types.ts`

### Spaces and reporting

- [Space management](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/spaces/pages/SpacesPage.tsx): `src/features/spaces/pages/SpacesPage.tsx`
- [Space actions](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/actions/space.actions.ts): `src/core/actions/space.actions.ts`
- [Usage metrics](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/metrics/pages/MetricsPage.tsx): `src/features/metrics/pages/MetricsPage.tsx`
- [Department selection](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/spaces/hooks/useSelectDepartmentPage.ts): `src/features/spaces/hooks/useSelectDepartmentPage.ts`

### Identity and profile

- [Google sign-in](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/auth/hooks/useGoogleAuth.ts): `src/features/auth/hooks/useGoogleAuth.ts`
- [Authentication service](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/auth.service.ts): `src/core/services/auth.service.ts`
- [Login handler](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [User profile](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/features/auth/pages/ProfilePage.tsx): `src/features/auth/pages/ProfilePage.tsx`
- [User actions](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/actions/user.actions.ts): `src/core/actions/user.actions.ts`
- [Local user state](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/user.service.ts): `src/core/services/user.service.ts`

### Data access

- [Server API client](https://github.com/lucasffigueiredo/frontend-ebusworkspace/blob/master/src/core/services/serverApi.ts): `src/core/services/serverApi.ts`

### Other components

- **Employee**
- **WorkSpace backend**
- **Google OAuth**

## Connections

- Employee → App routes: uses
- App routes → Home dashboard: routes to (evidence: `src/app/page.tsx`)
- App routes → My bookings: routes to (evidence: `src/app/bookings/page.tsx`)
- App routes → User profile: routes to (evidence: `src/app/profile/page.tsx`)
- Employee → Google sign-in: signs in
- Google sign-in → Google OAuth: authenticates with
- Google sign-in → Authentication service: calls (evidence: `src/features/auth/hooks/useGoogleAuth.ts`)
- Authentication service → Login handler: posts credentials (evidence: `src/core/services/auth.service.ts`)
- Login handler → WorkSpace backend: exchanges token (evidence: `src/app/api/auth/login/route.ts`)
- Employee → Desk booking: books desks
- Employee → Room booking: books rooms
- Employee → QR check-in: checks in
- Desk booking → Booking actions: invokes (evidence: `src/features/booking/hooks/useDeskBookingPage.ts`)
- Room booking → Booking actions: invokes (evidence: `src/features/booking/hooks/useRoomBookingPage.ts`)
- Booking actions → Server API client: calls (evidence: `src/core/actions/booking.actions.ts`)
- Server API client → WorkSpace backend: sends API requests (evidence: `src/core/services/serverApi.ts`)
- Employee → My bookings: manages reservations
- Employee → Space management: manages spaces
- Space management → Space actions: invokes
- Space actions → Server API client: calls (evidence: `src/core/actions/space.actions.ts`)
- Employee → Usage metrics: views usage
- Employee → Department selection: selects department
- Employee → User profile: edits profile
- User profile → User actions: invokes
- User actions → Server API client: calls (evidence: `src/core/actions/user.actions.ts`)
- Authentication service → Local user state: persists session (evidence: `src/core/services/auth.service.ts`)
- Route protection → App routes: guards access
