ImVictorM / Store-Manager

Store management RESTful API πŸ›οΈ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Store Manager πŸ›οΈ

Project Context πŸ’‘

This project is my first RESTful API made using the MSC (Model-Service-Controller) architecture. The API is a sales management system based on dropshipping where you can create, visualize, delete and update products and sales.

Acquired Knowledge πŸ“–

In this project, I was able to:

  • Learn and implement the MSC architecture;
  • Divide my code into layers following the MSC architecture;
  • Create unit tests for the model, service, and controller layers;
  • Test using Mocha, Chai, and Sinon;
  • Validate requests using Joi;
  • Create a RESTful API;
  • Connect the API to a MySQL database and use it;

Main Technologies used 🧰

JavaScript Express Node.JS MySQL Mocha JS Chai JS Sinon JS Joi Docker
javascript express nodejs mysql mocha-js chai-js sinon-js joi docker

Running the application βš™οΈ

  1. Clone and enter this repository
git clone git@github.com:ImVictorM/Store-Manager.git && cd Store-Manager
  1. Install the dependencies
npm install
  1. Get the containers running
docker-compose up -d
  1. Enter the server's container
docker exec -it store_manager bash
  1. Start the server
npm run start
---- or ----
npm run debug

Once the server is running, you must create and populate the database. To do this, open another terminal, enter the server's container (step 4) and type the following command:

npm run migration && npm run seed

Testing πŸ› οΈ

Note: for the tests to work correctly, the server must be running.

Running all tests:

npm test

About

Store management RESTful API πŸ›οΈ


Languages

Language:JavaScript 98.0%Language:Shell 2.0%