Skip to content
STACK IT FAST

Fasten Health

Curated OSSClassicPersonal Health Records & Medical EHR EngineSolo Developer

Audited from github.com/fastenhealth/fasten-onprem

Fasten Health (fasten-onprem) is a self-hosted, open-source personal health record manager: a Go and Gin backend storing HL7 FHIR data in SQLite, paired with an Angular frontend, shipped as one Docker image.

Language
Go
Database
SQLite
Hosting
Docker
License
GPL-3.0
Running for
2 years
Team
Solo Developer

Why this architecture

A single distroless Docker image embeds the Angular build inside the Go binary and defaults to file-based SQLite so a family can self-host medical records without provisioning a separate database or web server.

Tech stack by layer

5 technologies · audited Sep 17, 2026
Frontend & UI
  • AngularSingle-page frontend under frontend/, built with the Angular 14 CLI and served as static assets by the Go backend.
  • BootstrapBase CSS framework for the Angular UI, applied through ng-bootstrap components.
Backend & APIs
  • GoImplements the REST API, FHIR data handling, and the fasten CLI (start/migrate/user commands).
  • GinHTTP web framework serving the backend REST API.
  • GORMORM used against the SQLite, PostgreSQL, or MySQL database drivers.
Data & Persistence
  • SQLiteDefault embedded database engine, using a patched go-sqlite3 driver swapped in via a go.mod replace directive.
  • FHIRDomain data model: patient records are stored and queried as HL7 FHIR resources through the gofhir-models and fhirpath libraries.
Infrastructure & Deploy
  • DockerA multi-stage Dockerfile compiles the Angular frontend and the Go backend separately, then assembles them into one distroless runtime image.
  • GitHub ActionsRuns CI, Docker image builds, and CDN/cloud deploy workflows.

Fasten Health architecture diagram

Open SVG
Fasten Health architecture diagramWeb app → Fasten server (REST); fasten CLI → Fasten server (admin); Fasten server → Database (GORM); Fasten server → FHIR resources (store · query); Fasten server → fasten-sources (sync records); fasten-sources → Health providers (fetch FHIR)CLIENTSSERVICESWORKERS & JOBSDATA & STORAGEEXTERNALWeb appAngular · Bootstrapfasten CLIstart · migrate · userFasten serverGo · Gin · self-signed TLSfasten-sourcesprovider importsDatabaseSQLite / Postgres / MySQL (GORM)FHIR resourcesgofhir-modelsHealth providerspatient portalsRESTadminsync recordsGORMstore · queryfetch FHIR
How the main components of Fasten Health connect, drawn from the audited repository.
Diagram as text
  • Web app (Angular · Bootstrap) → Fasten server (Go · Gin · self-signed TLS): REST
  • fasten CLI (start · migrate · user) → Fasten server (Go · Gin · self-signed TLS): admin
  • Fasten server (Go · Gin · self-signed TLS) → Database (SQLite / Postgres / MySQL (GORM)): GORM
  • Fasten server (Go · Gin · self-signed TLS) → FHIR resources (gofhir-models): store · query
  • Fasten server (Go · Gin · self-signed TLS) → fasten-sources (provider imports): sync records
  • fasten-sources (provider imports) → Health providers (patient portals): fetch FHIR

Key architectural decisions

6 decisions
  1. 01

    Multi-stage Docker build compiles Angular and Go separately

    The Dockerfile has a frontend-build stage (node:20, yarn build) and a backend-build stage (golang:1.21, go build with -tags static), then copies both outputs into a gcr.io/distroless/static-debian11 final stage, producing a single binary image with no shell or package manager.

  2. 02

    A self-signed root CA is generated at first boot for HTTPS

    README.md describes Fasten generating its own "Fasten Health CA" certificate authority on first run and using it to sign a server certificate for localhost, with the resulting rootCA.pem written to the certs directory referenced by docker-compose.yml, so HTTPS works out of the box without an external certificate.

  3. 03

    SQLite ships with a patched driver instead of the upstream one

    go.mod replaces github.com/mattn/go-sqlite3 v1.14.17 with github.com/jgiannuzzi/go-sqlite3 at the same version tag, and gorm.io/driver/sqlite is the primary database driver alongside indirect gorm.io/driver/postgres and gorm.io/driver/mysql requirements for alternate backends.

  4. 04

    Third-party health-data import is factored into a separate fasten-sources module

    go.mod requires github.com/fastenhealth/fasten-sources as a versioned dependency (not vendored into this repo) alongside github.com/fastenhealth/gofhir-models, keeping the provider-integration and FHIR-model code independently releasable from the on-prem application.

  5. 05

    The Angular build output is embedded into the Go binary image, not served separately

    The Dockerfile copies the frontend build stage output from /usr/src/fastenhealth/dist directly into /opt/fasten/web in the final image, and the Go backend serves it as static files, so on-prem deployment is one container instead of separate frontend and backend services.

  6. 06

    This repo is the open-source on-prem app, distinct from commercial Fasten Connect

    README.md states this repo is the community-maintained, self-hosted Personal Health Record app, separate from Fasten Connect (a commercial, fully-managed API product); the on-prem app cannot import data directly from healthcare providers and instead relies on manually entered data or uploaded FHIR bundles.

