๐จโ๐ป What was developed
An API that uses the MSC (model-service-controller) architecture! Developed using TDD.
The built API is a sales management system in dropshipping format where it is possible to create, view, delete and update products and sales.
The MySQL database was used for data management. Also, the API is to be RESTful.
๐ฒ ER Diagram, Entities and Scripts
To guide the manipulation of the tables, use the following DER:
The database will have three tables:
- The
products
table, with theid
andname
attributes; - The
sales
table, with theid
anddate
attributes; - The
sales_products
table, with thesale_id
,product_id
andquantity
attributes; - The database creation script can be seen here;
- The script that populates the database can be seen here;
The products
table has the following format: (The id will be generated automatically)
The sales
table has the following format: (The id and date are generated automatically)
The sales_products
table is the table that makes the N:N
relationship between products
and sales
and has the following format: (The product and the sale are deleted automatically)
- Create the database and generate the tables:
npm run migration
- Clean and populate the database:
npm run seed
- Start the Node server:
npm start
- Start the Node server with nodemon:
npm run debug
- Run the unit tests:
npm run test:mocha
- Run the linter:
npm run lint