Skip to content

Latest commit

 

History

History

hexagonal-architectures

Serverless Typescript Demo

This is a simple serverless application built in Typescript and uses Node.js runtime. It consists of an Amazon API Gateway backed by four AWS Lambda functions and an Amazon DynamoDB table for storage.

Architecture diagram

We will explore the usage of hexagonal architecture pattern to decouple the entry points, from the main domain logic and the storage logic. As an example we will see how to implement an adapter for Amazon API Gateway and another adapter for Amazon EventBridge and how to easily switch between them with minor code changes.

hexagonal architecture diagram

Requirements

Deployment

Deploy the demo to your AWS account using AWS SAM.

npm install
npm run build
# sam deploy --guided # if running for the first time. 
sam deploy

The npm run build commmand will first build the products TypeScript project. Then the command sam deploy use the SAM Template to deploy the resources to your account.

SAM will create an output of the API Gateway endpoint URL for future use in our load tests.

License

This library is licensed under the MIT-0 License. See the LICENSE file.