# flaviusmarian27/laundry-booking architecture

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

- Interactive diagram: https://gitdiagram.com/flaviusmarian27/laundry-booking
- Repository: https://github.com/flaviusmarian27/laundry-booking

## Overview

Laundry Booking is a dorm laundry-room booking and operations app. Students use the web client to view machines, book or cancel slots, start cycles, and report faults or feedback; core-service validates and persists these actions and publishes domain events. A separate notification service consumes events, maintains read copies, and notifies students. A daily AI-agent workflow is documented: it reads faults and no-shows through MCP tools and proposes actions for administrator approval. The tree omits the agent and MCP implementation, so those appear only as documented external components; several service links are likewise documented rather than source-verified.

Main entry points: [`core-service/src/main/java/ro/upt/laundry/core/controller`](https://github.com/flaviusmarian27/laundry-booking/tree/main/core-service/src/main/java/ro/upt/laundry/core/controller) (REST controllers), [`core-service/src/main/java/ro/upt/laundry/core/events/EventRecorder.java`](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/events/EventRecorder.java) (Event recorder), [`core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java`](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java) (Booking service), [`core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java`](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java) (Proposal decisions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_web["Web client<br/>[App.jsx]"]
end

subgraph group_core["Core operations"]
  node_core_api["REST controllers"]
  node_booking["Booking service"]
  node_fault_feedback["Fault and feedback<br/>[FaultService.java]"]
  node_machines["Machine management"]
  node_proposals["Proposal decisions"]
  node_booking_schedule["No-show detection"]
  node_core_store[("Core database")]
end

subgraph group_events["Event transport"]
  node_event_recorder["Event recorder<br/>[EventRecorder.java]"]
  node_kafka_relay["Kafka relay"]
  node_kafka["Kafka"]
end

subgraph group_notifications["Notifications and read copies"]
  node_listeners["Event listeners"]
  node_read_copies[("Read copies")]
  node_copy_api["Copy endpoints"]
  node_notifier["Student notifier<br/>[Notifier.java]"]
end

subgraph group_agent["AI proposals"]
  node_agent["Daily AI agent"]
  node_mcp["MCP tools"]
end

node_student(("Student"))
node_administrator(("Administrator"))

node_student -->|"uses"| node_web
node_administrator -->|"manages"| node_web
node_web -.->|"calls REST"| node_core_api
node_core_api -->|"delegates"| node_booking
node_core_api -->|"delegates"| node_machines
node_core_api -->|"delegates"| node_proposals
node_core_api -.->|"delegates"| node_fault_feedback
node_booking -->|"reads and writes"| node_core_store
node_fault_feedback -->|"reads and writes"| node_core_store
node_proposals -->|"reads and writes"| node_core_store
node_machines -->|"reads and writes"| node_core_store
node_booking_schedule -.->|"marks no-shows"| node_booking
node_booking -->|"records events"| node_event_recorder
node_fault_feedback -->|"records events"| node_event_recorder
node_proposals -->|"records events"| node_event_recorder
node_machines -->|"records events"| node_event_recorder
node_event_recorder -->|"publishes after commit"| node_kafka_relay
node_kafka_relay -.->|"sends events"| node_kafka
node_kafka -->|"delivers events"| node_listeners
node_listeners -.->|"updates copies"| node_read_copies
node_listeners -.->|"schedules notifications"| node_notifier
node_copy_api -->|"reads copies"| node_read_copies
node_student -->|"receives alerts"| node_notifier
node_agent -->|"uses tools"| node_mcp
node_mcp -.->|"proposes actions"| node_core_api
node_agent -->|"reads faults and no-shows"| node_mcp
node_administrator -.->|"approves or rejects"| node_proposals

click node_web "https://github.com/flaviusmarian27/laundry-booking/blob/main/web-client/src/App.jsx"
click node_core_api "https://github.com/flaviusmarian27/laundry-booking/tree/main/core-service/src/main/java/ro/upt/laundry/core/controller"
click node_booking "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java"
click node_fault_feedback "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/FaultService.java"
click node_machines "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/MachineService.java"
click node_proposals "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java"
click node_booking_schedule "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/scheduler/NoShowScheduler.java"
click node_core_store "https://github.com/flaviusmarian27/laundry-booking/tree/main/core-service/src/main/java/ro/upt/laundry/core/repository"
click node_event_recorder "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/events/EventRecorder.java"
click node_kafka_relay "https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/events/KafkaEventRelay.java"
click node_listeners "https://github.com/flaviusmarian27/laundry-booking/tree/main/notification-service/src/main/java/ro/upt/laundry/notification/kafka"
click node_read_copies "https://github.com/flaviusmarian27/laundry-booking/tree/main/notification-service/src/main/java/ro/upt/laundry/notification/store"
click node_copy_api "https://github.com/flaviusmarian27/laundry-booking/tree/main/notification-service/src/main/java/ro/upt/laundry/notification/web"
click node_notifier "https://github.com/flaviusmarian27/laundry-booking/blob/main/notification-service/src/main/java/ro/upt/laundry/notification/notify/Notifier.java"

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_web toneBlue
class node_core_api,node_booking,node_fault_feedback,node_machines,node_proposals,node_booking_schedule,node_core_store toneAmber
class node_event_recorder,node_kafka_relay,node_kafka toneMint
class node_listeners,node_read_copies,node_copy_api,node_notifier toneRose
class node_agent,node_mcp,node_student,node_administrator toneIndigo
```

## Components

### Web experience

- [Web client](https://github.com/flaviusmarian27/laundry-booking/blob/main/web-client/src/App.jsx): `web-client/src/App.jsx`

### Core operations

- [REST controllers](https://github.com/flaviusmarian27/laundry-booking/tree/main/core-service/src/main/java/ro/upt/laundry/core/controller): `core-service/src/main/java/ro/upt/laundry/core/controller`
- [Booking service](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java): `core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java`
- [Fault and feedback](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/FaultService.java): `core-service/src/main/java/ro/upt/laundry/core/service/FaultService.java`
- [Machine management](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/MachineService.java): `core-service/src/main/java/ro/upt/laundry/core/service/MachineService.java`
- [Proposal decisions](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java): `core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java`
- [No-show detection](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/scheduler/NoShowScheduler.java): `core-service/src/main/java/ro/upt/laundry/core/scheduler/NoShowScheduler.java`
- [Core database](https://github.com/flaviusmarian27/laundry-booking/tree/main/core-service/src/main/java/ro/upt/laundry/core/repository): `core-service/src/main/java/ro/upt/laundry/core/repository`

### Event transport

- [Event recorder](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/events/EventRecorder.java): `core-service/src/main/java/ro/upt/laundry/core/events/EventRecorder.java`
- [Kafka relay](https://github.com/flaviusmarian27/laundry-booking/blob/main/core-service/src/main/java/ro/upt/laundry/core/events/KafkaEventRelay.java): `core-service/src/main/java/ro/upt/laundry/core/events/KafkaEventRelay.java`
- **Kafka**

### Notifications and read copies

- [Event listeners](https://github.com/flaviusmarian27/laundry-booking/tree/main/notification-service/src/main/java/ro/upt/laundry/notification/kafka): `notification-service/src/main/java/ro/upt/laundry/notification/kafka`
- [Read copies](https://github.com/flaviusmarian27/laundry-booking/tree/main/notification-service/src/main/java/ro/upt/laundry/notification/store): `notification-service/src/main/java/ro/upt/laundry/notification/store`
- [Copy endpoints](https://github.com/flaviusmarian27/laundry-booking/tree/main/notification-service/src/main/java/ro/upt/laundry/notification/web): `notification-service/src/main/java/ro/upt/laundry/notification/web`
- [Student notifier](https://github.com/flaviusmarian27/laundry-booking/blob/main/notification-service/src/main/java/ro/upt/laundry/notification/notify/Notifier.java): `notification-service/src/main/java/ro/upt/laundry/notification/notify/Notifier.java`

### AI proposals

- **Daily AI agent**
- **MCP tools**

### Other components

- **Student**
- **Administrator**

## Connections

- Student → Web client: uses (evidence: `README.md`)
- Administrator → Web client: manages (evidence: `README.md`)
- Web client → REST controllers: calls REST (evidence: `README.md`)
- REST controllers → Booking service: delegates (evidence: `core-service/src/main/java/ro/upt/laundry/core/controller/BookingController.java`)
- REST controllers → Machine management: delegates (evidence: `core-service/src/main/java/ro/upt/laundry/core/controller/MachineController.java`)
- REST controllers → Proposal decisions: delegates (evidence: `core-service/src/main/java/ro/upt/laundry/core/controller/ProposalController.java`)
- REST controllers → Fault and feedback: delegates
- Booking service → Core database: reads and writes (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java`)
- Fault and feedback → Core database: reads and writes (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/FaultService.java`)
- Proposal decisions → Core database: reads and writes (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java`)
- Machine management → Core database: reads and writes (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/MachineService.java`)
- No-show detection → Booking service: marks no-shows
- Booking service → Event recorder: records events (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/BookingService.java`)
- Fault and feedback → Event recorder: records events (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/FaultService.java`)
- Proposal decisions → Event recorder: records events (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/ProposalService.java`)
- Machine management → Event recorder: records events (evidence: `core-service/src/main/java/ro/upt/laundry/core/service/MachineService.java`)
- Event recorder → Kafka relay: publishes after commit (evidence: `core-service/src/main/java/ro/upt/laundry/core/events/EventRecorder.java`)
- Kafka relay → Kafka: sends events (evidence: `README.md`)
- Kafka → Event listeners: delivers events (evidence: `README.md`)
- Event listeners → Read copies: updates copies (evidence: `README.md`)
- Event listeners → Student notifier: schedules notifications (evidence: `README.md`)
- Copy endpoints → Read copies: reads copies (evidence: `notification-service/src/main/java/ro/upt/laundry/notification/web/BookingCopyController.java`)
- Student → Student notifier: receives alerts (evidence: `README.md`)
- Daily AI agent → MCP tools: uses tools (evidence: `README.md`)
- MCP tools → REST controllers: proposes actions (evidence: `README.md`)
- Daily AI agent → MCP tools: reads faults and no-shows (evidence: `README.md`)
- Administrator → Proposal decisions: approves or rejects (evidence: `README.md`)
