Skip to content

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

License

Notifications You must be signed in to change notification settings

damienzeng73/shopping-cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shopping-cart

A smiple Shopping-cart built with ReactJS and Django REST Framework(DRF).

Dependencies

  • Python3+
  • Node.js
  • PostgreSQL

Getting Started

Installation

Clone this repository:

git clone git@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/
npm install

or if you're using yarn:

yarn 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/
npm start

or if you're using yarn:

yarn 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