/shopping-cart

A simple Shopping-cart built with React and Django REST Framework(DRF)

Primary LanguageJavaScriptMIT LicenseMIT

Shopping-cart

A simple Shopping-cart built with React and Django REST Framework(DRF).

Dependencies

  • Python3+
  • Node
  • PostgreSQL

Getting Started

Installation

Clone this repository:

git clone https://github.com/damnee562/shopping-cart.git

Create virtualenv and install all requirements in backend directory:

cd shopping-cart/backend/
python3 -m venv venv_name
source venv_name/bin/activate
pip install -r requirements.txt

Install all needed node_modules in frontend directory:

cd shopping-cart/frontend/
yarn install

or with npm:

npm install

Prepare database in postgreSQL:

sudo -u postgres psql
CREATE DATABASE shopping_cart; # Don't forget the semicolon in the end

# Quit postgresql shell
\q

Set up database connection in shopping-cart/backend/backend/settings.py in DATABASES section:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'shopping_cart',
        'USER': 'YOUR_USERNAME', # replace with your own username
        'PASSWORD': 'YOUR_PASSWORD', # replace with your own password
        'HOST': 'localhost',
        'PORT': ''
    }
}

Fire up backend server:

cd shopping-cart/backend/
python manage.py migrate
python manage.py runserver

Open another terminal for frontend server:

cd shopping-cart/frontend/
yarn start

or with npm:

npm start

Screenshots

Shopping page

alt text

Filter products

alt text

Add product into cart

alt text

alt text

Cart page

alt text

alt text

alt text

alt text

Account page

alt text

Check orders and Manage products

alt text

alt text

Add new product

alt text

alt text

alt text

Built With

License

This project is licensed under the MIT License - see the LICENSE file for details.