Nodetomic-api-swagger

Simple and fast Restful API designed for horizontal scalability including cluster, based on Swagger, Socket.io, Nodejs, Redis + Passport, MongoDB, Express
Examples

http://localhost:8000/docs
Example horizontal scalability
Technologies

Requirements
Installation
git clone https://github.com/kevoj/nodetomic-api-swagger
cd nodetomic-api-swagger
npm i
Features
-
Tokens
-
Redis
- Pub/Sub Expired, del, etc by key
-
Middleware
- Login validation
- Role validation
-
Socket.io
-
Authentication
- local
- facebook
- twitter
- google
- github
- bitbucket
-
Session
- Single or Multiple (One or more devices at the same time)
- Get list of sessions
- Destroy a session
-
Scalability
- Support for simple execution
- Support for cluster
Structure
- client
- src
- api
- controllers
- models
- sockets
- swagger
- assets
- auth
- controllers
- passports
- swagger
- services
- config
- core
- lib
- seeds
- views
- app.js
Development
Start
npm start
Build
npm run build
Test
npm test
Lint
npm lint
Node [Production]
Default
Description: Run node in a single thread
npm run serve
PM2 [Development]
Simple
Description: Run pm2 in a single thread and run the monitor
npm run dev-simple
Cluster
Description: Run pm2 in multiple threads and run the monitor
npm run dev-cluster
PM2 [Production]
Simple
Description: Run pm2 in a single thread
npm run simple
Cluster
Description: Run pm2 in multiple threads
npm run cluster
Destroy
PM2
Description: destroyed pm2 simple and pm2 cluster
npm stop
Node
Description: destroyed all process for node
killall node
License
MIT © Leonardo Rico