Giter Site home page Giter Site logo

agger34 / nestjs-serverless-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 337 KB

NestJS serverless boilerplate

JavaScript 2.53% Dockerfile 1.38% TypeScript 96.09%
boilerplate docker-compose dynamodb nest-boilerplate nestjs nodejs serverless typescript api

nestjs-serverless-template's Introduction

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Required

- nodejs
- jdk

Installation

$ npm install serverless -g
$ npm install

# to sync 
$ serverless plugin install -n serverless-dynamodb-local
$ serverless plugin install -n serverless-offline
$ serverless plugin install -n serverless-jetpack

# to install dynamondb
$ serverless dynamodb install

Running the app to develop

# to run dynamodb locally
$ docker-compose up -d

# to create/update .env file

# to run/debug app
$ npm run start

Running the app to test serverless

$ npm run start:serverless

Running dynamodb-admin

# to install dynamodb-admin
$ npm install -g dynamodb-admin

# to set DYNAMO_ENDPOINT
## linux
$ export DYNAMO_ENDPOINT=http://localhost:8000
## windows
$ set DYNAMO_ENDPOINT=http://localhost:8000

# to run dynamodb-admin
$ dynamodb-admin

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Deployment

TBU

Folder Structure

# 1. Overview
├───src
│   ├───database     # Database provider files, ex: mongodb, mysql
│   ├───decorator    # Decorator files, ex: @Roles
│   ├───guard        # Guard files, ex: JwtAuthGuard
│   ├───middleware   # Middleware files, ex: Logger
│   ├───module       # Source files, internal and external modules
│   │   ├───auth
│   │   ├───todo     # A sample todo modules include
│   │   └───user
│   ├───script       # Script files to run other process built with NestJs also
│   └───shared       # Enum, Constant, Helper.. to share across the system
└───test

# 2. Sample module details
.      
├───module
│   ├───todo
│   │       todo.controller.ts
│   │       todo.dto.ts
│   │       todo.enum.ts
│   │       todo.interface.ts
│   │       todo.module.ts
│   │       todo.providers.ts
│   │       todo.repository.ts
│   │       todo.schema.ts
│   │       todo.service.ts

Note

Currently, there's an issue with serverless-dynamodb-local, so I fixed temporarily dynamodb-localhost": "github:99x/dynamodb-localhost#db30898f8c40932c7177be7b2f1a81360d12876d in package. I will update it later.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.