How f4cio/restoranapplicationexample works
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: HandlerForOrders.cs Order workflow · OrderController.cs Order API controller · MemoryStorage.cs In-memory storage · HandlerForRooms.cs Room workflow
Components 15
Angular client
- Angular application · Restaurant ordering client shell.
F4CIO.Restro.UIWeb/ClientApp/src/app/app.module.ts - Client entry point
F4CIO.Restro.UIWeb/ClientApp/src/main.ts
ASP.NET Core web
- Web host · Composes server and application services.
F4CIO.Restro.UIWeb/Program.cs - Service setup
F4CIO.Restro.UIWeb/Startup.cs - Order API controller · Thin HTTP boundary for ordering.
F4CIO.Restro.UIWeb/Controllers/OrderController.cs
Business layer
- Order workflow · Core ordering orchestration.
F4CIO.Restro.BusinessLogic/HandlerForOrders.cs - Room workflow
F4CIO.Restro.BusinessLogic/HandlerForRooms.cs - Handler base and factory · Provides common behavior and lower-layer handler access.
F4CIO.Restro.BusinessLogic/HandlersFactory.cs
Data layer
- Order data handler
F4CIO.Restro.Data/HandlerForOrders.cs - Chat data handlers · Room and chat-event persistence operations.
F4CIO.Restro.Data/HandlerForRooms.cs - Data context
F4CIO.Restro.Data/ApiContext.cs - In-memory storage · Current persistence implementation; no database is present.
F4CIO.Restro.Data/MemoryStorage.cs
Other components
- Order contract
F4CIO.Restro.Entities/Order.cs - Chat contracts · Chat room, item, event, and aggregate types.
F4CIO.Restro.Entities/ChatRoom.cs - Shared utilities · Demo-data generation and formatting.
F4CIO.Restro.Common/DummyDataGenerator.cs
Connections 19
- 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