Skip to main content
Hero Light

Welcome to EPR LAPS Backend API

The EPR LAPS Backend is a Node.js API service built on the Hapi framework, designed for managing local authority payment scheme data including bank details verification and financial document management.

Bank Details API

Secure endpoints for managing and verifying local authority bank details with role-based access control

Documents API

Retrieve financial document metadata and access payment-related documents for local authorities

Authentication

JWT-based authentication with Defra ID integration and fine-grained permission controls

Deployment

Production-ready Docker containers with Docker Compose for local development environments

Bank Details Endpoints

The API provides comprehensive bank details management with encrypted storage and role-based access:
curl http://localhost:3001/bank-details/LA123 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Bank details are encrypted using the FSS encryption key configured via FSS_API_ENCRYPTION_KEY environment variable.

Documents Endpoints

Access financial documents and metadata for local authorities:
curl http://localhost:3001/documents/LA123 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Authentication

The API uses JWT authentication with Defra ID integration:
// Configuration in config.js
auth: {
  discoveryUrl: 'http://localhost:3200/cdp-defra-id-stub/.well-known/openid-configuration',
  issuer: 'http://localhost:3200/cdp-defra-id-stub'
}

Role-Based Permissions

Access control is enforced through role-based permissions:
  • CEO: Full access to view, create, and confirm bank details; access all documents
  • WO: Can confirm bank details and access documents
Ensure proper role configuration via environment variables: VIEW_FULL_BANK_DETAILS, CONFIRM_BANK_DETAILS, CREATE_BANK_DETAILS, LIST_FINANCE_DOCUMENTS, and ACCESS_FINANCE_DOCUMENT.

Docker Deployment

The API is containerized and ready for production deployment:
# Production build
docker build --no-cache --tag epr-laps-backend .

# Run production container
docker run -e PORT=3001 -p 3001:3001 epr-laps-backend

Local Development Stack

Use Docker Compose for a complete local environment with MongoDB, Redis, and Localstack:
docker compose up --build -d
This starts:
  • EPR LAPS Backend API
  • MongoDB database
  • Redis cache
  • Localstack (S3, SQS)

Core Technologies

  • Framework: Hapi.js 21.4.6
  • Runtime: Node.js >= 22.16.0
  • Database: MongoDB with connection pooling
  • Authentication: JWT with hapi-auth-jwt2
  • Logging: Pino with ECS formatting
  • Validation: Joi schemas
  • Testing: Vitest with coverage

Next Steps

Quick Start

Get the API running locally in minutes

Installation

Detailed installation and configuration guide

Build docs developers (and LLMs) love