A full-stack e-commerce application built with Django REST Framework (backend) and React (frontend), featuring product browsing, cart management, and Stripe payment integration.
- 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
- 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
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
- Python 3.8+
- Node.js 16+
- PostgreSQL 12+
- Stripe account (for payments)
git clone <repository-url>
cd ecommerce-storefront# For Windows
setup.bat
# For Unix/Linux/macOS
chmod +x setup.sh
./setup.sh- Navigate to backend directory:
cd backend- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
Create a
.envfile 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- 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;- Run migrations:
python manage.py migrate- Load sample data:
python manage.py load_sample_products- Create superuser:
python manage.py createsuperuser- Start the development server:
python manage.py runserverThe backend will be available at http://localhost:8000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Configure environment variables:
Create a
.envfile in the frontend directory with:
REACT_APP_API_URL=http://localhost:8000
REACT_APP_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key- Start the development server:
npm startThe frontend will be available at http://localhost:3000
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