How hmcts/nfdiv-frontend works
nfdiv-frontend is an Express web application for citizens applying for divorce and managing related court applications. A user enters through the routed step journeys, provides eligibility, jurisdiction and application details, then pays and submits; later journeys include service applications, evidence uploads and case updates. Controllers use the case API client and session-held case data, with separate integrations for identity, payments and document management. README documents case orchestration and document download; the sampled files show controller behavior, but not every integration’s wiring.
Main entry points: server.ts Express server · case-api-client.ts Case API client · routes.ts HTTP routes · BasePaymentPostController.ts Payment controller
Components 23
Web entry
- Express server
src/main/server.ts - HTTP routes
src/main/routes.ts
Citizen journeys
- Application steps
src/main/steps/applicant1Sequence.ts - Alternative service
src/main/steps/alternativeServiceApplicationSequence.ts - Dispense service
src/main/steps/dispenseServiceApplicationSequence.ts - Form controllers
src/main/app/controller/PostController.ts - Jurisdiction logic
src/main/app/jurisdiction/JurisdictionPostController.ts - Access code
src/main/app/access-code/AccessCodePostController.ts - Payment controller
src/main/app/controller/BasePaymentPostController.ts - Document management
src/main/app/document/DocumentManagementController.ts
Case services
- Case API client
src/main/app/case/case-api-client.ts - Case formatting
src/main/app/case/to-api-format.ts - Document API client
src/main/app/document/CaseDocumentManagementClient.ts
External integrations
- Case orchestration
- Payment client
src/main/app/payment/PaymentClient.ts - Payment service
- Document service
- Identity provider
Web platform
- OIDC middleware
src/main/modules/oidc/index.ts - Session storage
src/main/modules/session/index.ts - Page rendering
src/main/modules/nunjucks/index.ts - Error handling
src/main/modules/error-handler/index.ts
Other components
- Citizen
Connections 21
- Citizen → Express server: sends requests
- Express server → HTTP routes: registers routes
- HTTP routes → Application steps: dispatches journey
- Application steps → Form controllers: selects handlers
- Form controllers → Case API client: triggers case events
- Jurisdiction logic → Case API client: saves jurisdiction
- Access code → Case API client: retrieves and links
- Case API client → Case formatting: formats case data
- Case API client → Case orchestration: requests case actions
- Payment controller → Case API client: updates payment case
- Payment controller → Payment client: creates payment
- Payment client → Payment service: requests payment
- Document management → Document API client: uploads or deletes
- Document API client → Document service: transfers documents
- Express server → OIDC middleware: installs middleware
- OIDC middleware → Identity provider: authenticates users
- Express server → Session storage: enables sessions
- Express server → Page rendering: configures rendering
- Express server → Error handling: installs handler
- HTTP routes → Alternative service: routes journey
- HTTP routes → Dispense service: routes journey