All Projects → ahmetuysal → Nest Hackathon Starter

ahmetuysal / Nest Hackathon Starter

Licence: mit
Hackathon starter project for NestJS. Includes TypeORM, email verification, Passport-JWT authentication, Swagger and more

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Nest Hackathon Starter

Flask Api Starter Kit
Start a Flask API in less than 5 minutes
Stars: ✭ 296 (+244.19%)
Mutual labels:  swagger, boilerplate
Rest Api Nodejs Mongodb
A boilerplate for REST API Development with Node.js, Express, and MongoDB
Stars: ✭ 672 (+681.4%)
Mutual labels:  jwt-authentication, boilerplate
Nest Angular
NestJS, Angular 6, Server Side Rendering (Angular Universal), GraphQL, JWT (JSON Web Tokens) and Facebook/Twitter/Google Authentication, Mongoose, MongoDB, Webpack, TypeScript
Stars: ✭ 307 (+256.98%)
Mutual labels:  nest, jwt-authentication
Nest-Js-Boiler-Plate
Nest Js Boilerplate with JWT authentication, CRUD functions and payment gateways.
Stars: ✭ 14 (-83.72%)
Mutual labels:  nest, nodemailer
Angular Asp.netcorewebapi Mysql Crud Project
Angular 5 + ASP.Net Core 2.0 WebAPI + MySQL CRUD Sample
Stars: ✭ 22 (-74.42%)
Mutual labels:  swagger, jwt-authentication
Nestjs Boilerplate
NestJS Boilerplate 😻(Authentication, TypeORM, Configuration, Swagger)
Stars: ✭ 267 (+210.47%)
Mutual labels:  swagger, boilerplate
Koa Rest Api Boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (+388.37%)
Mutual labels:  swagger, boilerplate
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (-80.23%)
Mutual labels:  jwt-authentication, nodemailer
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-79.07%)
Mutual labels:  swagger, jwt-authentication
Swagger
OpenAPI (Swagger) module for Nest framework (node.js) 🌎
Stars: ✭ 734 (+753.49%)
Mutual labels:  swagger, nest
Kodkod
https://github.com/alirizaadiyahsi/Nucleus Web API layered architecture startup template with ASP.NET Core 2.1, EF Core 2.1 and Vue Client
Stars: ✭ 45 (-47.67%)
Mutual labels:  swagger, jwt-authentication
Tvrboreact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-84.88%)
Mutual labels:  nodemailer, jwt-authentication
symfony5-jwt-restapi
API for Meeting app development
Stars: ✭ 21 (-75.58%)
Mutual labels:  swagger, jwt-authentication
Nucleus
Vue startup application template that uses ASP.NET Core API layered architecture at the back-end and JWT based authentication
Stars: ✭ 276 (+220.93%)
Mutual labels:  swagger, jwt-authentication
node-mysql
Node with mysql boilerplate
Stars: ✭ 72 (-16.28%)
Mutual labels:  jwt-authentication, nodemailer
Aspnetcore Webapi Course
Professional REST API design with ASP.NET Core 3.1 WebAPI
Stars: ✭ 323 (+275.58%)
Mutual labels:  swagger, jwt-authentication
arc
Fullstack open source Invoicing application made with MongoDB, Express, React & Nodejs (MERN)
Stars: ✭ 1,291 (+1401.16%)
Mutual labels:  jwt-authentication, nodemailer
TvrboReact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-84.88%)
Mutual labels:  jwt-authentication, nodemailer
Simplemall
基于SpringCloud的微服务架构实战案例项目,以一个简单的购物流程为示例,融合spring cloud 相关组件,如spring-cloud-netflix、swagger等
Stars: ✭ 687 (+698.84%)
Mutual labels:  swagger, jwt-authentication
Express Boilerplate
🚀 Starter project for a RESTful API in Node with Express & mongoose component-based
Stars: ✭ 9 (-89.53%)
Mutual labels:  jwt-authentication, boilerplate

Nest Hackathon Starter Nest Logo

This project contains boilerplate for creating APIs using Nest, a progressive Node.js framework for building efficient and scalable server-side applications.

It is mostly built to be used as a starting point in hackathons and implements common operations such as sign up, JWT authentication, mail validation, model validation and database access.

You can also look at my Angular Hackathon Starter template that shares the same contract with this API.

