#pragma once // Demo application assembly: shared Services (the DI skeleton), the root // Application with middleware, routers, and mounted sub-applications. // Gap: real molo::di::Container and plugin registry in 05-request-routing.md. #include #include #include #include "../fw/App.hpp" #include "../fw/Data.hpp" #include "../fw/Jobs.hpp" #include "../fw/Kv.hpp" #include "../fw/Net.hpp" #include "../fw/Observ.hpp" #include "../fw/Templates.hpp" namespace molo::example::app { struct Services { std::shared_ptr kv = std::make_shared(); std::shared_ptr cache = std::make_shared(); std::shared_ptr pubsub = std::make_shared(); std::shared_ptr events = std::make_shared(); std::shared_ptr metrics = std::make_shared(); std::shared_ptr telemetry = std::make_shared(); std::shared_ptr sessions = std::make_shared(); std::shared_ptr auth = std::make_shared(); std::shared_ptr sqlite = std::make_shared(fw::OrmBackend::Sqlite); std::shared_ptr postgres = std::make_shared(fw::OrmBackend::Postgres); std::shared_ptr uploads = std::make_shared(); std::shared_ptr webdav = std::make_shared(); std::shared_ptr supervisor = std::make_shared(); std::shared_ptr tasks = std::make_shared(); std::shared_ptr repl = std::make_shared(); std::shared_ptr openapi = std::make_shared(); std::shared_ptr templates = std::make_shared(); std::map embedded; std::string static_root = "example/static"; std::string cookie_secret = "living-example-secret"; }; std::shared_ptr build_application(Services& services); void register_index(fw::Router& router, Services& services); void register_routing_demo(fw::Router& router, Services& services); void register_chain_demo(std::shared_ptr app, Services& services); void register_data_demo(fw::Router& router, Services& services); void register_security_demo(fw::Router& router, Services& services); void register_formats_demo(fw::Router& router, Services& services); void register_realtime_demo(fw::Router& router, Services& services); void register_ops_demo(fw::Router& router, Services& services); void load_templates(Services& services); void load_embedded(Services& services); void seed_services(Services& services); } // namespace molo::example::app