# lucasffigueiredo/backend-ebusworkspace architecture

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

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

## Overview

This is a .NET REST API for reserving desks and meeting rooms. Employees authenticate, discover spaces, create reservations, check in, and request extensions; Facilities or managers handle approvals and maintenance. Separate capabilities cover access requests, user roles, dashboards, audit history, and automatic no-show processing. The code follows Clean Architecture with CQRS/MediatR handlers, repository interfaces, and PostgreSQL-backed read/write contexts. Some subsystems are represented from the README and file tree rather than inspected source; those links are documented relationships, not claims of direct calls.

Main entry points: [`src/JCA.WorkSpace.Application/Handlers`](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers) (MediatR dispatch), [`src/JCA.WorkSpace.Infrastructure.Data/Repositories/ReservationRepository.cs`](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Repositories/ReservationRepository.cs) (Reservation repository), [`src/JCA.WorkSpace.Application/Handlers/Reservations`](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Reservations) (Reservation workflows), [`src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs`](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs) (Dashboard metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_api_reservations["Reservation endpoints"]
  node_api_spaces["Space endpoints"]
  node_api_users["User and access endpoints<br/>[UsersController.cs]"]
  node_api_auth["Authentication endpoints<br/>[AuthController.cs]"]
end

subgraph group_app["Application workflows"]
  node_dispatch["MediatR dispatch<br/>[Handlers]"]
  node_reservation_flow["Reservation workflows<br/>[Reservations]"]
  node_space_flow["Space and maintenance<br/>[Spaces]"]
  node_identity_flow["Users and access<br/>[Users]"]
  node_login_flow["Google login"]
  node_access_approval["Access approvals<br/>[AccessRequests]"]
end

subgraph group_domain["Workspace domain"]
  node_reservation_entities["Reservations and extensions<br/>[Reservation.cs]"]
  node_space_entity["Spaces<br/>[Space.cs]"]
  node_user_entity["Users<br/>[User.cs]"]
end

subgraph group_data["Persistence"]
  node_reservation_repository["Reservation repository"]
  node_space_repository["Space repository<br/>[SpaceRepository.cs]"]
  node_db_context[("Workspace contexts")]
end

subgraph group_ops["Background and insights"]
  node_dashboard["Dashboard metrics"]
  node_audit["Audit history"]
  node_no_show_worker["No-show worker<br/>[NoShowWorker.cs]"]
  node_no_show_handler["No-show processing"]
end

node_employees(("Employees and staff"))
node_postgres[("PostgreSQL")]

node_employees -->|"uses"| node_api_reservations
node_employees -->|"browses"| node_api_spaces
node_employees -->|"authenticates"| node_api_auth
node_api_reservations -->|"sends requests"| node_dispatch
node_api_spaces -->|"dispatches queries"| node_dispatch
node_api_users -->|"dispatches requests"| node_dispatch
node_api_auth -->|"dispatches login"| node_dispatch
node_dispatch -->|"routes requests"| node_reservation_flow
node_dispatch -->|"routes requests"| node_space_flow
node_dispatch -->|"routes requests"| node_identity_flow
node_dispatch -->|"routes login"| node_login_flow
node_dispatch -->|"routes requests"| node_access_approval
node_reservation_flow -.->|"queries and updates"| node_reservation_repository
node_space_flow -.->|"queries and updates"| node_space_repository
node_dashboard -->|"reads reservations"| node_reservation_repository
node_dashboard -->|"reads spaces"| node_space_repository
node_reservation_flow -->|"reads reservations"| node_reservation_repository
node_reservation_repository -->|"queries"| node_db_context
node_space_repository -->|"queries"| node_db_context
node_db_context -->|"persists data"| node_postgres
node_employees -->|"views metrics"| node_dashboard
node_employees -->|"reviews actions"| node_audit
node_no_show_worker -.->|"processes no-shows"| node_no_show_handler
node_no_show_handler -.->|"updates statuses"| node_reservation_repository

click node_api_reservations "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/ReservationsController.cs"
click node_api_spaces "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/SpacesController.cs"
click node_api_users "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/UsersController.cs"
click node_api_auth "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/AuthController.cs"
click node_dispatch "https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers"
click node_reservation_flow "https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Reservations"
click node_space_flow "https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Spaces"
click node_identity_flow "https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Users"
click node_login_flow "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/Login/LoginGoogleCommandHandler.cs"
click node_access_approval "https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/AccessRequests"
click node_reservation_entities "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Domain/Entities/Reservation.cs"
click node_space_entity "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Domain/Entities/Space.cs"
click node_user_entity "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Domain/Entities/User.cs"
click node_reservation_repository "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Repositories/ReservationRepository.cs"
click node_space_repository "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Repositories/SpaceRepository.cs"
click node_db_context "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Contexts/WorkSpaceContext.cs"
click node_dashboard "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs"
click node_audit "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/AudiLogs/GetAuditLogsQueryHandler.cs"
click node_no_show_worker "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Workers/NoShowWorker.cs"
click node_no_show_handler "https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/NoShows/ProcessNoShowsCommandHandler.cs"

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_api_reservations,node_api_spaces,node_api_users,node_api_auth toneBlue
class node_dispatch,node_reservation_flow,node_space_flow,node_identity_flow,node_login_flow,node_access_approval,node_postgres toneAmber
class node_reservation_entities,node_space_entity,node_user_entity toneMint
class node_reservation_repository,node_space_repository,node_db_context toneRose
class node_dashboard,node_audit,node_no_show_worker,node_no_show_handler,node_employees toneIndigo
```

## Components

### REST API

- [Reservation endpoints](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/ReservationsController.cs): `src/JCA.WorkSpace.Service.API/Controllers/ReservationsController.cs`
- [Space endpoints](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/SpacesController.cs): `src/JCA.WorkSpace.Service.API/Controllers/SpacesController.cs`
- [User and access endpoints](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/UsersController.cs): `src/JCA.WorkSpace.Service.API/Controllers/UsersController.cs`
- [Authentication endpoints](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Controllers/AuthController.cs): `src/JCA.WorkSpace.Service.API/Controllers/AuthController.cs`

### Application workflows

- [MediatR dispatch](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers): `src/JCA.WorkSpace.Application/Handlers`
- [Reservation workflows](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Reservations): `src/JCA.WorkSpace.Application/Handlers/Reservations`
- [Space and maintenance](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Spaces): `src/JCA.WorkSpace.Application/Handlers/Spaces`
- [Users and access](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/Users): `src/JCA.WorkSpace.Application/Handlers/Users`
- [Google login](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/Login/LoginGoogleCommandHandler.cs): `src/JCA.WorkSpace.Application/Handlers/Login/LoginGoogleCommandHandler.cs`
- [Access approvals](https://github.com/lucasffigueiredo/backend-ebusworkspace/tree/master/src/JCA.WorkSpace.Application/Handlers/AccessRequests): `src/JCA.WorkSpace.Application/Handlers/AccessRequests`

### Workspace domain

- [Reservations and extensions](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Domain/Entities/Reservation.cs): `src/JCA.WorkSpace.Domain/Entities/Reservation.cs`
- [Spaces](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Domain/Entities/Space.cs): `src/JCA.WorkSpace.Domain/Entities/Space.cs`
- [Users](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Domain/Entities/User.cs): `src/JCA.WorkSpace.Domain/Entities/User.cs`

### Persistence

- [Reservation repository](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Repositories/ReservationRepository.cs): `src/JCA.WorkSpace.Infrastructure.Data/Repositories/ReservationRepository.cs`
- [Space repository](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Repositories/SpaceRepository.cs): `src/JCA.WorkSpace.Infrastructure.Data/Repositories/SpaceRepository.cs`
- [Workspace contexts](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Infrastructure.Data/Contexts/WorkSpaceContext.cs): `src/JCA.WorkSpace.Infrastructure.Data/Contexts/WorkSpaceContext.cs`

### Background and insights

- [Dashboard metrics](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs): `src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs`
- [Audit history](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/AudiLogs/GetAuditLogsQueryHandler.cs): `src/JCA.WorkSpace.Application/Handlers/AudiLogs/GetAuditLogsQueryHandler.cs`
- [No-show worker](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Service.API/Workers/NoShowWorker.cs): `src/JCA.WorkSpace.Service.API/Workers/NoShowWorker.cs`
- [No-show processing](https://github.com/lucasffigueiredo/backend-ebusworkspace/blob/master/src/JCA.WorkSpace.Application/Handlers/NoShows/ProcessNoShowsCommandHandler.cs): `src/JCA.WorkSpace.Application/Handlers/NoShows/ProcessNoShowsCommandHandler.cs`

### Other components

- **Employees and staff**
- **PostgreSQL**

## Connections

- Employees and staff → Reservation endpoints: uses
- Employees and staff → Space endpoints: browses
- Employees and staff → Authentication endpoints: authenticates
- Reservation endpoints → MediatR dispatch: sends requests (evidence: `src/JCA.WorkSpace.Service.API/Controllers/ReservationsController.cs`)
- Space endpoints → MediatR dispatch: dispatches queries
- User and access endpoints → MediatR dispatch: dispatches requests
- Authentication endpoints → MediatR dispatch: dispatches login
- MediatR dispatch → Reservation workflows: routes requests
- MediatR dispatch → Space and maintenance: routes requests
- MediatR dispatch → Users and access: routes requests
- MediatR dispatch → Google login: routes login
- MediatR dispatch → Access approvals: routes requests
- Reservation workflows → Reservation repository: queries and updates
- Space and maintenance → Space repository: queries and updates
- Dashboard metrics → Reservation repository: reads reservations (evidence: `src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs`)
- Dashboard metrics → Space repository: reads spaces (evidence: `src/JCA.WorkSpace.Application/Handlers/Dashboards/GetDashboardMetricsQueryHandler.cs`)
- Reservation workflows → Reservation repository: reads reservations
- Reservation repository → Workspace contexts: queries (evidence: `src/JCA.WorkSpace.Infrastructure.Data/Repositories/ReservationRepository.cs`)
- Space repository → Workspace contexts: queries (evidence: `src/JCA.WorkSpace.Infrastructure.Data/Repositories/SpaceRepository.cs`)
- Workspace contexts → PostgreSQL: persists data
- Employees and staff → Dashboard metrics: views metrics
- Employees and staff → Audit history: reviews actions
- No-show worker → No-show processing: processes no-shows
- No-show processing → Reservation repository: updates statuses
