# f4cio/restoranapplicationexample architecture

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

- Interactive diagram: https://gitdiagram.com/f4cio/restoranapplicationexample
- Repository: https://github.com/f4cio/restoranapplicationexample

## Overview

#### Purpose and entry points
RestroApp is an Angular + ASP.NET Core example for restaurant ordering, structured as a layered backend. The runnable server entry point is `F4CIO.Restro.UIWeb/Program.cs`, with application/service setup in `F4CIO.Restro.UIWeb/Startup.cs`. The browser client starts from `F4CIO.Restro.UIWeb/ClientApp/src/main.ts` and its Angular root module.

#### Web/API boundary
`F4CIO.Restro.UIWeb` exposes backend functionality over HTTP and should remain thin: controllers translate requests into business-layer calls rather than owning business rules. Ordering is surfaced through `F4CIO.Restro.UIWeb/Controllers/OrderController.cs`; the weather controller is template/remnant functionality. The web host also serves/coordinates the Angular client in `F4CIO.Restro.UIWeb/ClientApp`.

#### Domain contract layer
`F4CIO.Restro.Entities` contains POCO domain and transfer types shared across layers. Restaurant orders are modeled in `F4CIO.Restro.Entities/Order.cs`; the secondary chat-room capability uses `F4CIO.Restro.Entities/ChatRoom.cs`, `F4CIO.Restro.Entities/ChatItem.cs`, and event/aggregate subtypes. This layer is the primary boundary preventing UI, business logic, and storage from exchanging storage-specific objects.

#### Business orchestration
`F4CIO.Restro.BusinessLogic` implements application behavior via feature-oriented handlers. `F4CIO.Restro.BusinessLogic/HandlerForOrders.cs` is the core ordering workflow; `F4CIO.Restro.BusinessLogic/HandlerForRooms.cs` covers chat rooms. Handlers inherit common behavior from `F4CIO.Restro.BusinessLogic/HandlerBase.cs` and access lower-layer handlers either through constructor injection or `F4CIO.Restro.BusinessLogic/HandlersFactory.cs`.

#### Data-access abstraction and current persistence
`F4CIO.Restro.Data` owns CRUD-oriented handler implementations, isolating business logic from a future database/ORM. Its feature handlers mirror business capabilities: `F4CIO.Restro.Data/HandlerForOrders.cs`, `F4CIO.Restro.Data/HandlerForRooms.cs`, and `F4CIO.Restro.Data/HandlerForChatEvents.cs`. Current storage is in-memory (`F4CIO.Restro.Data/MemoryStorage.cs`), so no SQL server, ORM, or external persistence service is present. `F4CIO.Restro.Data/ApiContext.cs` is the data context boundary.

#### Dependency/control flow
The primary request path is Angular UI → ASP.NET Core controller → business handler → data handler → in-memory storage → entity/DTO response. Dependencies flow downward: UIWeb consumes BusinessLogic; BusinessLogic consumes Data; cross-layer contracts come from Entities and reusable utilities from Common. `F4CIO.Restro.Common/DummyDataGenerator.cs` supports seeded/demo data, while `F4CIO.Restro.Common/Formatters.cs` provides shared formatting.

#### Client runtime
The frontend is an Angular application, configured by `F4CIO.Restro.UIWeb/ClientApp/angular.json` and Node dependencies in `F4CIO.Restro.UIWeb/ClientApp/package.json`. Its current application shell is `F4CIO.Restro.UIWeb/ClientApp/src/app/app.module.ts`; `fetch-data` and weather-related views appear inherited scaffold functionality. Required runtimes are .NET Core/ASP.NET Core and Node.js/npm; no deployed infrastructure or third-party external services are represented.

