https://github.com/bkawk/vechainapi
A Dockerized Express API that pushes messages into a queue to be processed offline
https://github.com/bkawk/vechainapi
aws docker express sqs typescript
Last synced: 9 months ago
JSON representation
A Dockerized Express API that pushes messages into a queue to be processed offline
- Host: GitHub
- URL: https://github.com/bkawk/vechainapi
- Owner: bkawk
- License: mit
- Created: 2021-01-13T15:16:43.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-19T10:11:17.000Z (about 5 years ago)
- Last Synced: 2025-02-18T00:41:41.341Z (about 1 year ago)
- Topics: aws, docker, express, sqs, typescript
- Language: TypeScript
- Homepage:
- Size: 343 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VeChainAPI
Simple web-facing API that accepts payment requests from a React front end, the payment request contains an amount and an address. The API, in turn, sends the request to AWS SQS to be processed by a secure lambda function that is listening to queue and not web facing.
[]()
## TODO
* Add logging with pino
* Sanitise incoming data
* Configure CORS for front end only
* Check all functions have try catch
* Final lint
* Configure CircleCI to push to ECR on success
* Build out tests to get coverage
## Install
```ssh
npm install
```
## Run Development
```ssh
npm run dev
```
## Watch Tests
```ssh
npm run devtests
```
## Start
```ssh
npm run start
```
## Docker
```ssh
npm run docker
```
## Lint
```ssh
tslint --project .
```
## Deploy
* Setup a domain Route 53
* Setup a Certificate in Certificate manager
* Create a remote repository in AWS ECR
* Push docker image to ECR
* Create a new VPC
* Create 2 Subnets for private and 2 Subnets for public
* Attach an Internet gateway to VPC
* Create 2 route tables one for public and one for private
* On the public route table connect the Internet Gateway and NAT Gateway
* On the private route table setup a route for the NAT Gateway
* Associate the coresponding subnets to the 2 route tables
* Create an ECS Cluster powered by Fargate in a new VPC
* Create a Fargate ECS Task Definition and link the docker image in ECR
* Create an application load balancer and target group for the public subnet
* Create a Fargate service in the Cluster, connect the load balancer and configure the security group
* Alias the domain to the load balancer
* Setup AWS Code Deploy linking it to GitHub
