All Projects → maljukan-zz → Typescript Node Rest Starter

maljukan-zz / Typescript Node Rest Starter

Simple starter template for building NODE REST API's using TypeScript

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Typescript Node Rest Starter

Ssm
👅基于RESTful风格的前后端分离的SSM框架,集成了shiro和swagger等框架
Stars: ✭ 141 (+182%)
Mutual labels:  rest, swagger, jwt
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (+92%)
Mutual labels:  rest, swagger, mongo
Go Restful Api
An idiomatic Go REST API starter kit (boilerplate) following SOLID principles and Clean Architecture
Stars: ✭ 1,043 (+1986%)
Mutual labels:  rest, jwt
Angular Springboot Rest Jwt
Springboot, Angular and JWT security - Example Project based on Northwind Order Processing
Stars: ✭ 603 (+1106%)
Mutual labels:  swagger, jwt
Simplemall
基于SpringCloud的微服务架构实战案例项目,以一个简单的购物流程为示例,融合spring cloud 相关组件,如spring-cloud-netflix、swagger等
Stars: ✭ 687 (+1274%)
Mutual labels:  swagger, jwt
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (+1018%)
Mutual labels:  rest, swagger
Full Stack Fastapi Postgresql
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Stars: ✭ 7,635 (+15170%)
Mutual labels:  swagger, jwt
Testing Nestjs
A repository to show off to the community methods of testing NestJS including Unit Tests, Integration Tests, E2E Tests, pipes, filters, interceptors, GraphQL, Mongo, TypeORM, and more!
Stars: ✭ 685 (+1270%)
Mutual labels:  rest, mongo
Swagger Parser
Swagger Spec to Java POJOs
Stars: ✭ 468 (+836%)
Mutual labels:  rest, swagger
Swagger Core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
Stars: ✭ 6,898 (+13696%)
Mutual labels:  rest, swagger
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-64%)
Mutual labels:  swagger, jwt
Swagger Codegen Play Scala
Swagger client generator which is based on the PlayWS library
Stars: ✭ 9 (-82%)
Mutual labels:  rest, swagger
Equinoxproject
Full ASP.NET Core 5 application with DDD, CQRS and Event Sourcing concepts
Stars: ✭ 5,120 (+10140%)
Mutual labels:  swagger, jwt
Cerberus
A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
Stars: ✭ 482 (+864%)
Mutual labels:  rest, jwt
Node Express Mongodb Jwt Rest Api Skeleton
This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API). Demo of frontend in VueJS here: https://github.com/davellanedam/vue-skeleton-mvp
Stars: ✭ 603 (+1106%)
Mutual labels:  rest, jwt
Laravel Vue Boilerplate
🐘 A Laravel 6 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.
Stars: ✭ 472 (+844%)
Mutual labels:  jwt, jest
Snake
🐍 一款小巧的基于Go构建的开发框架,可以快速构建API服务或者Web网站进行业务开发,遵循SOLID设计原则
Stars: ✭ 615 (+1130%)
Mutual labels:  swagger, jwt
Ee7 Jaxrs Sample
Building RESTful APIs with Java EE 7 and JAXRS
Stars: ✭ 15 (-70%)
Mutual labels:  rest, jwt
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+42458%)
Mutual labels:  rest, swagger
Full Stack
Full stack, modern web application generator. Using Flask, PostgreSQL DB, Docker, Swagger, automatic HTTPS and more.
Stars: ✭ 451 (+802%)
Mutual labels:  swagger, jwt

TypeScript REST Node Starter

This repository can be used as a convenient starting point for building NODE REST API's using TypeScript on top of Express web framework.

Features

  • Basic JWT authentication and account activation using SMTP
  • Repository pattern used to enable separation of concerns
  • MongoDB - default repository implementation, should be easy to replace

Pre-reqs

  • Install Node.js
  • Install MongoDB
  • Configure your SMTP service and enter your SMTP settings inside .env.example

Getting started

  • Clone the repository
git clone --depth=1 https://github.com/maljukan/typescript-node-rest-starter.git <project_name>
  • Install dependencies
cd <project_name>
npm install
  • Configure your mongoDB server
# create the db directory
sudo mkdir -p /data/db
# give the db correct read/write permissions
sudo chmod 777 /data/db
  • Start your mongoDB server (you'll probably want another command prompt)
mongod
  • Build and run the project
npm run build
npm start

Swagger

To access Swagger UI for available endpoints

http://localhost:3000/api-docs/#/

Pass token from /auth/login when using protected endpoints (for example: getting all /users) like Bearer <token>

REST endpoints

  • public: /auth/login, /auth/register, /auth/activate
  • protected: /users

CURL

  • Register
curl -d '{"email":"[email protected]", "password":"PASSWORD", "lname": "Doe", "fname": "John", "role": "guest", "username": "jdoe"}' -H "Content-Type: application/json" -X POST http://localhost:3000/auth/register
  • Activation
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:3000/auth/activate/ACTIVATION_TOKEN
  • Login
curl -i -d '{"email":"[email protected]", "password":"PASSWORD"}' -H "Content-Type: application/json" -X POST http://localhost:3000/auth/login
  • GET /users
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer JWT_TOKEN_HERE" -X GET http://localhost:3000/users/

Import mock users

mongoimport --db heroes-db --collection users --file users.json --jsonArray

Tests

  • Before running tests be sure to create a real .env file in root using the fields found in .env.example
npm run test

TODO

  • Implement RBAC functionality
  • Integrate Swagger
  • Test coverage

Credits

The repository is based on Microsoft/TypeScript-Node-Starter

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].