Skip to content
Ákos Kappel
Language: en
Theme
Light
Dark

Ambulance Devices

Register of hospital medical devices: a Stencil micro-frontend and a Go API, first deployed to Kubernetes through GitOps.

Live demoSource code

Runs on my home server, so it may be offline now and then (for example during a power or internet outage).

Homepage of Ambulance Devices with device count, total value and value by department

About the project

A university team project from the Web Applications in the Cloud course at FIIT STU in 2024. Each device in a hospital department has a registration number, a price, a warranty date and its own operations log. The frontend is a Stencil web component loaded into the course's shared portal, the backend a Go API with MongoDB generated from an OpenAPI specification, and Flux CD deployed both to Kubernetes on Azure.

Today it runs as a live demo on my home server. It has a homepage with an overview, an About page, English next to Slovak, dark mode, a safer API and CI that builds the images.

What you can try

  • An overview of device count, total value and warranties ending soon, with value per department
  • Search, filters by department and warranty state, sorting, and the filters kept in the URL
  • Warranty state at a glance: valid, ending within 90 days or expired
  • A device form and an operations log, validated in the browser and in the API
  • A change history of each device's fields, and log entries typed as purchase, installation, service, calibration or repair
  • A service plan: a service log entry moves the next date, due devices show in a calendar and in the header, and the dates export to a calendar app
  • Departments with floor and head of department; one that still has devices can't be deleted
  • A printable device label with a QR code, a Ctrl+K command palette, and an installable app whose visited pages work offline
  • CSV export, Slovak and English, dark mode, and the API documentation in Swagger UI

Under the hood

  • One OpenAPI specification generates both the Go server stubs and the TypeScript client; CI fails when the generated code is out of date
  • Device and log changes are single atomic MongoDB updates, and the API validates input and keeps internal errors out of responses
  • GitHub Actions runs the Go tests against a MongoDB service container, the frontend spec and end-to-end tests, govulncheck and npm audit, and pushes the images to GHCR
  • Docker Compose with nginx (Content-Security-Policy, rate limits), a non-root API, structured JSON logs and a nightly demo reset
  • The service plan is a second micro-frontend with its own Stencil build; the overview comes from one MongoDB aggregation and the list of due devices is also computed in the database
  • The API and the reset job connect to MongoDB as a user limited to their own database, not as root

Architecture

  1. 1BrowserStencil web components with Material Web
  2. 2Tailscale FunnelPublic HTTPS from a sidecar container
  3. 3nginxServes the built frontend and proxies /api
  4. 4Go APIGin handlers on stubs generated from the OpenAPI specification
  5. 5MongoDBDevices with their logs; a reset container restores the demo every night

Changelog

  • Kubernetes and Flux replaced by Docker Compose on a home server
  • Gin 1.9 to 1.12 and MongoDB 7 to 8
  • Stencil 4.12 to 4.45 and Material Web 1 to 2
  • The axios client became a generated fetch client
When
2024 – 2026
Type
Team
Versions
  • Stencil 4.45
  • Go 1.27
  • Gin 1.12
  • MongoDB 8
Stack
  • Stencil.js
  • TypeScript
  • Go
  • Gin
  • MongoDB
  • OpenAPI
  • Docker
  • Kubernetes
  • Flux
  • Tailscale
  • GitHub Actions
Device list filtered to warranties ending within 90 days, sorted by warranty end, with service dates
The device list filtered to warranties ending soon; the filters stay in the URL.
Device page of an MRI scanner in the dark theme with its form, service interval and next service date
A device page in the dark theme, with the form and its service plan.
Change history and operations log of a device, with entries for purchase, installation and service
The change history and the operations log, filterable by entry type.
Service plan as a month calendar with devices due for service and an export to calendar button
The service plan as a calendar, with an export to calendar apps.
Departments as cards with code, floor, head of department and number of devices
Departments with floor and head of department, each linking to its devices.

1 of 5

Device list filtered to warranties ending within 90 days, sorted by warranty end, with service dates

The device list filtered to warranties ending soon; the filters stay in the URL.