Skip to content

erodrago/shopping-cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Shopping Cart application

Simple demonstration of a shopping cart microservice

Table of Contents
  1. About The Project
  2. Getting Started
  3. Future work
  4. Contributing

About The Project

This is a simple microservice that demonstrate functionalities of a shopping cart. A shopping cart on an ecomerce site is a service that facilitates the purchase of a product or service by accepting customers payment and sending to other services for processing.

Features of the shopping cart:

  • Simple functionalities for adding product, categories, users and discounts to bootstrap the shopping cart.
  • Add items to a cart.
  • Remove items from a cart
  • Edit items in a cart.
  • Order selected items

ERD Diagram


The following is an ERD Diagram of the project.

Alt text

Built With

The following is a list of technologies used in the project:

  • Language: JavaScript
  • Database: mysql
  • Server: Node, Express
  • Testing: Jest, supertest
  • ORM used: Sequelize
  • Caching: Redis (in progress)

Getting Started

In this section we discuss how to setup and run the application locally.

Prerequisites

You should have npm and mysql installed.

Installation and setup

  1. Clone the repo

    git clone https://github.com/erodrago/shopping-cart.git
  2. Install NPM packages: Navigate to the cloned directory and run

    npm install
  3. Enter your DB configurations in .env file. the format of the dot env as described in .env.example

        DATABASE=db_name
        DATABASE_USER=db_username
        PASSWORD=db_password
        HOST=localhost
        DATABASE_DIALECT=mysql
    
        PORT=3000
  4. Set up database table by running:

    npm run db:setup
    

Run on local machine

You can run by executing on terminal either:

    npm start

or

    npm run dev

To run tests

  1. Initialize test database:
    npm run db:create:test
    
  2. Run tests
    npm test
    

Documentation

After running the project, to view documentation via swagger, in your browser navigate to:

http://localhost:PORT/api-docs

Alternatively in the project directory there is a directory called postman, navigate and download the json, import the Json file on postman and you will be ready to test the APIs.

Future Work

  1. Docker integration
  2. Security integration
  3. Demonstration of caching
  4. Experiment with graphql

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published