Skip to content

mcnic/nodejs-aws-cart-api

 
 

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Travis Linux Coverage Gitter Backers on Open Collective Sponsors on Open Collective

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Deploy

Deployment is done using AWS CDK. You can find deployment configuration in ./deploy folder.

To run deployment, you need to have AWS credentials set up on your machine.

Run deployment if you have AWS credentials in your environment variables:

$ npm run build
$ npm run deploy

If you set up AWS Profile in your ~/.aws/credentials file, you can run deployment with the following command:

$ npm run build
$ npm run deploy -- --profile <profile-name>

When deployment is done, you can find the url of deployed API in the output of the command.

Outputs:
nodejs-aws-cart-api.Url = <url>

How it works

When you run npm run deploy, cdk bundles all your code into a single js file using esbuild, uploads it to S3, generates CloudFormation template representing the change and deploying it to the AWS account.

Notes

Due to how NestJS is written, some modules are marked as "external" and are not included in the final bundle:

  • @nestjs/microservices
  • @nestjs/websockets
  • class-transformer
  • class-validator

If you want to use any of this modules, you need to add them to package.json, install and remove from deploy/Stack.ts.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

DB

npx prisma generate for renew prisma npm run db:migrate for migrate data after change schema

TODO

  • add auth and check it in CartService

Elastic Beanstalk

steps:

  • npm run eb:init
  • npm run eb:create
  • npm run eb:terminate

About

CartApi for NodeJS in AWS course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.6%
  • JavaScript 6.5%
  • Dockerfile 2.9%