Getting started
How to build, run and test Reeve from a checkout, and what a change has to pass before it is merged. The rules a change must keep are in constraints, and the project layout is in backend projects.
Prerequisites
The .NET 11 SDK, Node.js 26 and Docker with Compose. The Android head also needs the maui-android workload and
JDK 21. Everything restores from nuget.org and npmjs.com, so no package feed or token is needed.
Every project, the SDK packages included, targets net11.0 only (the properties in the root Directory.Build.props)
and compiles with runtime async.
Repository shape
| Path | Contains |
|---|---|
backend/src/Reeve.Domain |
Entities, the permission catalogue, business rules |
backend/src/Reeve.Application |
Use cases and interfaces. No infrastructure |
backend/src/Reeve.Infrastructure |
EF Core over TimescaleDB, MQTT, authentication, plugin host, workflow engine |
backend/src/Reeve.Api |
Controllers, SignalR hubs, composition root |
backend/src/Reeve.Contracts |
DTOs shared across the backend and mirrored in the SPA |
backend/src/Reeve.PluginAbstractions |
Plugin interfaces and shared plugin models |
backend/src/Reeve.PluginAuthoring |
Driver conveniences: canonical value maps, unit converters, typed device builders |
frontend/src |
features/ (domain slices), lib/ (HTTP, query, stores), contracts/ (DTO mirrors), test/ (fixtures, handlers, render helpers) |
mobile/Reeve.Mobile.Core |
Pure MVVM. No MAUI dependency, fully testable |
mobile/Reeve.Mobile |
MAUI UI bound to Core view models. Android |
services/ |
Adapter and bridge microservices, plus the shared wire-protocol contract packages they and their client plugins compile against |
deploy/ |
Docker Compose stacks, Helm chart, operator scripts |
tools/ |
Plugin development CLI and repository tooling |
templates/ |
The dotnet new plugin template |
docs/ |
Architecture, operations, reference and development documentation |
Reeve.slnx references the backend, service, tool and test projects and the mobile core and test projects; the two Android workload projects under mobile/ are built separately. There is no plugin source in this tree. Every
plugin, the shared blueprints, the shared widgets and the plugin index live in their own repositories under
github.com/reeve-iot and release on their own cadence. Nothing here references them
and nothing in the build assumes they are checked out next to this repository.
Running the stack
From deploy/, copy .env.example to .env, generate the secret files under deploy/secrets/ (signing keys, the
database password and the initial admin password), and start the stack:
cd deploy && cp .env.example .env
./scripts/bootstrap-secrets.sh
docker compose up -d # TimescaleDB, Redis, backend, frontend
That stack runs plugin workloads on the Manual provider. To have the backend run them on your Docker daemon, add
docker-compose.docker-workloads.yml as the Docker socket
describes. Deployment and configuration describe
every setting.
Reeve runs no MQTT broker, so an MQTT plugin needs one you start yourself. Run from source, a broker on localhost or
127.0.0.1 is refused as a loopback address, as it is for any plugin. To use one in development, list its exact
address as an IpAddress entry of the egress allowlist (the admin panel, or Managed:Egress in a directory of
Managed:Directory), or run the broker on a LAN or container-bridge address and name that. The same applies to the
core's own clients: an identity provider, registry mirror or webhook target on localhost needs its address listed.
The deploy/test-broker image is the broker fixture the test stacks use.
Build
dotnet build Reeve.slnx # backend, services and mobile core
dotnet build mobile/Reeve.Mobile/Reeve.Mobile.csproj -f net11.0-android # the Android head (optional)
cd frontend && npm ci && npm run build # the SPA (tsc -b && vite build)
For frontend development, npm run dev starts the Vite dev server. Image builds are in
image builds.
Test
Backend, from the repository root:
dotnet test Reeve.slnx --filter "FullyQualifiedName!~IntegrationTests" # unit tiers
dotnet test Reeve.slnx --filter "FullyQualifiedName~SomeTest" # one test or class
dotnet test Reeve.slnx --filter "FullyQualifiedName!~IntegrationTests" \
--settings backend/tests/coverage.runsettings --collect:"XPlat Code Coverage"
An unfiltered dotnet test Reeve.slnx also runs the integration projects, which start TimescaleDB, Redis and an MQTT
broker in containers. CI runs them on every push to main and every pull request, so run locally only the one or two integration
classes your change touches.
Frontend, from frontend/:
npm test # vitest, single pass
npm run test:watch
npm run lint
npm run typecheck # tsc -b, the same check the build runs
Mobile: dotnet test mobile/Reeve.Mobile.Tests. Tests on a device are in mobile development.
End to end: Playwright against a real containerised stack, described in end-to-end testing.
Writing tests
- Assert behaviour: that a call returns, refuses, routes or converges. A test that compares a constant with its own literal fails only when someone edits the constant, so assert the relation the value exists for instead.
- Do not read source or project files and match them against a pattern. Express a constraint where it is enforced:
a build property, an analyzer or a lint rule. The layering rules are in
backend/Directory.Build.targetsand the colour and scheme-awareness rules infrontend/eslint.config.js. - A test that asserts a refusal names the specific failure. A test that accepts any error also passes when the code breaks in an unrelated way.
Backend test conventions
- xUnit with FluentAssertions and NSubstitute.
- Integration tests run against real containerised TimescaleDB, Redis and MQTT through
WebApplicationFactory. SQLite is never used in any test, and an in-memory substitute for the database is not an integration test. - The EF InMemory provider is allowed only where the database does not matter to the behaviour under test, such as a
constructor that needs a context the code path never queries. InMemory evaluates LINQ in C# and ignores
transactions, foreign keys and column types, so a green InMemory test proves nothing about the SQL. If the
behaviour is the query itself, the test belongs to the matching
*.IntegrationTestsproject. A context that only has to exist can be built onUseNpgsqlwith a connection string it never opens. - Performance-bound tests are opt-in. A test whose pass depends on machine speed carries
[PerformanceFact]and is skipped unlessREEVE_RUN_PERFORMANCE_TESTS=1. CI never runs them. Run them locally before a change that could affect one, for exampleREEVE_RUN_PERFORMANCE_TESTS=1 dotnet test Reeve.slnx --filter "FullyQualifiedName~Latency". Reeve.Infrastructure.Testsruns its classes in parallel. A class that reads or changes process-wide state (GC counters, a static registry) joins a named non-parallel collection that states why, such asProcessGcStateCollection. A failure only a parallel run shows is a test defect, never a reason to serialise the assembly.- Every test project under
backend/andtools/gets a private temporary directory, set up bybackend/tests/Shared/TestTempRoot.csand removed when the test process exits.Path.GetTempPath()and child processes write inside it, so a test needs noDisposefor hygiene and does not hard-code/tmp. - Changing a database statement is judged by evidence in the pull request, not by a test.
tools/sql-plan-compare/compares the plans of an old and a new statement on a local copy of a database dump you supply (build-dataset.shrebuilds it), andbackend/tests/Shared/RoundTripCounter.csandHotPathComparison.cscount round trips and compare client-side time and allocations.
Frontend and mobile test conventions
Frontend: Vitest with Testing Library. API calls are mocked with MSW. Use the shared render wrapper so every
provider is present. Mobile: see mobile development.
Coding conventions
- Backend (.NET 11).
NullableandImplicitUsingsare on. Configuration goes through the options pattern. Custom exceptions are grouped per feature in*Exceptions.cs. Migrations are described in backend projects. - Frontend (TypeScript).
strict: true, plusnoUnusedLocals,noUnusedParametersandnoUncheckedSideEffectImports. ESLint runstypescript-eslintrecommended plus the React hooks and React refresh plugins..tsand.tsxonly, with no.jsundersrc/. Feature code lives insrc/features/, shared code insrc/lib/and DTO mirrors insrc/contracts/. See frontend. - Mobile.
Reeve.Mobile.Corestays free of MAUI types so it is testable on any host. - Placeholders, not real hosts. A fixture that needs a name uses
registry.example,example.comoroctocat/.... The product's own identifiers (the seeded index host, the OCI registry and the Android application id) stay.
Commits and pull requests
Commit messages follow Conventional Commits: type(scope): description.
Types are feat, fix, refactor, test, docs, chore, style and perf. Scopes are backend, frontend,
mobile, plugin, docs and ci. The first line stays under 72 characters, in the imperative mood. A breaking
change carries BREAKING CHANGE: in the footer.
Open a pull request against main when the branch is ready to merge: the implementation is finished, and the
tests pass. Rebase onto the newest main first. CI (.github/workflows/ci.yml) builds
the solution and runs the unit, integration, frontend, Matter bridge and chart checks. Update the documentation the
change affects: new behaviour in requirements, a hard rule in
constraints, component detail on the matching reference
page, an operator procedure under operations.
Writing a plugin
Plugins live in their own repositories and compile against the released SDK packages, never against a local project reference. Start with the plugin contribution kit. The development CLI and test kit are documented beside it, and plugin trust explains what operators look for before they trust a publisher.