Read in another language: English (this document) · Français.
Reusable skeleton for morfSystem services. Clone it, code the business logic in modules, and you get - for free - an HTTP API, a JSON config loader, a LAN announce (morfBeacon), a systemd service and a Windows service, all working first try.
It is distilled from morfSensor and morfNotify: same architecture, no domain code.
IModuleextension point - plug your business logic as one or more modules (a sensor, a notifier, a collector…). A workingExampleModuleships as a starting point.- HTTP API (GET + POST) -
GET /status(morfBeacon-compatible),GET /healthz,GET /modules,GET /modules/{id}, and aPOST /exampleshowing body parsing. - Config - JSON file with a
moduleslist; a factory turns it into modules. - LAN announce - morfBeacon heartbeat (bundled, no external dependency).
- Service install -
scripts/linux/(systemd) andscripts/windows/(Task Scheduler), copying binary + config to a fixed location. - Clone helper -
scripts/new-service.sh/.ps1scaffolds a renamed project.
scripts/new-service.sh morfwatch morfWatch # Linux/macOS
# scripts\new-service.ps1 morfwatch morfWatch # WindowsCreates ../morfWatch with every name replaced (morfTemplateService →
morfWatch, morftemplate → morfwatch, MORFTEMPLATE → MORFWATCH). It
compiles as-is. Then:
- Code your logic in
src/ExampleModule.*(rename it) - implementIModule. - Register your type(s) in
src/ModuleFactory.cpp+knownTypes(). - Adapt the HTTP routes (
src/HttpServer.cpp) and CMake source list. - Update the comments / config / docs.
Only needs Qt 6 (Core, Network). morfBeacon is vendored under
third_party/morf/beacon.
cmake --preset mingw # or linux / linux-arm64
cmake --build --preset mingw./build-mingw/service/morftemplate.exe # 'example' module fallback
curl http://127.0.0.1:8901/modules# Any platform: Linux, Windows, Raspberry Pi
sudo ./service.py install # build if needed, install, start
sudo ./service.py update # rebuild, replace the binary, restart
sudo ./service.py uninstall # deregister, keeping your configuration
./service.py status # what the system says about itOne entry point everywhere. What this service is -- its name, its directory,
its configurations -- is declared in service.json beside it; the four install
steps live once for the whole parc, and only the service manager differs by
platform (systemd, Windows, launchd).
French documentation in docs/fr/: architecture, and a
step-by-step guide to turn this template into your service.
GPL-3.0-only - © 2026 morfredus (Frédéric Biron).