HMCTS Express Monorepo Template
A comprehensive monorepo template that demonstrates best practices for building HMCTS digital services using Express.js, TypeScript, and GOV.UK Design System.
Cloud Native Platform
Features for cloud deployment and operations:
-
Health Checks
Configurable health endpoints with readiness and liveness probes for Kubernetes deployments
-
Azure Integration
Built-in support for Azure Key Vault secrets management and properties volume mounting
-
Application Insights
Comprehensive monitoring with Azure Application Insights including custom metrics and distributed tracing
-
Properties Volume
Secure configuration management through mounted volumes with automatic environment variable injection
GOV.UK Starter
Everything you need to build GDS services:
-
GOV.UK Design System
Fully integrated GOV.UK Frontend with Nunjucks templates and automatic asset compilation
-
Internationalization
Welsh language support with locale middleware and translation management system
-
Session Management
Flexible session storage with Redis and PostgreSQL support for distributed applications
-
Cookie Manager
Built-in cookie management with consent tracking and preference handling
-
Security Headers
Pre-configured Helmet.js with CSP, HSTS, and nonce-based script protection
-
Asset Pipeline
Vite-powered asset compilation with SCSS support and production optimization
Simple Router
Lightweight file-system router inspired by Next.js:
File-based Routing
Maps files in directories to Express routes automatically with zero configuration
Dynamic Parameters
Support for dynamic route segments using [param] syntax (e.g., /users/[id])
HTTP Method Exports
Export handlers for any HTTP method (GET, POST, PUT, DELETE, etc.) directly from route files
Middleware Support
Single handlers or arrays of middleware for complex request pipelines
Multiple Mount Points
Mount different directories with different URL prefixes for modular applications
Zero Dependencies
Lightweight implementation with no external dependencies, built for performance
Monorepo Architecture
Organized for scalability and maintainability:
- Workspace-based structure with Yarn workspaces
- Shared libraries for common functionality
- Simple Router package for file-based routing
- TypeScript with strict mode and ES modules
- Comprehensive testing with Vitest and Playwright
- Docker multi-stage builds for production
- Helm charts for Kubernetes deployment
- GitHub Actions CI/CD pipeline
- Biome for fast linting and formatting
Learn More
Explore the codebase and documentation to understand the full capabilities of this template.
Example Form
See how multi-page forms work with validation and session management.