All Projects โ†’ minhuyen โ†’ Generator Expressjs Rest

minhuyen / Generator Expressjs Rest

Project template for an ExpressJS application

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Generator Expressjs Rest

Openapi Directory
๐ŸŒ Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: โœญ 2,635 (+6326.83%)
Mutual labels:  api, rest-api, swagger
Jianshu
ไปฟ็ฎ€ไนฆnx+nodejs+nestjs6+express+mongodb+angular8+็ˆฌ่™ซ
Stars: โœญ 296 (+621.95%)
Mutual labels:  api, swagger, express
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: โœญ 2,825 (+6790.24%)
Mutual labels:  api, rest-api, swagger
React With Wordpress
๐Ÿ”ฅ Example of react application to access WordPress REST API
Stars: โœญ 137 (+234.15%)
Mutual labels:  api, rest-api, express
Rest Api Nodejs Mongodb
A boilerplate for REST API Development with Node.js, Express, and MongoDB
Stars: โœญ 672 (+1539.02%)
Mutual labels:  api, rest-api, express
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: โœญ 146 (+256.1%)
Mutual labels:  api, rest-api, express
Generator Api
๐Ÿš€ Yeoman generator for creating RESTful NodeJS APIs, using ES6, Mongoose and Express
Stars: โœญ 247 (+502.44%)
Mutual labels:  api, rest-api, yeoman
Swagger Express Ts
Generate and serve swagger.json
Stars: โœญ 102 (+148.78%)
Mutual labels:  rest-api, swagger, express
Generator Express No Stress
๐Ÿš‚ A Yeoman generator for Express.js based 12-factor apps and apis
Stars: โœญ 534 (+1202.44%)
Mutual labels:  swagger, babel, express
Woo Next
๐Ÿš€ React WooCommerce theme, built with Next JS, Webpack, Babel, Node, Express, using GraphQL and Apollo Client
Stars: โœญ 342 (+734.15%)
Mutual labels:  rest-api, babel, express
Bhagavadgita
A non-profit initiative to help spread the transcendental wisdom from the Bhagavad Gita to people around the world.
Stars: โœญ 84 (+104.88%)
Mutual labels:  api, rest-api, swagger
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: โœญ 831 (+1926.83%)
Mutual labels:  api, rest-api, swagger
Rest Hapi
๐Ÿš€ A RESTful API generator for Node.js
Stars: โœญ 1,102 (+2587.8%)
Mutual labels:  api, rest-api, swagger
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: โœญ 178 (+334.15%)
Mutual labels:  api, rest-api, swagger
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: โœญ 49 (+19.51%)
Mutual labels:  api, rest-api, yeoman
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: โœญ 3,448 (+8309.76%)
Mutual labels:  api, rest-api, swagger
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: โœญ 96 (+134.15%)
Mutual labels:  rest-api, swagger, yeoman
Swaggymnia
Generate Swagger ๐ŸŒ€ documentation for your existing API in Insomnia
Stars: โœญ 336 (+719.51%)
Mutual labels:  api, rest-api, swagger
Koa2 Api Scaffold
ไธ€ไธชๅŸบไบŽKoa2็š„่ฝป้‡็บงRESTful API Server่„šๆ‰‹ๆžถใ€‚
Stars: โœญ 694 (+1592.68%)
Mutual labels:  api, rest-api, express
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: โœญ 18 (-56.1%)
Mutual labels:  api, rest-api, swagger

Generator Expressjs Rest

Build Status

Features

  • User Registration
  • Basic Authentication with username and password
  • Admin use react-admin
  • Oauth 2.0 Authentication
    • Facebook
    • Google
  • Upload Photo to S3 amazon
  • Docker

Prerequisites

Installation

Fist, install Yeoman and generator-expressjs-rest using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-expressjs-rest

Generators

Then, you can use yo to generate your project.

yo expressjs-rest # generate a new project
yo expressjs-rest:api # generate a new api endpoint inside your project

Commands

After you generate your project, these commands.

cd your-project-name
mv .env.example .env

docker-compose build
docker-compose run --rm client yarn build
docker-compose up

Playing locally

Deploy

Directory structure

Overview

src/
โ”œโ”€ api/
โ”‚  โ”œโ”€ auth/
โ”‚  โ”‚  โ”œโ”€ auth.controller.js
โ”‚  โ”‚  โ”œโ”€ auth.service.js
โ”‚  โ”‚  โ”œโ”€ auth.validation.js
โ”‚  โ”‚  โ”œโ”€ index.js
โ”‚  โ”‚  โ””โ”€ index.test.js
โ”‚  โ”œโ”€ uploads/
โ”‚  โ”‚  โ”œโ”€ index.js
โ”‚  โ”‚  โ”œโ”€ upload.controller.js
โ”‚  โ”œโ”€ users/
โ”‚  โ”‚  โ”œโ”€ index.js
โ”‚  โ”‚  โ”œโ”€ user.controller.js
โ”‚  โ”‚  โ”œโ”€ user.validation.js
โ”‚  โ”‚  โ”œโ”€ user.model.js
โ”‚  โ”‚  โ”œโ”€ user.service.js
โ”‚  โ”‚  โ””โ”€ user.test.js
โ”‚  โ””โ”€ index.js
โ”œโ”€ services/
โ”‚  โ”œโ”€ index.js
โ”‚  โ”œโ”€ jwt.js
โ”‚  โ”œโ”€ logger.js
โ”‚  โ”œโ”€ mailgun.js
โ”‚  โ”œโ”€ mongoose.js
โ”‚  โ”œโ”€ passport.js
โ”‚  โ”œโ”€ response.js
โ”‚  โ”œโ”€ s3.js
โ”‚  โ”œโ”€ swagger.js
โ”‚  โ””โ”€ your-service.js
โ”œโ”€ app.js
โ”œโ”€ config.js
โ””โ”€ index.js

src/api/

Here is where the API endpoints are defined. Each API has its own folder.

src/api/some-endpoint/model.js

It defines the Mongoose schema and model for the API endpoint. Any changes to the data model should be done here.

src/api/some-endpoint/controller.js

This is the API controller file. It defines the main router middlewares which use the API model.

src/api/some-endpoint/index.js

This is the entry file of the API. It defines the routes using, along other middlewares (like session, validation etc.), the middlewares defined in the some-endpoint.controller.js file.

services/

Here you can put helpers, libraries and other types of modules which you want to use in your APIs.

TODO

  • Support optional phone authentication
  • Support optional email confirmation process
  • Support Twitter and other social login methods
  • Socket.io support

PRs are welcome.

Credits

@minhuyen and all contributors

License

MIT ยฉ minhuyen

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