How f4cio/world works
Purpose and Entry Points
InfoCompass.World is a layered application skeleton for a production-style web system, demonstrated by BookSynth. It provides Angular screens, an ASP.NET Core Web API, user/account flows, city management, logging, and file-system-backed persistence. Server startup is InfoCompass.World.UiWebApi/Program.cs; browser startup is InfoCompass.World.UiAngular/src/main.ts. The solution root is InfoCompass.World.sln.
Client Application
The Angular application is organized as routed feature modules with a shared shell and centralized core services. InfoCompass.World.UiAngular/src/app/app.module.ts and InfoCompass.World.UiAngular/src/app/app-routing.module.ts assemble the application. Account/auth flows live under InfoCompass.World.UiAngular/src/app/features/auth/ and InfoCompass.World.UiAngular/src/app/features/account/; the dashboard/library provide primary authenticated UI areas. HTTP authentication and loading behavior are boundary concerns handled by InfoCompass.World.UiAngular/src/app/core/interceptors/auth.interceptor.ts and InfoCompass.World.UiAngular/src/app/core/interceptors/spinner.interceptor.ts.
API Boundary and Request Handling
The ASP.NET Core API exposes controllers and translates application responses to UI-oriented response models. Main endpoint surfaces are InfoCompass.World.UiWebApi/Controllers/UsersController.cs, InfoCompass.World.UiWebApi/Controllers/CitiesController.cs, and InfoCompass.World.UiWebApi/Controllers/Endpoints1.cs. Authentication logic is separated in InfoCompass.World.UiWebApi/Logic/HandlerForAuthentication.cs; request logging context is injected through InfoCompass.World.UiWebApi/Middleware/SerilogUserContextMiddleware.cs. The generated client contract is consumed by the frontend at InfoCompass.World.UiAngular/src/app/shared/api-client.generated.ts.
Business-Layer Composition
Business services implement use cases and coordinate persistence, settings, authentication, email, and logging. Dependency composition is centered at InfoCompass.World.BusinessLogic/CompositionRoot.cs. Key services include InfoCompass.World.BusinessLogic/ServiceForUsers.cs, InfoCompass.World.BusinessLogic/ServiceForJwts.cs, and InfoCompass.World.BusinessLogic/ServiceForEMails.cs. This layer is the principal boundary between HTTP concerns and data-access implementations.
Shared Domain Contracts
InfoCompass.World.Common carries cross-layer entities, request/response models, errors, configuration, and shared validation. Important domain records include InfoCompass.World.Common/Entities/IEntity/User.cs, InfoCompass.World.Common/Entities/IEntity/Jwt.cs, and InfoCompass.World.Common/Entities/ServerRequestModels.cs. These types allow the API, business layer, and persistence implementations to communicate without UI-specific dependencies.
Persistence and Operational Data
Persistence is abstracted behind interfaces in InfoCompass.World.DataAccessContracts/, including IServiceForUsers.cs, IServiceForJwts.cs, and IServiceForLogs.cs. The supplied implementation stores entities through the file system, composed in InfoCompass.World.DataAccessByFileSystem/CompositionRoot.cs and implemented by services such as ServiceForUsers.cs and ServiceForEntities.cs. This makes data storage replaceable at the business-layer boundary.
Infrastructure and External Services
The runtime stack is .NET/ASP.NET Core plus Angular/Node.js. Application configuration and SMTP credentials are held in InfoCompass.World.BusinessLogic/Data/Settings.json; SMTP is required for registration and password reset flows. JWT issuance supports authenticated requests, while logging has file-per-user/job and database-oriented service variants in InfoCompass.World.BusinessLogic/ServiceForLogSink_FilePerUserPerJob.cs and InfoCompass.World.BusinessLogic/ServiceForLogSink_Db.cs. CraftSynth.BuildingBlocks.Generated/ is a shared generated utility library supplying HTTP, serialization, logging, encryption, and I/O primitives.
Main entry points: ServiceForUsers.cs User, JWT and email services · Program.cs API host · UsersController.cs Users, cities and endpoints · CompositionRoot.cs File-system composition
Components 19
Angular client
- Angular bootstrap
InfoCompass.World.UiAngular/src/main.ts - App shell and routing · Assembles routed feature modules.
InfoCompass.World.UiAngular/src/app/app.module.ts - Auth, account and library UI · Primary public and authenticated screens.
- HTTP auth and spinner
InfoCompass.World.UiAngular/src/app/core/interceptors/auth.interceptor.ts - Generated API client
InfoCompass.World.UiAngular/src/app/shared/api-client.generated.ts
ASP.NET Core API
- API host
InfoCompass.World.UiWebApi/Program.cs - Users, cities and endpoints · Maps HTTP requests to UI response models.
InfoCompass.World.UiWebApi/Controllers/UsersController.cs - Authentication handler
InfoCompass.World.UiWebApi/Logic/HandlerForAuthentication.cs - User logging context
InfoCompass.World.UiWebApi/Middleware/SerilogUserContextMiddleware.cs
Application core
- Business composition · Wires use cases to replaceable infrastructure.
InfoCompass.World.BusinessLogic/CompositionRoot.cs - User, JWT and email services · Coordinates accounts, authentication, settings, email and storage.
InfoCompass.World.BusinessLogic/ServiceForUsers.cs - Domain contracts · Entities, request/response models, errors and validation.
InfoCompass.World.Common/Entities/ServerRequestModels.cs - Application settings · Includes SMTP configuration.
InfoCompass.World.BusinessLogic/Data/Settings.json - Log sinks · Supports file-per-user/job and database variants.
InfoCompass.World.BusinessLogic/ServiceForLogSink_FilePerUserPerJob.cs
Persistence
- Data access interfaces · Abstracts users, JWTs and logs storage.
- File-system composition
InfoCompass.World.DataAccessByFileSystem/CompositionRoot.cs - File-system entity services
InfoCompass.World.DataAccessByFileSystem/ServiceForEntities.cs
Other components
- SMTP service · Used for registration and password reset.
- Generated building blocks · Provides HTTP, serialization, logging, encryption and I/O primitives.
Connections 21
- Angular bootstrap → App shell and routing: starts
- App shell and routing → Auth, account and library UI: routes to
- Auth, account and library UI → HTTP auth and spinner: uses HTTP pipeline
- HTTP auth and spinner → Generated API client: wraps requests
- Generated API client → Users, cities and endpoints: calls
- API host → User logging context: installs
- API host → Authentication handler: configures
- API host → Users, cities and endpoints: hosts
- Users, cities and endpoints → User, JWT and email services: invokes
- Authentication handler → User, JWT and email services: validates through
- Business composition → User, JWT and email services: wires
- User, JWT and email services → Domain contracts: uses
- User, JWT and email services → Data access interfaces: depends on
- User, JWT and email services → Application settings: reads
- User, JWT and email services → SMTP service: sends email via
- User, JWT and email services → Log sinks: emits logs to
- File-system composition → Data access interfaces: implements
- File-system composition → File-system entity services: wires
- File-system entity services → Domain contracts: stores entities
- API host → Generated building blocks: uses utilities
- User, JWT and email services → Generated building blocks: uses utilities