All Projects → yug95 → node-mysql

yug95 / node-mysql

Licence: MIT license
Node with mysql boilerplate

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-mysql

React-Express-JWT-UserPortal
React.js & Express.js User portal Using Core UI, JWT, JWT Token, Refresh Token, Role & Permission management, User manamgenet, Event Log.
Stars: ✭ 22 (-69.44%)
Mutual labels:  jwt-token, jwt-authentication, jwt-middleware
laravel-vue-starter
Well Documented Laravel Starter App From Development to Production. For Full Blown RESTFUL API and SPA with Beautiful UI Using Buefy / ElementUi For Reusable Vue Components
Stars: ✭ 80 (+11.11%)
Mutual labels:  jwt-token, jwt-authentication, jwt-middleware
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 (-76.39%)
Mutual labels:  jwt-token, jwt-authentication, nodemailer
jwx
JSON/JWK/JWS/JWT/Base64 library in SPARK
Stars: ✭ 15 (-79.17%)
Mutual labels:  jwt-token, jwt-authentication
MyAPI
A template to create awesome APIs easily ⚡️
Stars: ✭ 117 (+62.5%)
Mutual labels:  jwt-token, jwt-authentication
gatsby-starter-redux-saas
An Gatsby starter for Saas products. Uses redux and apollo and a graphql token auth backend.
Stars: ✭ 18 (-75%)
Mutual labels:  jwt-token, jwt-authentication
Js Stack From Scratch
🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
Stars: ✭ 18,814 (+26030.56%)
Mutual labels:  nodemon, pm2
ts-koa-starter
typescript+koa起手式(简单的空环境)
Stars: ✭ 92 (+27.78%)
Mutual labels:  nodemon, pm2
teaching-nodejs-expressjs-framework-spring-2019-2020
Complete Node-Express Application
Stars: ✭ 16 (-77.78%)
Mutual labels:  nodemon, node-module
Auth-using-Vuejs-express-jwt-nodejs
Login and signup form and authentication using Vue.js, express, mongodb, JWT and bootstrap-vue
Stars: ✭ 17 (-76.39%)
Mutual labels:  jwt-token, jwt-authentication
TvrboReact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-81.94%)
Mutual labels:  jwt-authentication, nodemailer
spring-boot-login-example
Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example
Stars: ✭ 50 (-30.56%)
Mutual labels:  jwt-token, jwt-authentication
Nodefony Starter
Nodefony Starter Node.js Framework
Stars: ✭ 95 (+31.94%)
Mutual labels:  mvc-framework, pm2
Quasar-JWT
Quasar - JWT Authentication Starter Kit
Stars: ✭ 38 (-47.22%)
Mutual labels:  jwt-token, jwt-authentication
Smarthome
💡 智能电器管理综合系统
Stars: ✭ 33 (-54.17%)
Mutual labels:  nodemon, pm2
Pharmacy-Mangment-System
👨‍💻 🏥 MEAN stack Pharmacy Management system.
Stars: ✭ 229 (+218.06%)
Mutual labels:  jwt-authentication, nodemailer
express-mongo-jwt-boilerplate
Express Mongo JsonWebToken boilerplate
Stars: ✭ 100 (+38.89%)
Mutual labels:  jwt-token, jwt-authentication
ahobsu-node-backend
🌈 MOTI ! Make Own True Identity ⭐️ 유니큐와 유초코파이 노드로 탈주하다😎
Stars: ✭ 16 (-77.78%)
Mutual labels:  nodemon, pm2
Express Starter
🚚 A boilerplate for Node.js, Express, Mongoose, Heroku, Atlas, Nodemon, PM2, and Babel. REST / GraphQL API Server | PaaS | SaaS | CI/CD | Jest | Supertest | Docker | MongoDB | PostgreSQL | Sequelize | Lodash | RxJS | JWT | Passport | WebSocket | Redis | CircleCI | Apollo | DevSecOps | Microservices | Backend Starter Kit | ES6
Stars: ✭ 353 (+390.28%)
Mutual labels:  nodemon, pm2
arc
Fullstack open source Invoicing application made with MongoDB, Express, React & Nodejs (MERN)
Stars: ✭ 1,291 (+1693.06%)
Mutual labels:  jwt-authentication, nodemailer

Node with MySQL BoilerPlate/Framework

A simple and structured way boilerplate for Node with MySQL, equipped with MVC layer model with basic validation of schema and common error handler, authentication and easily pluggable code base.

This Boilerplate have a basic CRUD operation with MySQL, authetication of API endpoint with JWT Token and Validation of request and response of each route. It contained a documentation folder which contain swagger documentation easy for front-end developer to use and understand. It contained Pm2 which helps to restart, reload and monitor application in production, provides zero downtime availability. It has Nodemailer which will send email. It has bcrypt module which will encrypt password and make it more secure. It contain Artillery for load testing.

PreRequisite

Used Packages

1. MYSQL

 npm install mysql 

2. Express

npm install express 

3. Ajv

npm install ajv 

4. JWT

npm install jsonwebtoken 

5. Nodemon

npm install nodemon 

6. pm2

npm install pm2  
  • pm2 will watch, restart and reload application if any crashes happen, it provide cluster mode as well as zero downtime failure. know more about pm2
  • To Know more about pm2 check here

7. nodemailer

npm install nodemailer  

8. artillery

npm install artillery  
  • artillery will perform load testing and gives logs, how sustainable your Api to perform number of request in per second .know more about artillery
  • To Know more about artillery check here

9. bcrypt

npm install bcrypt  
  • bcrypt will encrypt your password throughing hashing so your password won't store as plain text .know more about bcrypt
  • To Know more about nodemailer check here

Table Creation In DB

  1. Create Table user with id,name,age,state,country columns.
  2. you can try creating your table as well just need to change query and table name in model section.

Get Started

  1. $ git clone https://github.com/yug95/node-mysql.git
  2. $ npm install
  3. Launch Enviornment:
    • $ node app.js or nodemon app.js
  4. In Cluster mode with the help of pm2 [optional step]:
    • $ pm2 start app.js or pm2 start app.js -i <no of instances>
  5. Open in browser:
    • open http://localhost:9890

API Usage

  1. signup route - http://localhost:9890/api/signup
    • pass json object contain username and password.
  2. login route - http://localhost:9890/api/login
    • pass json object contain username and password.
  3. other crud route are in secureApi - localhost:9890/secureApi/user.
    • In all GET, PUT, DELETE and POST request pass token in header which you get in login response.

Example object for login request (body as JSON object) -

{
    "username":"test",
    "password":"testpass"
}

For Other Crud request -

{
   "name":"username",
   "age:11,
   "state":"statename",
   "country":"countryname"
}

Note: You have to pass token for each request as header which youi will get in login response.

Features

  • To perform basic operation all Create, Fetch, Delete and Update functionality.
  • Used Express framework to obtain required operations.
  • Used Express router to route endpoint path.
  • Used JWT Token for security and authentication of API.
  • MVC structure in which Route, Service and Model layer.
  • Used AJV as schema validator which validate request and response schema.
  • Used Connection Pooling which lead to reduce number of conncetion at any point of time and reduce stress in DB which leads to better availability and Performance of DB.
  • Used common error structure format for all type of error throwing in Application.
  • Includes documents folder which contain swagger representation both in JSON and HTML, which will help front-end developer for better understanding.
  • Pm2 a process manager which help to watch, reload, restart and monitor with load balancer in each and every activity.
  • nodemailer is used to send mail over SMTP. as for i now used for sending mail if error comes.
  • bcrypt is used to encrypt your password through salt and hashing technique and which won't store password as plain text in database.
  • artillery is used to perform load testing which will check sustainibility of your API at high traffic.

Swagger Related task

  1. How to Open Swagger -
  2. Go to File and import file option, import JSON file present in document folder.
  3. To Download HTML file of particular JSON
    • Go to Generate Client option and html2 option it will download html file.
  4. Know more about Swagger Check here

Artillery Run

  1. First go to /loadtest folder
  2. you can use artillery in 2 way :-
    • by hardcoding data in yml file.
    • getting data by .csv file.
  3. For option 1 run - artillery run hello.yml
  4. For option 2 first get CSV file with data.
  5. define path in yml file and run example as i Did :- artillery run hellocsv.yml
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].