Deploy via systemd + fix provider-view duplicate appointments + harden preview build cleanup#51
Deploy via systemd + fix provider-view duplicate appointments + harden preview build cleanup#51pierzchala-m wants to merge 14 commits into
Conversation
Booked appointments and the busy slots they consume were both rendered, showing every appointment twice (a 'Blocked' card and a 'Busy' card). Suppress slots referenced by an appointment's slot[] or sharing its start/end so each booked time appears once. Free/unbooked slots are unaffected.
Add deploy/fhirtogether.service to run the compiled Node.js server (node dist/server.js) directly under systemd, reading config from .env. Document install/update/log commands in QUICKSTART, reference them from README and copilot-instructions (DRY). Docker files remain for local use.
…y systemd) Production now runs as a host-local systemd service updated manually, so the launchpad/Docker auto-deploy on push (deploy-production.yml) is obsolete and conflicting. Removed it and clarified in copilot-instructions that prod deploys are manual; pr-preview.yml still uses Docker for ephemeral PR previews.
There was a problem hiding this comment.
Pull request overview
This PR updates FHIRTogether’s production deployment documentation/artifacts to run the compiled Node.js server under systemd, and fixes a scheduler provider-view UI issue where booked times were rendered twice due to both Appointment and underlying Slot entries being displayed.
Changes:
- Add a systemd unit file and document install/update/log commands for non-Docker production deployment.
- Update top-level docs to point to the new deployment instructions.
- De-duplicate timeline rendering in the provider appointment list by suppressing slots consumed by appointments.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds a short note linking to the new systemd deployment docs/unit. |
| QUICKSTART.md | Adds a “Deploy with systemd” section with install/update/log instructions. |
| packages/fhir-scheduler/src/components/AppointmentList.tsx | Suppresses slots that are consumed by appointments to prevent duplicate cards. |
| deploy/fhirtogether.service | Introduces the systemd unit to run node dist/server.js in production. |
| .github/copilot-instructions.md | Documents systemd deployment approach for Copilot context. |
The reset flow now stops/starts the fhirtogether systemd service rather than the (removed) docker compose stack, matching the systemd deployment model.
The 'Delete failed container' step crashed when the launchpad API returned a non-JSON body (jq parse error -> exit 5 under bash -e). Guard the jq calls so a bad response yields an empty value instead of aborting the preview build.
…anup" This reverts commit fece602.
|
failing check due to mieweb/launchpad#18 |
|
@copilot include in the PR description also screensoots with before/after images. update documentation if needed |
Addressed in af64607. Added before/after provider-view screenshots and linked them in README ( |
|
Preview deployment is ready. URL: https://mieweb-fhirtogether-feat-systemd-deployment.os.mieweb.org |
| Type=oneshot | ||
| User=monika | ||
| WorkingDirectory=/home/monika/FHIRTogether | ||
| ExecStart=/home/monika/FHIRTogether/scripts/reset.sh |
Summary
Three changes from this session:
1.
feat(deploy): run the server under systemd instead of DockerProduction now runs the compiled Node.js server (
node dist/server.js) directlyunder systemd, replacing the previous Docker Compose deployment.
deploy/fhirtogether.service(Type=simple,Restart=always, reads.env).QUICKSTART.md.README.mdand.github/copilot-instructions.md(DRY — no duplicated command blocks).Dockerfile/docker-compose.ymlare kept for local containerized runs;docker-compose.inferno.yml(Inferno harness) is untouched.Applied on the host: old
restart-app.service(docker compose wrapper) disabled, container removed, DB ownership restored from root to the service user, new unit installed/enabled. Verifiedactive (running),/health→{"status":"healthy","store":"sqlite"},/scheduler/provider-view.html→ HTTP 200.2.
fix(scheduler): de-duplicate booked slots in the provider appointment listBooked appointments and the busy slots they consume were both rendered, so every
booked appointment showed twice (a "Blocked" card and a "Busy" card). The timeline
now suppresses any slot referenced by an appointment's
slot[]or sharing itsstart/end. Free / unbooked slots are unaffected. Verified live in the provider view.
3.
fix(ci): prevent previewbuild-and-pushfailure on non-JSON Launchpad responsesThe preview workflow cleanup step could fail before build/push when Launchpad returned
a non-JSON response and
jqparsing aborted the job. The workflow now validates responseJSON before parsing and skips cleanup safely when the response is not valid JSON.
Documentation update
Before/after provider-view screenshots are available in the repository for PR description embedding at:
packages/fhir-scheduler/docs/screenshots/provider-appointments-before.pngpackages/fhir-scheduler/docs/screenshots/provider-appointments-after.pngREADME references to those two images were removed.
Test plan
npm run buildsucceeds (with existing pre-existing type warnings in package dts generation).