Skip to content

harshithvh/pactle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Storefront

A full-stack e-commerce application built with Django REST Framework (backend) and React (frontend), featuring product browsing, cart management, and Stripe payment integration.

Features

Backend (Django + DRF)

  • Product management with inventory tracking
  • User authentication with JWT tokens
  • Shopping cart functionality
  • Order management with status tracking
  • Stripe payment integration
  • PostgreSQL database
  • Admin interface for product management

Frontend (React)

  • Product catalog with search and filtering
  • Shopping cart with real-time updates
  • User authentication (login/register)
  • Checkout process with Stripe integration
  • Order history
  • Responsive design with Tailwind CSS

Tech Stack

Backend:

  • Django 4.2
  • Django REST Framework
  • PostgreSQL
  • Stripe Python SDK
  • JWT Authentication
  • CORS headers

Frontend:

  • React 19
  • TypeScript
  • Tailwind CSS
  • React Query (TanStack Query)
  • Wouter (routing)
  • Stripe.js

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • PostgreSQL 12+
  • Stripe account (for payments)

Quick Setup

1. Clone the repository

git clone <repository-url>
cd ecommerce-storefront

2. Run the setup script

# For Windows
setup.bat

# For Unix/Linux/macOS
chmod +x setup.sh
./setup.sh

Manual Setup

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables: Create a .env file in the backend directory with:
# Database settings
DB_NAME=ecommerce_db
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=5432

# Django settings
SECRET_KEY=your-secret-key-here
DEBUG=True

# Stripe settings
STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
  1. Set up PostgreSQL database:
CREATE DATABASE ecommerce_db;
CREATE USER your_db_user WITH PASSWORD 'your_db_password';
GRANT ALL PRIVILEGES ON DATABASE ecommerce_db TO your_db_user;
  1. Run migrations:
python manage.py migrate
  1. Load sample data:
python manage.py load_sample_products
  1. Create superuser:
python manage.py createsuperuser
  1. Start the development server:
python manage.py runserver

The backend will be available at http://localhost:8000

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Configure environment variables: Create a .env file in the frontend directory with:
REACT_APP_API_URL=http://localhost:8000
REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
  1. Start the development server:
npm start

The frontend will be available at http://localhost:3000

Project Structure

ecommerce-storefront/
├── backend/
│   ├── ecommerce/          # Django project settings
│   ├── store/              # Store app (products, cart)
│   ├── orders/             # Orders app
│   ├── manage.py
│   ├── requirements.txt
│   └── .env
├── frontend/
│   ├── public/
│   ├── src/
│   │   ├── components/     # Reusable UI components
│   │   ├── contexts/       # React contexts (auth, cart)
│   │   ├── hooks/          # Custom hooks
│   │   ├── lib/            # Utilities and configurations
│   │   ├── pages/          # Page components
│   │   ├── shared/         # Shared types and schemas
│   │   └── App.js
│   ├── package.json
│   └── .env
├── setup.sh
├── setup.bat
└── README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published