Health App Architecture B
Architecture B implements the approved modular monolith: one ASP.NET Core HTTPS application, typed Profile/Observations/Analytics/Overview/Guidance modules, and one PostgreSQL database with owned schemas. API/access enforces normalized patient/professional identity and actual resource ownership. Numerical calculations, clinical content and public REST/JSON semantics are preserved from the pinned Architecture A reference, with the approved US-16 and dependency-failure revisions.
Approval and implementation evidence are in ImplementationPlan; the authoritative target remains ArchitectureProposal. Approval decisions include portable Linux installation. Input requirements/diagrams and the original repository remain unchanged. No frontend, identity server, background worker, broker or clinical-result store was introduced.
Build and test
Use the .NET 10 SDK selected by global.json:
dotnet restore HealthApp.slnx
dotnet build HealthApp.slnx -c Release
TEST_POSTGRES_CONNECTION='Host=127.0.0.1;Database=postgres;Username=TEST_ADMIN;Password=YOUR_TEST_PASSWORD' \
dotnet test HealthApp.slnx -c Release
Optional automatic disposable-server harness: HEALTHAPP_DOTNET=/path/to/dotnet python3 tools/run-disposable-tests.py (requires administrative Docker access for test infrastructure only).
Use only a disposable test PostgreSQL server with create/drop database and role permissions. Fixtures create isolated databases and DML-only runtime roles, apply module schema scripts twice, exercise real Kestrel HTTP, and remove their own resources. Do not point tests at Architecture A or production databases. Framework/provider/EF/xUnit versions remain pinned; no algorithm replacement or technology migration is included.
The unchanged executable source/test baseline lives under Reference/ArchitectureA, copied from 2117236366130775214d9fd2611984d4348f2b79. It is excluded from the final B solution and preserves original architecture-specific tests. Never build/test in ../HealthAppRepository/.
Deploy and run
bash deploy/build-release.sh --output NEW_RELEASE_DIRECTORY
# In the new bundle on a supported systemd Linux host:
sudo bash install.sh --host YOUR_DNS_OR_IP
The installer supplies dependencies, fresh database/roles/schemas, protected secrets/configuration, generated or supplied HTTPS certificate, persistent token keys, migrations and healthapp-b.service. It verifies representative operations and application stop/restart without stopping PostgreSQL. Remote database mode requires verified TLS/hostname and installs no local PostgreSQL. See installation guide.
For an already provisioned B development database, supply external accounts/assignments, connection, key directory and HTTPS settings through HEALTHAPP_CONFIGURATION_FILE=/absolute/protected/appsettings.json or normal .NET configuration. Configuration example is illustrative, not a prepared credential file. Production rejects plain HTTP. Use dotnet run --project src/HealthApp -c Release; the app never applies migrations itself.
Trend methods describe unchanged formulas, timestamp ties, full-period direction/variation and clinical limits. Conformance, functional verification and test adaptations distinguish executed evidence from limitations. Native Debian 12 systemd local/remote installation was exercised in isolated Linux environments; other distribution adapters are intended support with explicit prerequisites.
This repository remains part of the thesis research. Installation/testing is not an energy experiment or clinical certification. Measurement context records environment differences and equivalent reproducible synthetic dataset setup. Clinical classifications are preserved for comparison; uncertain provenance is documented without asserting new clinical validity.