lukecp5 / e-commerce-backend

The E-Commerce Backend is a REST API for an internet retail website. The API is built onto an Express.js server that uses Sequelize ORM to handle data storage and retrieval

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E-Commerce Backend

wakatime

Internet retail, also known as e-commerce, is the largest sector of the electronics industry, generating an estimated $29 trillion in 2019. E-commerce platforms like Shopify and WooCommerce provide a suite of services to businesses of all sizes. The goal of this project was to understand the fundamental architecture of these platforms.

The E-Commerce Backend is a REST API for an internet retail website. The API is built onto an Express.js server that uses Sequelize to interact with a MySQL database. Sequelize is a promise-based Node.js ORM(Object Relation Mapping) for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

This E-Commerce backend has the API routes that point to each of the standard CRUD operations for each data group. The routes can be used to:

  • Create categories, products, tags
  • View categories, products, tags
  • Establish associations between the different entities
  • Update categories, products, & tags
  • Delete entries from the database

All that's missing to make this a complete E-Commerce website is a simple front-end application that makes calls to the API routes that are already built-in. If that's too much, simply try making requests to the API routes from your browser to the see the raw data that's returned.


Table of contents


Installation

Start with cloning this repo on your local machine:

$ git clone https://github.com/lukecp5/e-commerce-backend.git
$ cd e-commerce-backend

To install and set up the application, run:

$ npm install employee-tracker

You will also need to place a .env file in the root directory of the project, in order to connect to your MySQL database. Here's an example:

file: .env

DB_NAME=library_db
DB_PASSWORD=
DB_USER=root

Usage

This section assumes you have installed the application, and created the .env file in the root directory.

To finish the set-up the application, complete the following steps:

  1. Create a MySQL database on your local machine using the schema.sql file located in the /db/ directory(From the MySQL CLI, source db/schema.sql)
  2. Seed the database with sample data to be used for testing purposes(Run npm run seed from inside the root directory of the project)

Now you're ready to start the application! You can start the server by running:

npm start

The server is running, now you can make requests to it through your desired method. If you're new to the backend, I suggest trying out Postman


Built With


Demonstration Video

If you'd like to see a full demo of the application, please visit the following link: Demo Video on Google Drive


Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Add your changes: git add .
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request 😎

Author

Luke Poirrier
LinkedIn: @luke-poirrier
Email: Luke@LukePoirrier.com
Portfolio: LukePoirrier.com


License

This application is licensed under the MIT License, you can find the full license information here


About

The E-Commerce Backend is a REST API for an internet retail website. The API is built onto an Express.js server that uses Sequelize ORM to handle data storage and retrieval

License:MIT License


Languages

Language:JavaScript 100.0%