How Fasten Health is built

How Fasten Health is structured

Fasten On-Prem is a two-directory monorepo: backend/ is a Go module (go.mod, module github.com/fastenhealth/fasten-onprem) exposing a REST API and a fasten CLI (backend/cmd), and frontend/ is an independent Angular application with its own package.json, angular.json, and yarn lockfile. The two are built separately and combined only at Docker-image time. This audited repository (fastenhealth/fasten-onprem) is explicitly the open-source, self-hosted Personal Health Record viewer; README.md notes it is maintained by the community and is a different product from the commercial, fully-managed Fasten Connect API. As of this audit the repository is archived on GitHub.

Frontend

The Angular app (frontend/package.json) targets Angular 14 (@angular/core ^14.1.3) with @angular/cdk, ng-bootstrap, and bootstrap for UI, chart.js/ng2-charts for dashboards, @swimlane/ngx-datatable and @circlon/angular-tree-component for structured data views, and fhirpath plus @types/fhir for working with FHIR resources directly in the client. Storybook (@storybook/angular) is configured for isolated component development, and dwv (DICOM Web Viewer) and rtf.js handle medical imaging and rich-text attachments respectively.

Backend & APIs

The Go backend (go.mod) uses Gin (gin-gonic/gin) for HTTP routing and GORM as its ORM, with github.com/go-gormigrate/gormigrate/v2 handling schema migrations. Authentication uses golang-jwt/jwt and lestrrat-go/jwx for JWT/JWK handling. FHIR resource parsing and storage go through github.com/fastenhealth/gofhir-models, and provider-specific data import connectors live in a separate, versioned dependency, github.com/fastenhealth/fasten-sources, rather than in this repository. PDF export uses johnfercher/maroto and pdfcpu/pdfcpu.

Data & persistence

GORM is configured against SQLite by default: go.mod replaces github.com/mattn/go-sqlite3 with a patched fork, github.com/jgiannuzzi/go-sqlite3, at the same pinned version. gorm.io/driver/postgres and gorm.io/driver/mysql are also present as indirect requirements, so the same data layer can target Postgres or MySQL, though SQLite is what docker-compose.yml provisions by default (mounting a local ./db volume into the container at /opt/fasten/db). Patient records are modeled as HL7 FHIR resources end-to-end — both the Go backend (gofhir-models) and the Angular frontend (fhirpath, @types/fhir) work with the same FHIR resource shapes rather than a custom schema.

Build, test & deploy

Dockerfile defines three stages: a node:20 stage that runs yarn install --frozen-lockfile and yarn run build for the Angular app, a golang:1.21 stage that runs go generate, go vet, go test, and go build -ldflags "-extldflags=-static" for the Go binary, and a final gcr.io/distroless/static-debian11 stage that copies only the compiled binary and the Angular build output into /opt/fasten. Makefile exposes the same steps individually (make test-backend, make test-frontend, make build-frontend-prod, make serve-docker) for local development. CI is defined in .github/workflows as ci.yaml, docker.yaml (image builds), release.yaml, cdn-deploy.yaml, and cloud-deploy.yaml.

Self-hosting notes

The project is designed primarily for self-hosting: docker-compose.yml and the published ghcr.io/fastenhealth/fasten-onprem:main image are the documented install path, with a set_env.sh script that detects the host's hostname and IP so companion mobile apps can discover the instance on the local network. HTTPS is enabled by default using a self-generated root CA ("Fasten Health CA", written to certs/rootCA.pem when running the production compose file) that must be imported into the browser or OS trust store on first connect, as documented step-by-step in README.md.

What to copy (and what not to)

Building the frontend and backend as independent modules that only meet inside a multi-stage Dockerfile — rather than a shared build tool spanning both — keeps each stack's tooling (Angular CLI, Go's own compiler) simple and lets either side be swapped without touching the other's build. Generating a self-signed CA at first boot so self-hosters get HTTPS without manual certificate setup is a pattern worth borrowing for any self-hosted app targeting non-technical users. The go.mod replace directive pinning a patched SQLite driver is a narrow, project-specific workaround and not something to copy generally; it exists to fix a specific upstream issue rather than as a design choice. Since this repository is archived, treat it as a frozen reference rather than an actively maintained upstream to track.

Sources & repo audit

Audited
Sep 17, 2026
Commit
36d9244
License
GPL-3.0

