Request Lifecycle
Every Flowra request follows the same pipeline, which keeps behavior consistent and easy to reason about.
Startup flow
flowra serveloadsapp/Bootstrap/server.bootstrap.js.buildContainer()composes the container by calling:registerCore()(config, logger, validation)registerInfrastructure()(database, cache, queue, mailer)registerModules()(module scopes and routes)
- Express is configured with middleware (helmet, compression, parsers, static files).
- Module routes are registered via
app/Http/http.router.js. - Not-found and error handlers are attached.
- Providers listed in
app/Config/App.jsare loaded.
Per-request flow
Incoming request
-> RequestContextMiddleware (request ID, logger, timing)
-> CORS + Morgan logging
-> Module routes
-> Controller -> Service -> Model/Query
-> Response
-> ErrorHandler (if an exception occurs)
Key files
app/Bootstrap/server.bootstrap.js- Express setup and middleware.app/Bootstrap/Container/compose.js- Container composition.app/Http/http.router.js- Route registration across modules.app/Http/Middleware/ErrorHandler.js- Consistent JSON error responses.
Provider hook
Providers are a convenient place to register app-wide listeners or boot tasks. Add them in app/Config/App.js.