https://github.com/felipeoriani/aws-serverless-nodejs-typescript-sample
Sample cloud-native serverless project for a Flight Air company using Node.Js, Typescript, AWS DynamoDB, AWS Lambda, AWS SQS, AWS API Gateway and Serverless Framework.
https://github.com/felipeoriani/aws-serverless-nodejs-typescript-sample
api-gateway aws aws-lambda aws-lambda-node aws-sqs cloud-formation cloud-native dynamo dynamodb javascript lambda lambda-functions nodejs serverless serverless-framework sqs typscript
Last synced: 4 months ago
JSON representation
Sample cloud-native serverless project for a Flight Air company using Node.Js, Typescript, AWS DynamoDB, AWS Lambda, AWS SQS, AWS API Gateway and Serverless Framework.
- Host: GitHub
- URL: https://github.com/felipeoriani/aws-serverless-nodejs-typescript-sample
- Owner: felipeoriani
- Created: 2024-01-30T02:58:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T13:28:06.000Z (over 1 year ago)
- Last Synced: 2025-03-18T09:13:33.177Z (9 months ago)
- Topics: api-gateway, aws, aws-lambda, aws-lambda-node, aws-sqs, cloud-formation, cloud-native, dynamo, dynamodb, javascript, lambda, lambda-functions, nodejs, serverless, serverless-framework, sqs, typscript
- Language: TypeScript
- Homepage:
- Size: 1020 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Serverless Node.Js Typescript Sample Project
Hello, welcome. I am [Felipe](https://github.com/felipeoriani)!
This is an example of a project for a Flight Air company designed and built using part of the technology stack that I use throughout my career where the goal is to compose my portfolio and demonstrate a bit of my professional experience. Focused on a `Cloud Native` Rest API, this project leverages `AWS` Services with a strong emphasis on `Serverless` Architecture. To achieve this, the foundation is built upon the `Serverless Framework` with custom `AWS Cloud Formation` sections to complete provide infrastructure as code. Feel free to contact me and check other projects in my portfolio here at [Github profile](https://github.com/felipeoriani) page.
### Stack

Node.Js

Typescript

AWS DynamoDB

Amazon Web Services

Serverless Framework

AWS Cloud Formation

AWS API Gateway

AWS Lambda

AWS SQS
### Architecture
#### Rest API
The architecture consists in a serverless Rest API using Serverless Framework within the AWS as Cloud Provider. Through an `AWS API Gateway`, receive a request, process it on `AWS Lambda` written in `Node.Js` with `Typescript` superset and return a message to the `AWS API Gateway` which responds to clients using the `HTTP` protocol. All the data is persisted into a `AWS DynamoDB` table which is defined on the serverless yml file. The project is still under construction and I do it at my free time.
#### Events
There is an in progress event series that for every `x` minutes in order to notify all the passengers that have a scheduled flight for the next `x` hours. Check the following diagram for the events.
#### Code Architecture
The code presents a [Layered Architecture](https://www.oreilly.com/library/view/software-architecture-patterns/9781491971437/ch01.html) using `Node.Js` and `Typescript` which will be transpiled to `Javascript` as the main language of the Node.Js runtime. It contains an `Domain Layer` where keep the domain of the project including Flight and Passengers and abstractions for storage and business rules. Then we have the `Infrastructure Layer` to maintain all the code related to I/O bound operations specially network calls such as cloud services implementations which includes database, queues, cloud services, external services, etc. And finally we have the `Application Layer` which is responsable to hold the business rules.
All the layers are in the low coupling to be able to future change the implementation so each component depends on abstractions instead concrete types. It also make our tests easy to simulate some behaviour we may want to test using Mocks. In the code, you can find it under the `./src/core` folder like the image bellow:
### Tests
There are a few unit tests in progress to cover the main business rules on the application layer of the project. It is implemented on the top of native `Node Test Runner` and to run it locally, you can run `yarn test` or `npm test`.