项目作者: damienzeng73

项目描述 :
A simple Shopping-cart built with React and Django REST Framework(DRF)
高级语言: JavaScript
项目地址: git://github.com/damienzeng73/shopping-cart.git
创建时间: 2017-11-16T07:45:39Z
项目社区:https://github.com/damienzeng73/shopping-cart

开源协议:MIT License

下载


Shopping-cart

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

Dependencies

  • Python3+
  • Node
  • PostgreSQL

Getting Started

Installation

Clone this repository:

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

Create virtualenv and install all requirements in backend directory:

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

Install all needed node_modules in frontend directory:

  1. cd shopping-cart/frontend/
  2. yarn install

or with npm:

  1. npm install

Prepare database in postgreSQL:

  1. sudo -u postgres psql
  2. CREATE DATABASE shopping_cart; # Don't forget the semicolon in the end
  3. # Quit postgresql shell
  4. \q

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

  1. DATABASES = {
  2. 'default': {
  3. 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  4. 'NAME': 'shopping_cart',
  5. 'USER': 'YOUR_USERNAME', # replace with your own username
  6. 'PASSWORD': 'YOUR_PASSWORD', # replace with your own password
  7. 'HOST': 'localhost',
  8. 'PORT': ''
  9. }
  10. }

Fire up backend server:

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

Open another terminal for frontend server:

  1. cd shopping-cart/frontend/
  2. yarn start

or with npm:

  1. 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.