A simple Shopping-cart built with React and Django REST Framework(DRF).
- Python3+
- Node
- PostgreSQL
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
- React - A JavaScript library for building UI
- Semantic UI React - A React UI framework
- Redux - A predictable state container for JavaScript apps
- Django REST framework - A powerful and flexible toolkit for building Web APIs
- django-rest-framework-jwt - JSON Web Token Authentication support for Django REST framework
- axios - A Promised based HTTP client
- toastr - Simple javascript toast notifications
This project is licensed under the MIT License - see the LICENSE file for details.