Features

  1. PostgreSQL with TypeORM

  2. JWT Authentication

  3. Mail Verification

  4. Mail Change

  5. Password Reset

  6. Request Validation

  7. Customizable Mail Templates

  8. Swagger API Documentation

  9. Security Techniques

  10. Logger

Getting Started

Installation

  1. Make sure that you have Node.js(>= 8.9.0) installed.
  2. Clone this repository by running git clone https://github.com/ahmetuysal/nest-hackathon-starter.git <YOUR_PROJECT_NAME> or directly create your own GitHub repository using this template.
  3. Move to the appropriate directory: cd <YOUR_PROJECT_NAME>.
  4. Run yarn to install dependencies.

Configuration Files

TypeORM Configurations

This template uses Postgres by default. If you want to use another database, follow instructions in the official Nest documentation and use appropriate column types for your entities.

If you wish to use another database you will also have to edit ormconfig.js file accordingly.

Template includes three different environment options by default. Most of the time you will use the local environment when developing and production environment on production. You will need to fill out corresponding environment files in env directory.

DATABASE_HOST=__YOUR_DATABASE_URL__
DATABASE_PORT=5432
DATABASE_USERNAME=__YOUR_USERNAME__
DATABASE_PASSWORD=__YOUR_PASSWORD__
DATABASE_NAME=__YOUR_DATABASE__

JWT Configurations

A secret key is needed in encryption process. Generate a secret key using a service like randomkeygen.

Enter your secret key to config.ts file. You can also the change expiration time, default is 86400 seconds(1 day).

  jwt: {
    secretOrKey: '__JWT_SECRET_KEY__',
    expiresIn: 86400,
  },

NodeMailer✉️ Configurations

A delivery provider is required for sending mails with Nodemailer. I mostly use SendGrid to send mails, however, Nodemailer can work with any service with SMTP transport.

To get a SendGrid API key:

  • Create a free account from https://signup.sendgrid.com/
  • Confirm your account via the activation email and login.
  • Create an API Key with mail sending capability.

Enter your API key and sender credentials to config.ts file. Sender credentials are the sender name and sender mail that will be seen by your users.

mail:
    service: {
      host: 'smtp.sendgrid.net',
      port: 587,
      secure: false,
      user: 'apikey',
      pass: '__SENDGRID_API_KEY__',
    },
    senderCredentials: {
      name: '__SENDER_NAME__',
      email: '__SENDER_EMAIL__',
    },
  },

Mail Template Configurations

Mail templates are highly customizable and heavily depend on configurations. Enter your project's information to config.ts. Urls are used as references in the templates. If your mail verification logic is independent from your front-end application, you can use API's own mail verification endpoint, e.g. http://localhost:3000/auth/verify, as mailVerificationUrl. Otherwise, send a HTTP GET request to verification endpoint with token added as a parameter named token, e.g, http://localhost:3000/auth/verify?token=__VERIFICATION_TOKEN__

 project: {
    name: '__YOUR_PROJECT_NAME__',
    address: '__YOUR_PROJECT_ADDRESS__',
    logoUrl: 'https://__YOUR_PROJECT_LOGO_URL__',
    slogan: 'Made with ❤️ in Istanbul',
    color: '#123456',
    // You can enter as many social links as you want
    socials: [
      ['GitHub', '__Project_GitHub_URL__'],
      ['__Social_Media_1__', '__Social_Media_1_URL__'],
      ['__Social_Media_2__', '__Social_Media_2_URL__'],
    ],
    url: 'http://localhost:4200',
    mailVerificationUrl: 'http://localhost:3000/auth/verify',
    mailChangeUrl: 'http://localhost:3000/auth/change-email',
    resetPasswordUrl: 'http://localhost:4200/reset-password',
    termsOfServiceUrl: 'http://localhost:4200/legal/terms',
  },

Migrations

By default this template disables synchronize in favor of migrations. If you wish to enable synchronize you can edit ormconfig.js file.

# generate migration for local environment
$ yarn migrations:generate:local
# run migrations in local environment
$ yarn migrations:run:local
# revert latest run migration in local environment
$ yarn migrations:revert:local

# generate migration for production environment
$ yarn migrations:generate:production
# run migrations in production environment
$ yarn migrations:generate:production
# revert latest run migration in production environment
$ yarn migrations:generate:local

Running the app

$ nest start

Running the tests

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Support Nest

Nest is an MIT-licensed open source project. If you'd like to join support Nest, please read more here.

License

Licenced under MIT License. Nest is also MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].