Task 1 โ CodeAlpha Internship Project
A fully functional, modern e-commerce store built with HTML, CSS, JavaScript (frontend) and Django + Python (backend), featuring user authentication, a real database, shopping cart, wishlist, and order processing.
| Layer | Technology |
|---|---|
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Backend | Django 5, Django REST Framework |
| Database | SQLite (via Django ORM) |
| Auth | Token-based authentication (DRF) |
- ๐๏ธ Product Listings โ 20 products across 6 categories with filters & sorting
- ๐ Search โ Live product search (
Ctrl+K) - ๐ Shopping Cart โ Add, remove, update quantities; persists across sessions
- โค๏ธ Wishlist โ Save products for later
- ๐ค User Auth โ Register & Login with token authentication
- ๐ฆ Order Processing โ Full 3-step checkout (Shipping โ Payment โ Review)
- ๐ Order History โ View all past orders per user
- ๐๏ธ Coupon Codes โ e.g.,
LUXE20for 20% off - ๐ Dark Theme โ Premium glassmorphism UI design
- ๐ฑ Responsive โ Mobile-first design with hamburger nav
- โ๏ธ Django Admin โ Manage products, orders, and users
CodeAlpha_Simple_Ecommerce/
โโโ README.md
โโโ frontend/ โ Frontend (open index.html)
โ โโโ index.html โ Entry point
โ โโโ css/
โ โ โโโ style.css โ Design system & tokens
โ โ โโโ components.css โ UI components
โ โ โโโ pages.css โ Page layouts
โ โโโ js/
โ โโโ data.js โ Mock product data
โ โโโ store.js โ Cart & wishlist state
โ โโโ components.js โ Reusable UI renderers
โ โโโ pages.js โ Page renderers (10 pages)
โ โโโ app.js โ SPA router & global logic
โ โโโ api.js โ Django REST API client
โ
โโโ backend/ โ Django backend
โโโ manage.py
โโโ requirements.txt
โโโ db.sqlite3 โ SQLite database (auto-created)
โโโ luxe/
โ โโโ settings.py
โ โโโ urls.py
โโโ store/
โโโ models.py โ Product, Cart, Order, User models
โโโ serializers.py โ DRF serializers
โโโ views.py โ REST API views
โโโ urls.py โ API URL routing
โโโ admin.py โ Django admin config
โโโ fixtures/
โโโ products.json โ Seed data (20 products)
- Python 3.10+
- A modern web browser
git clone https://github.com/yourusername/CodeAlpha_Simple_Ecommerce.git
cd CodeAlpha_Simple_Ecommerce# Navigate to backend folder
cd backend
# Create virtual environment
python -m venv .venv
# Activate it (Windows)
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create database & tables
python manage.py makemigrations store
python manage.py migrate
# Load 20 seed products
python manage.py loaddata store/fixtures/products.json
# Create admin user
python manage.py createsuperuserpython manage.py runserverServer runs at: http://localhost:8000
Simply open UI/index.html in any browser โ no server needed for the frontend.
| URL | Description |
|---|---|
UI/index.html |
Frontend store |
http://localhost:8000/admin/ |
Django Admin panel |
http://localhost:8000/api/products/ |
Products API |
http://localhost:8000/api/auth/register/ |
Register endpoint |
http://localhost:8000/api/cart/ |
Cart API |
http://localhost:8000/api/orders/ |
Orders API |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register/ |
Create account |
POST |
/api/auth/login/ |
Login โ get token |
GET |
/api/auth/me/ |
Current user info |
GET |
/api/products/ |
List products (filterable) |
GET |
/api/products/<id>/ |
Product detail |
GET |
/api/categories/ |
Category list |
GET |
/api/cart/ |
Get user's cart |
POST |
/api/cart/add/ |
Add item to cart |
POST |
/api/wishlist/toggle/<id>/ |
Toggle wishlist |
POST |
/api/orders/create/ |
Place order |
GET |
/api/orders/ |
Order history |
- Open
UI/index.htmlin your browser - Click ๐ค Login in the navbar to register or log in
- Browse products on the Shop page
- Add items to your Cart or Wishlist
- Use coupon code
LUXE20at checkout - Complete the 3-step checkout flow
- View past orders by clicking your username โ My Orders
CodeAlpha Internship โ Task 1
Built with โค๏ธ using Django + Vanilla JS
This project is for educational purposes as part of the CodeAlpha internship program.