Skip to content

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.

Notifications You must be signed in to change notification settings

felipeoriani/aws-serverless-nodejs-typescript-sample

Repository files navigation

AWS Serverless Node.Js Typescript Sample Project

This is an example of a project for a Flight Air company built using part of the technology stack that I use throughout my career where the main objective is to compose my portfolio and demonstrate a bit of my professional experience. Focused on a Cloud Native Rest API, the 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 and check other projects in my portfolio here at Github profile page.

Stack

Node.Js
Node.Js
Typescript
Typescript
AWS DynamoDB
AWS DynamoDB
Amazon Web Services
Amazon Web Services
Serverless
Serverless Framework
AWS Cloud Formation
AWS Cloud Formation
AWS API Gateway
AWS API Gateway
AWS Lambda
AWS Lambda
AWS SQS
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.

Architecture Diagram for Flight Service

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.

Event Diagram for Flight Service

Code Architecture

The code presents a Layered Architecture 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.

About

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.

Topics

Resources

Stars

Watchers

Forks