Skip to content

Mr-Parth/Django-Shopping-Cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopping Cart

This project provides a shopping cart system with user authentication, role-based access control, and various cart management and product item management functionalities. Built using Django and Django Rest Framework (DRF)

Installation

  1. Install Dependencies:
  pip install -r requirements.txt
  1. Database Setup:
  python manage.py makemigrations
  python manage.py migrate
  1. Create a Superuser (Admin):
  python manage.py createsuperuser
  1. Run Development Server:
  python manage.py runserver
  1. Testing
  python manage.py test

Access django admin panel at localhost:8000/admin

Database used : db.sqlite3 (Since it's easy to setup for development. It is a single compact file in a well-defined cross-platform format. For production environment, it is better to changed it to postgresql or other sql variants depending upon further usecases)

Pass Token <token_generated_by_login_or_registration> as Authorization in Headers while triggering any non public APIs

API Implemented

Public APIs

Login User

Returns JWT Token and User Data

  POST /api/core/user/login

Register User

Returns JWT Token and Created User Data

  POST /api/core/user/register

Admin Role APIs

Suspend User

  POST /api/core/user/suspend_user/<int:user_id>'

Add Product Item

  POST /api/item/add_item/'

Add Product Items in Bulk

  POST /api/item/add_items/'

Edit Product Item

  PUT /api/item/edit_item/<int:item_id>'

Delete Product Item

  DELETE /api/item/delete_item/<int:item_id>'

Authorised APIs Irrespective of Role

Add Product Item in User Cart

  POST /api/user/cart/add_item/<str:product_name>'

Remove Product Item in User Cart

  DELETE /api/user/cart/remove_item/<str:product_name>'

List Product Items in User Cart

  GET /api/user/cart/list_items/'

License

MIT

About

This project provides a shopping cart system with user authentication, role-based access control, and various cart management and product item management functionalities. Built using Django and Django Rest Framework (DRF)

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages