This ia a monorepo used for the notarial services apis, which power the prove your eligibility to a foreign government forms.
- A node version manager, like nvm, or n
- node 24.x.x
- npm 11 or later
- Docker >= 3.9 - Install docker engine
You may use docker and docker compose to build and start the project with the right components (e.g. database, microservices), but will not be able to run the application(s) in dev mode.
To do this, simply run this command from the root of the project:
docker compose up -d
This will then run the server in a docker container in detached mode, allowing you to continue making commands through your terminal, but still keep the docker container running.
To rebuild the server after making some changes, run the following commands:
docker compose down
docker compose -d --build
You may still need docker to start the databases.
From the root directory,
docker compose up postgres
This will start the postgres container running on port 5432; with username user and password root,
and a database created called notarial (postgres://user:root@localhost:5432/notarial).
init.sql is also loaded as a volume into the container, and will create a database named queue
(postgres://user:root@localhost:5432/queue). This is useful if you are going to be running forms-worker
at the same time. If you are running postgres from this repo, you do not need to run it in forms-queue.
- If you wish to send emails locally, you will need to authenticate your terminal with AWS. (
formsawsauth prod) - Start the api
npm run api -- start:local - start the worker
NOTIFY_API_KEY=".." npm run worker -- start:local - Send a post request to
http://localhost:9000/forms, use the payload found innotarial-api/api/src/middlewares/services/UserService/personalisation/__tests__/fixtures/marriageTestData.ts, or run the form runner locally, with the webhook configured tohttp://localhost:9000/forms.
- Commit
.npmrcandpackage-lock.json. - Use
npm cifor ordinary installs and CI. ignore-scripts=trueblocks dependency lifecycle scripts during install.- Use
npm installonly when intentionally changing dependencies, then review the lockfile diff.
This project uses ESLint for linting and Prettier for formatting. The pipeline runs linting on build and stops on failure.
Available commands:
npm run format— Run formatting and fix issuesnpm run lint— Run linting
This project runs package vulnerability scanning. The pipeline runs this on build and stops on failure.
Available commands:
npm run security— Run package vulnerability scan
There is a CI/CD pipeline currently set up for deploying new versions of the project to test environments. For more information, please refer to the CI/CD docs
This project uses semantic-release. This allows for automatic versioning of the project based on the commit messages when merging.
When merging, prefix the pull request subject with
chore:for changes which should not increment the version number (like documentation changes)fix:for bug fixes, (increments the patch version)feat:for new features (increment the minor version)BREAKING:for major changes (increments the major version)
Releases are automatically generated from commit messages. Prefix each commit with one of the above prefixes to include the commit message in the generated message.
Currently, there is unit testing and integration testing set up for the api workspace. For more information, refer to the testing docs.