Skip to content

Deploy via systemd + fix duplicate provider appointment cards#51

Open
pierzchala-m wants to merge 7 commits into
mainfrom
feat/systemd-deployment
Open

Deploy via systemd + fix duplicate provider appointment cards#51
pierzchala-m wants to merge 7 commits into
mainfrom
feat/systemd-deployment

Conversation

@pierzchala-m

Copy link
Copy Markdown
Collaborator

Summary

Two changes from this session:

1. feat(deploy): run the server under systemd instead of Docker

Production now runs the compiled Node.js server (node dist/server.js) directly
under systemd, replacing the previous Docker Compose deployment.

  • Adds deploy/fhirtogether.service (Type=simple, Restart=always, reads .env).
  • Documents install / update / logs commands in QUICKSTART.md.
  • References the deploy docs from README.md and .github/copilot-instructions.md (DRY — no duplicated command blocks).
  • Dockerfile / docker-compose.yml are 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. Verified active (running), /health{"status":"healthy","store":"sqlite"}, /scheduler/provider-view.html → HTTP 200.

2. fix(scheduler): de-duplicate booked slots in the provider appointment list

Booked 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 its
start/end. Free / unbooked slots are unaffected. Verified live in the provider view.

Test plan

  • npm run build succeeds
  • systemd service runs and serves port 4010
  • Provider view shows each booked time once (no Blocked+Busy duplication)

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.
Copilot AI review requested due to automatic review settings June 5, 2026 15:29
…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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread deploy/fhirtogether.service
Comment thread .github/copilot-instructions.md
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.
@pierzchala-m

Copy link
Copy Markdown
Collaborator Author

failing check due to mieweb/launchpad#18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants