Simple REST API

Built with Express.js,Mysql, and Sequalize.

Table of Contents

Introduction

Lorem Ipsum

Features

  • CRUD Employees
  • CRUD Companies
  • Sequalize ORM
  • cache

Built With

Express Sequalize MySQL2 bcryptjs

Requirements

  • Node.js - Download and Install Node.js - Simple bash script to manage multiple active node.js versions.
  • npm
  • Nodemon - Download and Install Nodemon - nodemon is a tool that automatically restarting the node application when file changes in the directory are detected.
  • postman (installer or chrome extension)
  • code editor (visual studio code recommend)
  • mysql (xampp)

Installation

Install the dependencies, migrate, start the server.

$ git clone https://github.com/tejojr/Express-Simple-CRUD-with-Sequelize-ORM.git
$ cd Express-Simple-CRUD-with-Sequelize-ORM
$ npm install
$ npm start

**migrate durung

Setup .env file

  • In windows OS, you can open command prompt, change directory to your project directory. Example, My project directory
    E:\my_project
    
  • Then you can type,
    copy .env.example .env
    
  • Then Setup .env

Plugins

Plugin Version
bcryptjs ^2.4.3
body-parser ^1.19.0
cors ^2.8.5
express ^4.17.1
dotenv ^8.2.0
morgan ^1.9.1
mysql2 ^2.0.0
redis ^2.8.0
node-redis-scan ^1.1.0
sequalize ^5.21.1

API Route URL (Public)

Companies

Plugin Purpose Method
/api/v1/companies Insert Company POST
/api/v1/companies/:id Update Company PATCH
/api/v1/companies/:id Delete Company DELETE
/api/v1/companies/ Select All Company GET
/api/v1/companies/:id Select by ID GET

Employees

Plugin Purpose Method
/api/v1/employees Insert Employee POST
/api/v1/employees/:id Update Employee PATCH
/api/v1/employees/:id Delete Employee DELETE
/api/v1/employees/ Select All Employee GET
/api/v1/employees/:id Select by ID GET

Deploy

Contributor

Ammar Annajih Pasifiky
Ammar Annajih Pasifiky