https://github.com/dvsa/mes-microservices-starter-template
A starter template for new DES microservices
https://github.com/dvsa/mes-microservices-starter-template
aws nodejs serverless typescript
Last synced: about 1 year ago
JSON representation
A starter template for new DES microservices
- Host: GitHub
- URL: https://github.com/dvsa/mes-microservices-starter-template
- Owner: dvsa
- License: mit
- Created: 2019-01-31T11:03:38.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2024-03-16T19:27:33.000Z (about 2 years ago)
- Last Synced: 2025-02-08T22:28:34.675Z (about 1 year ago)
- Topics: aws, nodejs, serverless, typescript
- Language: TypeScript
- Homepage:
- Size: 1.11 MB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mes-microservices-starter-template
A serverless microservice template.
## Structure
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.
## Run locally
Use the following script to spin up the microservice locally
```shell
npm start
```
## Build
To build a zip file for every function to `build/artifacts`, run:
```shell
npm run package
```
To build a subset of the functions, pass a comma separated list of function names, like so:
```shell
npm run package -- get,set
```
*N.b. The build requires [jq](https://github.com/stedolan/jq).*
*Any functions delcared in serverless.yml that contain the word "local" will be ignored in the packaging process.*
## Test
To run the unit tests, simply run:
```shell
npm test
```
## Testing workflows locally
To run the GitHub actions locally for testing purposes, please see here:
https://github.com/nektos/act