A serverless microservice responsible for responsible for retrieving user details for driving examiners. Primarily intended to be used with the MES mobile app.
DVSA dependencies have been moved from npm to github so in order to install/update any private @DVSA packages
you are required to have an entry in your global ~/.npmrc file as follows:
//npm.pkg.github.com/:_authToken=<your auth token here>All serverless functions live in dedicated directories in src/functions.
Code that is common between multiple functions should reside in src/common.
As per the principles of Hexagonal Architecture, each function has the following directories to help us separate concerns:
framework- contains all Inbound and Outbound Adapters, and all use of external/proprietary APIs - depends upon...application- contains all Inbound and Outbound Ports, doesn't use any external/proprietary APIs - depends upon...domain- contains all domain objects (Aggregates, Objects, Value classes etc) with all "business logic" (not just anaemic data holders), doesn't use any external/proprietary APIs.
The domain model for the journal is maintained as a JSON Schema. In order to compile the project, you need to generate the type information:
npm run bootstrapTo build a zip file for every function to build/artifacts, run:
npm run packageTo build a subset of the functions, pass a comma separated list of function names, like so:
npm run package -- get,setN.b. The build requires jq.
To run the unit tests, simply run:
npm testTo spin up a local database to allow for local testing, run the following command:
npm run startThis will populate a local database populated from test-data/dynamo-seed-users.json and can be accessed via http://localhost:3000/dev/users/1234567 This will require you to have appropreate credentials for aws set in ~/.aws/credentials