# abonenfant/glo4002 architecture

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

- Interactive diagram: https://gitdiagram.com/abonenfant/glo4002
- Repository: https://github.com/abonenfant/glo4002

## Overview

This is an inn-management application with REST entry points, application services, domain workflows, and in-memory repositories. The central runtime pattern is that services translate requests into queued domain actions; Inn executes those actions and advances nightly stay, food, and billing operations. Room setup and reconfiguration are the clearest sampled API-to-domain path. Other resource connections and some domain details are not shown in excerpts, so those links are omitted or marked unverified.

Main entry points: [`domain/Inn.java`](https://github.com/abonenfant/glo4002/blob/main/domain/Inn.java) (Night coordinator), [`interfaces/configuration/ApplicationBinder.java`](https://github.com/abonenfant/glo4002/blob/main/interfaces/configuration/ApplicationBinder.java) (Dependency binder), [`application/RoomService.java`](https://github.com/abonenfant/glo4002/blob/main/application/RoomService.java) (Room service), [`application/StayService.java`](https://github.com/abonenfant/glo4002/blob/main/application/StayService.java) (Stay service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST interface"]
  node_server["Application server"]
  node_binder["Dependency binder"]
  node_room_api["Room endpoints<br/>[RoomsResource.java]"]
  node_stay_api["Stay endpoints<br/>[StayResource.java]"]
  node_order_api["Order endpoints<br/>[OrderResource.java]"]
  node_subscription_api["Subscription endpoints"]
end

subgraph group_app["Application services"]
  node_room_service["Room service<br/>[RoomService.java]"]
  node_stay_service["Stay service<br/>[StayService.java]"]
  node_order_service["Order service<br/>[OrderService.java]"]
  node_subscription_service["Subscription service"]
end

subgraph group_domain["Inn domain"]
  node_inn["Night coordinator<br/>[Inn.java]"]
  node_room_actions["Room actions"]
  node_room_model["Rooms and directory"]
  node_stay_workflow["Stay booking lifecycle"]
  node_orders["Food orders"]
  node_pantry["Pantry and supplies<br/>[Pantry.java]"]
  node_subscriptions["Food subscriptions"]
  node_repositories["Repository contracts"]
end

subgraph group_persistence["In-memory persistence"]
  node_memory_store[("In-memory repositories")]
end

node_client(("API client"))

node_client -.->|"sends requests"| node_room_api
node_client -.->|"sends requests"| node_stay_api
node_client -.->|"sends requests"| node_order_api
node_client -.->|"sends requests"| node_subscription_api
node_server -->|"configures"| node_binder
node_binder -->|"wires"| node_room_service
node_binder -->|"wires"| node_stay_service
node_binder -->|"wires"| node_order_service
node_binder -->|"wires"| node_subscription_service
node_room_api -->|"calls"| node_room_service
node_stay_api -.->|"calls"| node_stay_service
node_order_api -.->|"calls"| node_order_service
node_subscription_api -.->|"calls"| node_subscription_service
node_room_service -->|"queues actions"| node_inn
node_stay_service -->|"queues bookings"| node_inn
node_subscription_service -->|"queues changes"| node_inn
node_inn -->|"executes queued"| node_room_actions
node_room_service -->|"reads rooms"| node_room_model
node_room_service -->|"reads room records"| node_repositories
node_stay_service -->|"creates booking action"| node_stay_workflow
node_subscription_service -->|"creates subscription actions"| node_subscriptions
node_inn -->|"advances lifecycle"| node_stay_workflow
node_inn -->|"applies food effects"| node_pantry
node_inn -->|"reads order supplies"| node_orders
node_inn -->|"reads subscription supplies"| node_subscriptions
node_inn -->|"uses contracts"| node_repositories
node_room_model -->|"persists rooms"| node_memory_store
node_subscriptions -->|"persists subscriptions"| node_memory_store
node_stay_workflow -->|"persists travellers"| node_memory_store
node_repositories -->|"implemented by"| node_memory_store

click node_server "https://github.com/abonenfant/glo4002/blob/main/ApplicationServer.java"
click node_binder "https://github.com/abonenfant/glo4002/blob/main/interfaces/configuration/ApplicationBinder.java"
click node_room_api "https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/RoomsResource.java"
click node_stay_api "https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/StayResource.java"
click node_order_api "https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/OrderResource.java"
click node_subscription_api "https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/SubscriptionResource.java"
click node_room_service "https://github.com/abonenfant/glo4002/blob/main/application/RoomService.java"
click node_stay_service "https://github.com/abonenfant/glo4002/blob/main/application/StayService.java"
click node_order_service "https://github.com/abonenfant/glo4002/blob/main/application/OrderService.java"
click node_subscription_service "https://github.com/abonenfant/glo4002/blob/main/application/SubscriptionService.java"
click node_inn "https://github.com/abonenfant/glo4002/blob/main/domain/Inn.java"
click node_room_actions "https://github.com/abonenfant/glo4002/tree/main/domain/action"
click node_room_model "https://github.com/abonenfant/glo4002/tree/main/domain/room"
click node_stay_workflow "https://github.com/abonenfant/glo4002/tree/main/domain/stay"
click node_orders "https://github.com/abonenfant/glo4002/tree/main/domain/order"
click node_pantry "https://github.com/abonenfant/glo4002/blob/main/domain/Pantry.java"
click node_subscriptions "https://github.com/abonenfant/glo4002/tree/main/domain/subscription"
click node_repositories "https://github.com/abonenfant/glo4002/tree/main/domain"
click node_memory_store "https://github.com/abonenfant/glo4002/tree/main/infrastructure/persistence"

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_server,node_binder,node_room_api,node_stay_api,node_order_api,node_subscription_api,node_client toneBlue
class node_room_service,node_stay_service,node_order_service,node_subscription_service toneAmber
class node_inn,node_room_actions,node_room_model,node_stay_workflow,node_orders,node_pantry,node_subscriptions,node_repositories toneMint
class node_memory_store toneRose
```

## Components

### REST interface

- [Application server](https://github.com/abonenfant/glo4002/blob/main/ApplicationServer.java): `ApplicationServer.java`
- [Dependency binder](https://github.com/abonenfant/glo4002/blob/main/interfaces/configuration/ApplicationBinder.java): `interfaces/configuration/ApplicationBinder.java`
- [Room endpoints](https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/RoomsResource.java): `interfaces/resources/RoomsResource.java`
- [Stay endpoints](https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/StayResource.java): `interfaces/resources/StayResource.java`
- [Order endpoints](https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/OrderResource.java): `interfaces/resources/OrderResource.java`
- [Subscription endpoints](https://github.com/abonenfant/glo4002/blob/main/interfaces/resources/SubscriptionResource.java): `interfaces/resources/SubscriptionResource.java`

### Application services

- [Room service](https://github.com/abonenfant/glo4002/blob/main/application/RoomService.java): `application/RoomService.java`
- [Stay service](https://github.com/abonenfant/glo4002/blob/main/application/StayService.java): `application/StayService.java`
- [Order service](https://github.com/abonenfant/glo4002/blob/main/application/OrderService.java): `application/OrderService.java`
- [Subscription service](https://github.com/abonenfant/glo4002/blob/main/application/SubscriptionService.java): `application/SubscriptionService.java`

### Inn domain

- [Night coordinator](https://github.com/abonenfant/glo4002/blob/main/domain/Inn.java): `domain/Inn.java`
- [Room actions](https://github.com/abonenfant/glo4002/tree/main/domain/action): `domain/action`
- [Rooms and directory](https://github.com/abonenfant/glo4002/tree/main/domain/room): `domain/room`
- [Stay booking lifecycle](https://github.com/abonenfant/glo4002/tree/main/domain/stay): `domain/stay`
- [Food orders](https://github.com/abonenfant/glo4002/tree/main/domain/order): `domain/order`
- [Pantry and supplies](https://github.com/abonenfant/glo4002/blob/main/domain/Pantry.java): `domain/Pantry.java`
- [Food subscriptions](https://github.com/abonenfant/glo4002/tree/main/domain/subscription): `domain/subscription`
- [Repository contracts](https://github.com/abonenfant/glo4002/tree/main/domain): `domain`

### In-memory persistence

- [In-memory repositories](https://github.com/abonenfant/glo4002/tree/main/infrastructure/persistence): `infrastructure/persistence`

### Other components

- **API client**

## Connections

- API client → Room endpoints: sends requests
- API client → Stay endpoints: sends requests
- API client → Order endpoints: sends requests
- API client → Subscription endpoints: sends requests
- Application server → Dependency binder: configures (evidence: `ApplicationServer.java`)
- Dependency binder → Room service: wires (evidence: `interfaces/configuration/ApplicationBinder.java`)
- Dependency binder → Stay service: wires (evidence: `interfaces/configuration/ApplicationBinder.java`)
- Dependency binder → Order service: wires (evidence: `interfaces/configuration/ApplicationBinder.java`)
- Dependency binder → Subscription service: wires (evidence: `interfaces/configuration/ApplicationBinder.java`)
- Room endpoints → Room service: calls (evidence: `interfaces/resources/RoomsResource.java`)
- Stay endpoints → Stay service: calls
- Order endpoints → Order service: calls
- Subscription endpoints → Subscription service: calls
- Room service → Night coordinator: queues actions (evidence: `application/RoomService.java`)
- Stay service → Night coordinator: queues bookings (evidence: `application/StayService.java`)
- Subscription service → Night coordinator: queues changes (evidence: `application/SubscriptionService.java`)
- Night coordinator → Room actions: executes queued (evidence: `domain/Inn.java`)
- Room service → Rooms and directory: reads rooms (evidence: `application/RoomService.java`)
- Room service → Repository contracts: reads room records (evidence: `application/RoomService.java`)
- Stay service → Stay booking lifecycle: creates booking action (evidence: `application/StayService.java`)
- Subscription service → Food subscriptions: creates subscription actions (evidence: `application/SubscriptionService.java`)
- Night coordinator → Stay booking lifecycle: advances lifecycle (evidence: `domain/Inn.java`)
- Night coordinator → Pantry and supplies: applies food effects (evidence: `domain/Inn.java`)
- Night coordinator → Food orders: reads order supplies (evidence: `domain/Inn.java`)
- Night coordinator → Food subscriptions: reads subscription supplies (evidence: `domain/Inn.java`)
- Night coordinator → Repository contracts: uses contracts (evidence: `domain/Inn.java`)
- Rooms and directory → In-memory repositories: persists rooms (evidence: `infrastructure/persistence/InMemoryRoomRepository.java`)
- Food subscriptions → In-memory repositories: persists subscriptions (evidence: `infrastructure/persistence/InMemorySubscriptionRepository.java`)
- Stay booking lifecycle → In-memory repositories: persists travellers (evidence: `infrastructure/persistence/InMemoryTravellerRepository.java`)
- Repository contracts → In-memory repositories: implemented by (evidence: `infrastructure/persistence/InMemoryRoomRepository.java`)