Main entry points: [`F4CIO.Restro.BusinessLogic/HandlerForOrders.cs`](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlerForOrders.cs) (Order workflow), [`F4CIO.Restro.UIWeb/Controllers/OrderController.cs`](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Controllers/OrderController.cs) (Order API controller), [`F4CIO.Restro.Data/MemoryStorage.cs`](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/MemoryStorage.cs) (In-memory storage), [`F4CIO.Restro.BusinessLogic/HandlerForRooms.cs`](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlerForRooms.cs) (Room workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_angular_app["Angular application<br/>Angular UI<br/>[app.module.ts]"]
  node_angular_entry["Client entry point<br/>TypeScript bootstrap<br/>[main.ts]"]
end

subgraph group_web["ASP.NET Core web"]
  node_web_host["Web host<br/>ASP.NET Core host<br/>[Program.cs]"]
  node_startup["Service setup<br/>ASP.NET Core startup<br/>[Startup.cs]"]
  node_order_controller["Order API controller<br/>HTTP controller<br/>[OrderController.cs]"]
end

subgraph group_business["Business layer"]
  node_order_workflow["Order workflow<br/>business handler"]
  node_room_workflow["Room workflow<br/>business handler<br/>[HandlerForRooms.cs]"]
  node_handler_composition["Handler base and factory<br/>handler infrastructure<br/>[HandlersFactory.cs]"]
end

subgraph group_data["Data layer"]
  node_order_data_handler["Order data handler<br/>CRUD handler"]
  node_chat_data_handlers["Chat data handlers<br/>CRUD handlers<br/>[HandlerForRooms.cs]"]
  node_api_context["Data context<br/>data boundary<br/>[ApiContext.cs]"]
  node_memory_storage[("In-memory storage<br/>volatile store<br/>[MemoryStorage.cs]")]
end

node_entities_order["Order contract<br/>domain DTO<br/>[Order.cs]"]
node_entities_chat["Chat contracts<br/>domain DTOs<br/>[ChatRoom.cs]"]
node_common_utilities["Shared utilities<br/>common support"]

node_angular_entry -->|"bootstraps"| node_angular_app
node_angular_app -->|"HTTP requests"| node_order_controller
node_web_host -->|"initializes"| node_startup
node_startup -->|"configures"| node_order_controller
node_web_host -->|"serves / coordinates"| node_angular_app
node_order_controller -->|"delegates orders"| node_order_workflow
node_order_controller -->|"exchanges"| node_entities_order
node_order_workflow -->|"uses"| node_handler_composition
node_order_workflow -->|"accesses"| node_order_data_handler
node_room_workflow -->|"uses"| node_handler_composition
node_room_workflow -->|"accesses"| node_chat_data_handlers
node_order_workflow -->|"uses contracts"| node_entities_order
node_room_workflow -->|"uses contracts"| node_entities_chat
node_order_data_handler -->|"uses"| node_api_context
node_chat_data_handlers -->|"uses"| node_api_context
node_api_context -->|"reads / writes"| node_memory_storage
node_memory_storage -->|"stores"| node_entities_order
node_memory_storage -->|"stores"| node_entities_chat
node_common_utilities -.->|"seeds demo data"| node_memory_storage

click node_angular_app "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/ClientApp/src/app/app.module.ts"
click node_angular_entry "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/ClientApp/src/main.ts"
click node_web_host "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Program.cs"
click node_startup "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Startup.cs"
click node_order_controller "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Controllers/OrderController.cs"
click node_entities_order "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Entities/Order.cs"
click node_entities_chat "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Entities/ChatRoom.cs"
click node_order_workflow "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlerForOrders.cs"
click node_room_workflow "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlerForRooms.cs"
click node_handler_composition "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlersFactory.cs"
click node_order_data_handler "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/HandlerForOrders.cs"
click node_chat_data_handlers "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/HandlerForRooms.cs"
click node_api_context "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/ApiContext.cs"
click node_memory_storage "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/MemoryStorage.cs"
click node_common_utilities "https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Common/DummyDataGenerator.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_angular_app,node_angular_entry toneBlue
class node_web_host,node_startup,node_order_controller toneAmber
class node_order_workflow,node_room_workflow,node_handler_composition toneMint
class node_order_data_handler,node_chat_data_handlers,node_api_context,node_memory_storage toneRose
class node_entities_order,node_entities_chat,node_common_utilities toneNeutral
```

## Components

### Angular client

- [Angular application](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/ClientApp/src/app/app.module.ts): Angular UI · Restaurant ordering client shell. · `F4CIO.Restro.UIWeb/ClientApp/src/app/app.module.ts`
- [Client entry point](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/ClientApp/src/main.ts): TypeScript bootstrap · `F4CIO.Restro.UIWeb/ClientApp/src/main.ts`

### ASP.NET Core web

- [Web host](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Program.cs): ASP.NET Core host · Composes server and application services. · `F4CIO.Restro.UIWeb/Program.cs`
- [Service setup](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Startup.cs): ASP.NET Core startup · `F4CIO.Restro.UIWeb/Startup.cs`
- [Order API controller](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.UIWeb/Controllers/OrderController.cs): HTTP controller · Thin HTTP boundary for ordering. · `F4CIO.Restro.UIWeb/Controllers/OrderController.cs`

### Business layer

- [Order workflow](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlerForOrders.cs): business handler · Core ordering orchestration. · `F4CIO.Restro.BusinessLogic/HandlerForOrders.cs`
- [Room workflow](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlerForRooms.cs): business handler · `F4CIO.Restro.BusinessLogic/HandlerForRooms.cs`
- [Handler base and factory](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.BusinessLogic/HandlersFactory.cs): handler infrastructure · Provides common behavior and lower-layer handler access. · `F4CIO.Restro.BusinessLogic/HandlersFactory.cs`

### Data layer

- [Order data handler](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/HandlerForOrders.cs): CRUD handler · `F4CIO.Restro.Data/HandlerForOrders.cs`
- [Chat data handlers](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/HandlerForRooms.cs): CRUD handlers · Room and chat-event persistence operations. · `F4CIO.Restro.Data/HandlerForRooms.cs`
- [Data context](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/ApiContext.cs): data boundary · `F4CIO.Restro.Data/ApiContext.cs`
- [In-memory storage](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Data/MemoryStorage.cs): volatile store · Current persistence implementation; no database is present. · `F4CIO.Restro.Data/MemoryStorage.cs`

### Other components

- [Order contract](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Entities/Order.cs): domain DTO · `F4CIO.Restro.Entities/Order.cs`
- [Chat contracts](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Entities/ChatRoom.cs): domain DTOs · Chat room, item, event, and aggregate types. · `F4CIO.Restro.Entities/ChatRoom.cs`
- [Shared utilities](https://github.com/f4cio/restoranapplicationexample/blob/main/F4CIO.Restro.Common/DummyDataGenerator.cs): common support · Demo-data generation and formatting. · `F4CIO.Restro.Common/DummyDataGenerator.cs`

## Connections

- Client entry point → Angular application: bootstraps
- Angular application → Order API controller: HTTP requests
- Web host → Service setup: initializes
- Service setup → Order API controller: configures
- Web host → Angular application: serves / coordinates
- Order API controller → Order workflow: delegates orders
- Order API controller → Order contract: exchanges
- Order workflow → Handler base and factory: uses
- Order workflow → Order data handler: accesses
- Room workflow → Handler base and factory: uses
- Room workflow → Chat data handlers: accesses
- Order workflow → Order contract: uses contracts
- Room workflow → Chat contracts: uses contracts
- Order data handler → Data context: uses
- Chat data handlers → Data context: uses
- Data context → In-memory storage: reads / writes
- In-memory storage → Order contract: stores
- In-memory storage → Chat contracts: stores
- Shared utilities → In-memory storage: seeds demo data
