Server Architecture Overview
The @archibald/server package is the backbone of the framework. It orchestrates the environment setup, the structural inheritance between the core and project implementations, and the runtime request-to-render lifecycle.
High-Level Architecture
This diagram shows the complete landscape of the Archibald server, from external data sources to the underlying Hapi.js engine and the template implementation.
Architectural Phases
To understand the server in depth, we break its operation into three distinct phases:
- Bootstrap Phase: Configuration loading and secret interpolation.
- Structural Phase: The inheritance model between the framework and project implementations.
- Runtime Phase: The request lifecycle and SSR pipeline.
Core Component Deep Dives
- Factory: Server instantiation entry point.
- CoreServer: The foundational base class.
- ConfigService: Settings and environment management.
- Decorators: Request context enrichment middleware.
- Wiring: Services, Controllers, and Plugins.
- EnvironmentHelper:
.envandprocess.envmanagement. - Renderer: The isomorphic React streaming engine.