Skip to content

A full-stack E-commerce platform built with Django and Django REST Framework, designed for secure authentication, payment processing, order tracking, user management capabilities and a seamless shopping experience.

Notifications You must be signed in to change notification settings

raghav-patidar1/django-ekart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

95 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Ekart

A full-stack E-commerce platform built with Django and Django REST Framework, designed for secure authentication, payment processing, order tracking, user management capabilities and a seamless shopping experience.

Features

๐Ÿ” Authentication System

  • User sign-up/sign-in with OAuth2.0 (Google login)
  • Email verification & password management
  • TOTP-based 2FA with backup codes for account safety

๐Ÿ›๏ธ Products & Catalog

  • Product listing with search & filters
  • Category-based browsing

๐Ÿ’ณ Card Payment Integration

  • Secure credit/debit card transactions powered by Stripe API

๐Ÿ›’ Cart Management

  • Session-based carts for guests
  • Persistent model-based carts for registered users

๐Ÿ“ฆ Order Management

  • Complete order lifecycle: creation, tracking, and admin management

โญ Review System

  • Users can add reviews
  • Owner-only edit/delete permissions to maintain authenticity

๐Ÿ“ Address Management

  • Add, update, and manage multiple shipping addresses

Tech Stack

  • Backend: Python, Django, Django REST Framework
  • Frontend: HTML, CSS, JavaScript
  • Database: SQLite
  • Payment Gateway Integration: Stripe

Project Demo

๐Ÿ‘‰ Click here to watch project demo video.

Prerequisites

To run this project successfully, ensure you have the following:

  • Python 3.12+

  • Email account with password (recommended: use an app password instead of your primary email password)

  • Google OAuth Credentials (for Social Login): create a Google OAuth Client ID and Client Secret from the Google Cloud Console

  • Stripe Account & API Keys (for Payment Processing). You can create an account from here Stripe

  • Live URL for Webhooks (Ngrok Recommended). You can install it from here Ngrok

Installation

Clone Repository

git clone https://github.com/raghav-patidar1/django-ekart.git
cd django-ekart

Create and Activate Virtual Environment

python -m venv venv

source venv/bin/activate   # On Linux/Mac
venv\Scripts\activate      # On Windows

Install Dependencies

pip install -r requirements.txt

Generate Live URL

  1. Open ngrok and start a tunnel to your django server.

    ngrok http 8000
  2. Copy the generated HTTPS forwarding URL (e.g., https://myproject-12345.ngrok.io) and use this as your live URL for webhooks and update .env file accordingly (as explained below).

Stripe Webhook Setup

  1. Login to Stripe.

  2. Copy Stripe Secret Key from dashboard.

  3. In your Stripe Dashboard โ†’ Developers โ†’ Webhooks, click on + Add Destination

  4. Select Checkout events (e.g., checkout.session.completed or select all checkout events).

  5. Select Webhook endpoint as destination type and add an endpoint URL.

    <your-live-url>/orders/stripe/webhook/

    For example:

    https://myproject-12345.ngrok.io/orders/stripe/webhook/

    Copy the Stripe Secret Key and Webhook Secret, you will need them during setting up environment variables

Setup Environment Variables

  1. Copy .env.example โ†’ .env:

    cp .env.example .env
  2. Fill in your credentials (Google, Stripe, Django settings).

    Example .envconfiguration file for a live server.

SECRET_KEY=<your-secret-key>
DEBUG=True
EMAIL_HOST_USER='your-email-address'
EMAIL_HOST_PASSWORD='your-app-password-without-space'     

# Example for HTTP (port 80)
SITE_SCHEME=http
SITE_DOMAIN=<live domain>
SITE_PORT=80

# Example for HTTPS (port 443)
SITE_SCHEME=https
SITE_DOMAIN=<live domain>
SITE_PORT=443

STRIPE_SECRET_KEY=<your-stripe-secret sk_test_...>
STRIPE_WEBHOOK_SECRET=<your-webhook-secret whsec_...>

GOOGLE_CLIENT_ID=<your-client-id>
GOOGLE_CLIENT_SECRET=<your-client-secret>

โš ๏ธ Important: When setting SITE_DOMAIN, you should not include the scheme (http or https) or trailing slash. It must only be the raw domain or hostname.

SITE_DOMAIN=myproject-12345.ngrok.io

To generate a Django secret key:

python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"

Apply Migrations

python manage.py makemigrations
python manage.py migrate

Create Super user

python manage.py createsuperuser

Run Development Server

python manage.py runserver

Access Web App

  • Visit your Ngrok live URL in the browser: https://myproject-12345.ngrok.io

Post Setup

  1. Log in to the Django admin (/admin/).
  2. Add Categories and Products.
  3. Configure store settings from StoreConfig model (shipping charges and tax rate)

Acknowledgements

About

A full-stack E-commerce platform built with Django and Django REST Framework, designed for secure authentication, payment processing, order tracking, user management capabilities and a seamless shopping experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published