Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ src/
- `npm run build` - Compile TypeScript
- `npm start` - Run production build

### Deployment
Production runs the compiled Node.js server directly under **systemd** (not Docker).
The unit file is [`deploy/fhirtogether.service`](../deploy/fhirtogether.service).

- Install: `sudo cp deploy/fhirtogether.service /etc/systemd/system/ && sudo systemctl daemon-reload && sudo systemctl enable --now fhirtogether`
- Deploy update: `git pull && npm ci && npm run build && sudo systemctl restart fhirtogether`
- Logs: `journalctl -u fhirtogether -f`

Production deploys are **manual** (the steps above) — there is no CI job that
auto-deploys production. The `.github/workflows/pr-preview.yml` workflow still
builds Docker images for ephemeral per-PR preview containers via launchpad; the
`Dockerfile`/`docker-compose.yml` support those previews and local containerized
runs. `docker-compose.inferno.yml` is the separate Inferno test harness.

### API Endpoints
| Method | Path | Description |
|--------|------|-------------|
Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/deploy-production.yml

This file was deleted.

21 changes: 21 additions & 0 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,27 @@ npm run build
npm start
```

### Deploy with systemd

Production runs the compiled Node.js server directly under **systemd** (no Docker).
The unit file lives at [`deploy/fhirtogether.service`](deploy/fhirtogether.service).

```bash
# One-time install (adjust User/paths in the unit file if needed)
npm ci && npm run build
sudo cp deploy/fhirtogether.service /etc/systemd/system/fhirtogether.service
sudo systemctl daemon-reload
sudo systemctl enable --now fhirtogether.service

# Deploy a new version
git pull && npm ci && npm run build && sudo systemctl restart fhirtogether

# Follow logs
journalctl -u fhirtogether -f
```

Configuration is read from `.env` in the working directory (see [`.env.example`](.env.example)).

### Run Linter
```bash
npm run lint
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ npm run dev

Swagger UI: [http://localhost:4010/docs](http://localhost:4010/docs)

> **Production deployment** runs the compiled server directly under **systemd** (not Docker).
> See [Deploy with systemd](QUICKSTART.md#deploy-with-systemd) and the unit file at [`deploy/fhirtogether.service`](deploy/fhirtogether.service).

## 🧩 Pluggable Store Interface

**Important:** The store interface is **not** for connecting directly to your EHR or Practice Management system. Instead, it's a **working data repository** for the scheduling portal that holds appointment data representing schedules for providers/resources.
Expand Down Expand Up @@ -364,4 +367,3 @@ If you're modernizing a legacy EHR or want to contribute HL7v2 mappings, backend
## 🛡️ Project Goal

> Bring legacy scheduling infrastructure into the FHIR world — one appointment at a time.

23 changes: 23 additions & 0 deletions deploy/fhirtogether-reset.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# systemd unit to reset the local FHIRTogether environment.
#
# Thin wrapper around scripts/reset.sh so the exact same steps can be run
# locally (./scripts/reset.sh) and via systemd.
#
# Install (adjust User/paths if your checkout lives elsewhere):
# sudo cp deploy/fhirtogether-reset.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl start fhirtogether-reset.service

[Unit]
Description=Reset FHIRTogether Environment
Requires=fhirtogether.service
After=fhirtogether.service

[Service]
Type=oneshot
User=monika
WorkingDirectory=/home/monika/FHIRTogether
ExecStart=/home/monika/FHIRTogether/scripts/reset.sh

[Install]
WantedBy=multi-user.target
31 changes: 31 additions & 0 deletions deploy/fhirtogether.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# systemd unit for FHIRTogether Scheduling Synapse
#
# Runs the compiled Node.js server directly (no Docker). The server reads its
# configuration from the .env file in WorkingDirectory via dotenv.
#
# Install (adjust User/paths if your checkout lives elsewhere):
# sudo cp deploy/fhirtogether.service /etc/systemd/system/fhirtogether.service
# sudo systemctl daemon-reload
# sudo systemctl enable --now fhirtogether.service
#
# Deploy a new version:
# git pull && npm ci && npm run build && sudo systemctl restart fhirtogether
#
# Logs:
# journalctl -u fhirtogether -f

[Unit]
Description=FHIRTogether Scheduling Synapse (Node.js)
After=network.target

[Service]
Type=simple
User=monika
WorkingDirectory=/home/monika/FHIRTogether
Environment=NODE_ENV=production
ExecStart=/usr/bin/node dist/server.js
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
Loading
Loading