Skip to content

inxane-rudrakxh/CodeAlpha_Simple_Ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CodeAlpha_Simple E-commerce Store

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.


๐Ÿš€ Tech Stack

Layer Technology
Frontend HTML5, CSS3, Vanilla JavaScript
Backend Django 5, Django REST Framework
Database SQLite (via Django ORM)
Auth Token-based authentication (DRF)

โœจ Features

  • ๐Ÿ›๏ธ 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., LUXE20 for 20% off
  • ๐ŸŒ™ Dark Theme โ€” Premium glassmorphism UI design
  • ๐Ÿ“ฑ Responsive โ€” Mobile-first design with hamburger nav
  • โš™๏ธ Django Admin โ€” Manage products, orders, and users

๐Ÿ“ Project Structure

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)

โš™๏ธ Setup & Installation

Prerequisites

  • Python 3.10+
  • A modern web browser

1. Clone / Download the project

git clone https://github.com/yourusername/CodeAlpha_Simple_Ecommerce.git
cd CodeAlpha_Simple_Ecommerce

2. Set up the backend

# 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 createsuperuser

3. Start the backend server

python manage.py runserver

Server runs at: http://localhost:8000

4. Open the frontend

Simply open UI/index.html in any browser โ€” no server needed for the frontend.


๐Ÿ”— URLs

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

๐Ÿ—„๏ธ API Endpoints

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

๐ŸŽฎ Usage

  1. Open UI/index.html in your browser
  2. Click ๐Ÿ‘ค Login in the navbar to register or log in
  3. Browse products on the Shop page
  4. Add items to your Cart or Wishlist
  5. Use coupon code LUXE20 at checkout
  6. Complete the 3-step checkout flow
  7. View past orders by clicking your username โ†’ My Orders

๐Ÿ‘จโ€๐Ÿ’ป Author

CodeAlpha Internship โ€” Task 1
Built with โค๏ธ using Django + Vanilla JS


๐Ÿ“„ License

This project is for educational purposes as part of the CodeAlpha internship program.

About

๐Ÿ›๏ธ CodeAlpha Task 1 | E-commerce store built with HTML, CSS, JavaScript (frontend) + Django & SQLite (backend). Features auth, cart, wishlist & checkout.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors