Skip to content

DEFRA/fcp-fd-core

Repository files navigation

Single Front Door Core

Local development support for orchestrating all Single Front Door microservices.

Prerequisites

  • Docker
  • Docker Compose
  • Node.js 22.13 LTS - We recommend using NVM for Unix-based systems or NVM-Windows.

Onboarding Guide

For new software developers joining the SFD team, there is an onboarding guide to get an instance of the local service up and running.

Repositories

Service Type Quality gate
fcp-fd-comms Backend Quality Gate Status
fcp-fd-file-processor Backend Quality Gate Status
fcp-fd-file-retriever Backend Quality Gate Status
fcp-fd-data Customer Quality Gate Status

Local Development

You will need to clone this repository before running any scripts.

git clone https://github.com/DEFRA/fcp-fd-core

cd fcp-fd-core

npm install

Cloning Repositories

This project contains a script to clone all the required repositories. This works by checking the service-compose directory for the services and cloning them if they do not exist.

To clone the repositories, run the following command:

npm run clone

Starting the Services

A single docker-compose project has been created that orchestrates all microservices, dependencies, and performs any necessary setup tasks such as database migrations.

All configuration is stored in the .env file. Before starting the services, ensure that the .env file is correctly configured. See the .env.example file for an example configuration.

If you need assistance with finding the correct values for the .env file, please refer to the onboarding guide or ask another developer for help.

To start all services, run the following command:

docker-compose --profile fcp-fd up --build

To stop the services, run the following command:

docker-compose down

The services can still be started individually directly from their respective repositories. However, this project is intended to streamline local development by having a common entry point for all services.

Adding a New Service

Adding a new service to the core project is partially automated. The add-service script will scaffold a new microservice docker-compose project in the service-compose directory.

To add a new service, run the following command:

npm run add-service

Databases

Database migrations are run by the local-setup container automatically when the services are started. If you are adding a new service that requires a database, you will need to let the local-setup container know where the Liquibase changelog files are located.

To do this, add a bind mount to local-setup/fcp-fd-local-setup.yml for the changelog directory of the new service.

volumes:
    - ../repos/{service-name}/changelog:/liquibase/services/{service_name}/changelog

Important

The service_name folder on the container side must use snake_case. For example, if the service name is fcp-fd-new-service, the bind mount should be /liquibase/services/fcp_fd_new_service/changelog.

volumes:
  - ../repos/fcp-fd-new-service/changelog:/liquibase/services/fcp_fd_new_service/changelog

Script Documentation

This project contains a number of scripts to streamline local microservice development.

Add Service

Scaffolds a new microservice docker-compose project in the service-compose directory.

npm run add-service

Clone

Clones the repositories for each microservice into the parent directory.

npm run clone

Latest Versions

List latest GitHub release version for each microservice.

npm run latest-versions

Pull

Pulls the latest remote changes for each microservice.

npm run pull

Update

Switches to and pulls the latest main branch for each microservice.

npm run update

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •