LUNE is a modern, minimalist full-stack fashion and lifestyle e-commerce application built with Django, SQLite, HTML5, CSS3, and vanilla JavaScript.
The project was developed as Task 1 of the CodeAlpha Full Stack Development Internship, with a focus on building a complete e-commerce workflow from product discovery to cart management, authentication, checkout, order processing, and wishlist functionality.
LUNE provides a complete shopping experience with:
- ποΈ Dynamic product catalog
- π Product search
- ποΈ Category-based browsing
βοΈ Product sorting and filtering- β€οΈ Wishlist functionality
- π Session-based shopping cart
- π€ User registration and authentication
- π¦ Checkout and order processing
- π Order history and order details
- π Stock management
- π Django security features
- β‘ AJAX-powered cart interactions
- π§ͺ Automated Django tests
- HTML5
- CSS3(Vanilla)
- JavaScript (ES6+)
- AJAX / Fetch API
- Python
- Django
- SQLite for development
- PostgreSQL-ready architecture
- Visual Studio Code
- Git
- GitHub
- Python Virtual Environment
The product system provides:
- Dynamic product catalog
- Product detail pages
- Product categories
- Product search
- Product sorting
- Price filtering
- Stock availability filtering
- Trending product support
- Product activation status
- Dynamic product information
LUNE includes a complete user authentication system:
- User registration
- Secure login
- Logout
- User profiles
- Password hashing through Django's authentication system
- Protected user-specific pages
Django's @login_required decorator is used to restrict private functionality such as checkout, orders, and account-related pages.
The shopping cart supports:
- Add products to cart
- Update product quantities
- Remove products
- Session-based cart storage
- Dynamic cart quantity updates
- Cart drawer
- Real-time cart total updates
- AJAX interactions
- Stock-aware cart operations
The frontend communicates with Django through asynchronous requests, allowing cart updates without unnecessary page reloads.
Users can create a personalized wishlist.
Features include:
- Add products to wishlist
- Remove products from wishlist
- User-linked wishlist
- Wishlist persistence through the database
- Wishlist toggle functionality
The checkout system provides a complete order workflow:
- Delivery information
- Order summary
- Shipping calculation
- Server-side total calculation
- Order creation
- Order item records
- Stock deduction
- Order confirmation
- Order details
- Order history
The project uses a sandbox-style Cash on Delivery / Demo payment option for testing the checkout workflow.
No real payment gateway or real-world delivery system is connected to this project.
Security was considered throughout the application using Django's built-in mechanisms.
Django's authentication framework securely hashes user passwords using its password-hashing system.
Django's CSRF middleware protects POST requests against Cross-Site Request Forgery attacks.
AJAX cart requests also include the required CSRF token.
Private views use Django's authentication controls to ensure that users must be logged in before accessing protected functionality.
Order totals are calculated from database records on the server rather than trusting values sent by the browser.
Django forms are used to validate user-submitted information such as registration and checkout details.
LUNE uses a relational database structure managed through Django's ORM.
Django's built-in authentication user model stores:
- Username
- Password
- First name
- Last name
Stores product categories.
Main fields:
nameslugdescriptionimage
Stores product information.
Main fields:
nameslugdescriptionpricestockis_activeis_trendingcreated_atupdated_at
Stores product images associated with products.
Stores customer order and delivery information.
Includes:
- Customer information
- Shipping information
- Order timestamp
- Total amount
- Order status
Stores individual products belonging to an order.
Includes:
- Product
- Quantity
- Purchase-time price
The purchase-time price is stored so that an order retains the price at which the product was purchased.
Connects users with their selected products using a user-linked wishlist and many-to-many product relationship.
A typical cart interaction follows this flow:
User clicks "Add to Cart"
β
JavaScript event listener
β
AJAX / Fetch POST request
β
CSRF token validation
β
Django URL dispatcher
β
Cart view
β
Product retrieved from database
β
Cart updated in session
β
JSON response returned
β
JavaScript updates cart UI
β
Toast notification displayed
This demonstrates the interaction between the frontend, backend, database, and session-based cart system.
CodeAlpha_LUNE_Ecommerce/
β
βββ accounts/
β βββ forms.py
β βββ urls.py
β βββ views.py
β
βββ cart/
β βββ cart.py
β βββ context_processors.py
β βββ urls.py
β βββ views.py
β
βββ config/
β βββ settings.py
β βββ urls.py
β βββ asgi.py
β βββ wsgi.py
β
βββ orders/
β βββ forms.py
β βββ models.py
β βββ urls.py
β βββ views.py
β
βββ products/
β βββ management/
β β βββ commands/
β β βββ seed_db.py
β βββ models.py
β βββ urls.py
β βββ views.py
β βββ tests.py
β
βββ wishlist/
β βββ models.py
β βββ urls.py
β βββ views.py
β
βββ static/
β βββ css/
β β βββ main.css
β β βββ components.css
β β
β βββ js/
β βββ main.js
β βββ cart.js
β
βββ templates/
β βββ base.html
β βββ home.html
β βββ products.html
β βββ product_detail.html
β βββ cart.html
β βββ checkout.html
β βββ confirmation.html
β βββ login.html
β βββ register.html
β βββ profile.html
β βββ wishlist.html
β βββ order_detail.html
β
βββ manage.py
βββ requirements.txt
βββ .gitignore
βββ README.md
Make sure the following are installed:
- Python 3.10 or higher
- Git
- Visual Studio Code
Clone the repository:
git clone https://github.com/layeebaharam14/CodeAlpha_LUNE_ECommerce.git
cd CodeAlpha_LUNE_ECommerceCreate a virtual environment:
python -m venv .venvActivate the virtual environment on Windows:
.venv\Scripts\activateInstall the required dependencies:
pip install -r requirements.txtRun database migrations:
python manage.py migratePopulate the database with sample products:
python manage.py seed_dbStart the development server:
python manage.py runserverOpen the application in your browser:
http://127.0.0.1:8000/
The project includes Django test files for the application modules.
Run the tests using:
python manage.py testThis project was developed as Task 1 β Simple E-Commerce Store for the CodeAlpha Full Stack Development Internship.
The project demonstrates a complete e-commerce workflow including:
- Product catalog
- User authentication
- Shopping cart
- Wishlist
- Checkout
- Order processing
- Database integration
- Responsive frontend
- Django backend functionality
Status: Completed
LUNE is a functional educational e-commerce application developed for internship and portfolio purposes.
Layeeba Haram
Computer Science Engineering Student
GitHub: https://github.com/layeebaharam14
This project was created for educational and internship purposes.