Independent analysis of repository at github.com/fastenhealth/fasten-onprem. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of Fasten Health
[![Tech stack of Fasten Health on STACK IT FAST](https://stackitfast.com/badge/fasten-health.svg)](https://stackitfast.com/project/fasten-health)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Fasten Health's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 60 lines · 7.2 KB
# MISSION: Scaffold "Fasten Health" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Fasten Health**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Fasten Health
- **What It Does**: Fasten Health (fasten-onprem) is a self-hosted, open-source personal health record manager: a Go and Gin backend storing HL7 FHIR data in SQLite, paired with an Angular frontend, shipped as one Docker image.
- **Domain & Category**: Personal Health Records & Medical EHR Engine
- **Production Scale**: Solo Developer
- **Development Mode**: CLASSIC
- **Architectural Rationale**: A single distroless Docker image embeds the Angular build inside the Go binary and defaults to file-based SQLite so a family can self-host medical records without provisioning a separate database or web server.
- **Live Website Reference**: https://fastenhealth.com
- **Source Repository**: https://github.com/fastenhealth/fasten-onprem
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Go, Angular, TypeScript, SQLite, FHIR
- **Primary Language(s)**: Go, TypeScript, HTML
- **License of the reference repo**: GPL-3.0
- **Frontend**: Angular — Single-page frontend under frontend/, built with the Angular 14 CLI and served as static assets by the Go backend.; Bootstrap — Base CSS framework for the Angular UI, applied through ng-bootstrap components.
- **Backend & APIs**: Go — Implements the REST API, FHIR data handling, and the fasten CLI (start/migrate/user commands).; Gin — HTTP web framework serving the backend REST API.; GORM — ORM used against the SQLite, PostgreSQL, or MySQL database drivers.
- **Data & persistence**: SQLite — Default embedded database engine, using a patched go-sqlite3 driver swapped in via a go.mod replace directive.; FHIR — Domain data model: patient records are stored and queried as HL7 FHIR resources through the gofhir-models and fhirpath libraries.
- **Infrastructure & deploy**: Docker — A multi-stage Dockerfile compiles the Angular frontend and the Go backend separately, then assembles them into one distroless runtime image.; GitHub Actions — Runs CI, Docker image builds, and CDN/cloud deploy workflows.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/fastenhealth/fasten-onprem @ 36d9244)
1. **Multi-stage Docker build compiles Angular and Go separately**: The Dockerfile has a frontend-build stage (node:20, yarn build) and a backend-build stage (golang:1.21, go build with -tags static), then copies both outputs into a gcr.io/distroless/static-debian11 final stage, producing a single binary image with no shell or package manager.
2. **A self-signed root CA is generated at first boot for HTTPS**: README.md describes Fasten generating its own "Fasten Health CA" certificate authority on first run and using it to sign a server certificate for localhost, with the resulting rootCA.pem written to the certs directory referenced by docker-compose.yml, so HTTPS works out of the box without an external certificate.
3. **SQLite ships with a patched driver instead of the upstream one**: go.mod replaces github.com/mattn/go-sqlite3 v1.14.17 with github.com/jgiannuzzi/go-sqlite3 at the same version tag, and gorm.io/driver/sqlite is the primary database driver alongside indirect gorm.io/driver/postgres and gorm.io/driver/mysql requirements for alternate backends.
4. **Third-party health-data import is factored into a separate fasten-sources module**: go.mod requires github.com/fastenhealth/fasten-sources as a versioned dependency (not vendored into this repo) alongside github.com/fastenhealth/gofhir-models, keeping the provider-integration and FHIR-model code independently releasable from the on-prem application.
5. **The Angular build output is embedded into the Go binary image, not served separately**: The Dockerfile copies the frontend build stage output from /usr/src/fastenhealth/dist directly into /opt/fasten/web in the final image, and the Go backend serves it as static files, so on-prem deployment is one container instead of separate frontend and backend services.
6. **This repo is the open-source on-prem app, distinct from commercial Fasten Connect**: README.md states this repo is the community-maintained, self-hosted Personal Health Record app, separate from Fasten Connect (a commercial, fully-managed API product); the on-prem app cannot import data directly from healthcare providers and instead relies on manually entered data or uploaded FHIR bundles.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (SQLite, FHIR): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a personal health records & medical ehr engine project?

Frequently asked about Fasten Health

What is Fasten Health built with?

Fasten On-Prem is a Go backend (Gin, GORM) with an Angular 14 frontend, storing patient records as HL7 FHIR resources in an embedded SQLite database by default, packaged into one distroless Docker image.

What database does Fasten Health use?

SQLite is the default, using a patched go-sqlite3 driver swapped in via a go.mod replace directive; the GORM ORM layer also supports PostgreSQL and MySQL drivers listed as indirect go.mod requirements.

Is Fasten Health self-hosted?

Yes, this repository (fastenhealth/fasten-onprem) is the self-hosted, open-source Personal Health Record app, distributed as a single Docker image; it is distinct from Fasten Connect, a separate commercial, fully-managed API product.

Is the Fasten Health repository still maintained?

The audited repository is archived on GitHub (pushed 2026-02-13, then archived), so it is a frozen, community-maintained snapshot rather than an actively released project as of the audit date.

How does Fasten Health import medical records?

The on-prem app supports manually entered data and uploaded FHIR bundles; direct provider integrations are implemented in a separate github.com/fastenhealth/fasten-sources Go module referenced in go.mod, not in this repository.

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md