A full-featured eBay-style auction platform built with Django where users can create, bid on, and manage auction listings in real-time. Created as Project 2 for Harvard's CS50 Web Development course.
- Features
- Tech Stack
- Installation
- Usage
- Project Structure
- Database Models
- API Endpoints
- Screenshots
- Contributing
- License
-
π Create Listings: Users can create new auction listings with:
- Title, description, starting bid
- Image upload support
- Category selection
- Detailed product information
-
π·οΈ Active Listings: Browse all currently active auctions with:
- Real-time price updates
- Current bidder information
- Time remaining display
- Bid history
-
π° Bidding System:
- Place bids with automatic validation
- Minimum bid enforcement
- Bid outbidding notifications
- Real-time bid counter
-
π Watchlist Management:
- Add/remove listings from personal watchlist
- Quick access to tracked items
- Watchlist notifications for price changes
- Bidding reminders
-
Category System: Organize listings by categories:
- Fashion & Accessories
- Electronics & Technology
- Home & Garden
- Sports & Outdoors
- Toys & Games
- Books & Media
- Art & Collectibles
-
Smart Filtering: Filter and search listings by:
- Category
- Price range
- Auction status
- Most popular
-
π Authentication:
- Secure user registration
- Login/logout functionality
- Password management
- Session security
-
π Personal Dashboard:
- Manage created listings
- Track active bids
- View bidding history
- Watchlist overview
-
π― Auction Management:
- Close your own auctions
- Declare winners
- Re-list closed auctions
- Mark items as sold
-
π¬ Comment System:
- Add comments to listings
- Discuss with other bidders
- Seller responses
- Comment history
- π Current Price Tracking: Automatic updates with new bids
- π Auction Status: Live tracking of active/ended auctions
- π Winner Declaration: Automatic assignment when auctions close
- π Notifications: Email/in-app notifications for bidding activity
| Component | Technology |
|---|---|
| Backend Framework | Django 4.2+ |
| Language | Python 3.8+ |
| Frontend | HTML5, CSS3, Bootstrap 5 |
| Database | SQLite (Development), PostgreSQL (Production) |
| ORM | Django ORM |
| Authentication | Django auth system |
| Forms | Django Forms |
| Admin Panel | Django Admin |
- Python 3.8 or higher
- pip (Python package manager)
- Git for cloning
- Virtual environment (recommended)
-
Clone the repository:
git clone https://github.com/Ahmed122000/Commerce.git cd Commerce -
Create virtual environment:
# Linux/Mac python3 -m venv venv source venv/bin/activate # Windows python -m venv venv venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create
.envfile (optional):SECRET_KEY=your-secret-key-here DEBUG=True ALLOWED_HOSTS=localhost,127.0.0.1
-
Apply migrations:
python manage.py makemigrations python manage.py migrate
-
Create superuser (admin account):
python manage.py createsuperuser # Follow prompts to create admin account -
Collect static files (optional):
python manage.py collectstatic --noinput
-
Run development server:
python manage.py runserver
-
Access the application:
Application: http://localhost:8000 Admin Panel: http://localhost:8000/admin
-
Browse Listings:
- Visit homepage to see active auctions
- Use categories to filter items
- Search for specific products
-
Place a Bid:
- Click on a listing to view details
- Enter bid amount (must exceed current bid)
- Click "Place Bid" to bid
-
Manage Watchlist:
- Click heart icon to add to watchlist
- View watchlist from profile
- Get notified on bid activity
-
View Comments:
- Scroll to comments section on listing page
- Add your own comments for discussion
-
Create Listing:
- Click "Create Listing" button
- Fill in all required information
- Upload product image
- Set starting bid and category
- Click "Create" to list
-
Manage Active Auctions:
- View current bids on dashboard
- Monitor bidding activity
- Track auction time remaining
-
Close Auction:
- Click "Close Auction" when done
- Winner is automatically determined
- Item marked as sold
-
Respond to Comments:
- View buyer comments on your listings
- Respond to questions
Commerce/
βββ manage.py # Django management script
βββ requirements.txt # Python dependencies
βββ db.sqlite3 # SQLite database
βββ commerce/ # Main project directory
β βββ settings.py # Django settings
β βββ urls.py # URL configuration
β βββ asgi.py # ASGI config
β βββ wsgi.py # WSGI config
βββ auctions/ # Main app directory
β βββ migrations/ # Database migrations
β βββ static/auctions/
β β βββ css/
β β β βββ styles.css # Custom styling
β β βββ js/
β β βββ script.js # JavaScript logic
β βββ templates/auctions/
β β βββ layout.html # Base template
β β βββ index.html # Homepage
β β βββ listing.html # Single listing
β β βββ new_listing.html # Create listing form
β β βββ categories.html # Categories page
β β βββ watchlist.html # Watchlist
β β βββ login.html # Login page
β β βββ register.html # Registration page
β β βββ error.html # Error page
β βββ models.py # Database models
β βββ views.py # Application logic
β βββ urls.py # App URL routing
β βββ forms.py # Django forms
β βββ admin.py # Admin configuration
β βββ apps.py # App configuration
βββ README.md # This file
class User(AbstractUser):
# Extends Django's default User model
passclass Category(models.Model):
name = CharField(max_length=64, unique=True)
description = TextField(blank=True)class Listing(models.Model):
title = CharField(max_length=200)
description = TextField()
starting_price = DecimalField(max_digits=10, decimal_places=2)
current_price = DecimalField(max_digits=10, decimal_places=2)
image_url = URLField(blank=True)
category = ForeignKey(Category, on_delete=CASCADE)
creator = ForeignKey(User, on_delete=CASCADE)
is_active = BooleanField(default=True)
created_at = DateTimeField(auto_now_add=True)
closed_at = DateTimeField(null=True, blank=True)
winner = ForeignKey(User, null=True, related_name='won_auctions')class Bid(models.Model):
listing = ForeignKey(Listing, on_delete=CASCADE)
bidder = ForeignKey(User, on_delete=CASCADE)
amount = DecimalField(max_digits=10, decimal_places=2)
timestamp = DateTimeField(auto_now_add=True)class Comment(models.Model):
listing = ForeignKey(Listing, on_delete=CASCADE)
author = ForeignKey(User, on_delete=CASCADE)
content = TextField()
timestamp = DateTimeField(auto_now_add=True)class Watchlist(models.Model):
user = ForeignKey(User, on_delete=CASCADE)
listing = ForeignKey(Listing, on_delete=CASCADE)
added_at = DateTimeField(auto_now_add=True)| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Homepage - all active listings |
GET |
/listing/<id> |
View single listing |
POST |
/listing/create |
Create new listing |
POST |
/listing/<id>/bid |
Place a bid |
POST |
/listing/<id>/close |
Close auction |
GET |
/categories |
View all categories |
GET |
/category/<name> |
View listings by category |
GET |
/watchlist |
View user's watchlist |
POST |
/listing/<id>/watchlist |
Add to watchlist |
POST |
/comment/<id> |
Add comment |
GET |
/search |
Search listings |
GET |
/login |
Login page |
GET |
/register |
Registration page |
POST |
/logout |
Logout user |
- Validates bid amount against current highest bid
- Prevents users from bidding on own listings
- Automatic winner declaration
- Bid history tracking
- One-click add/remove
- Quick access to tracked items
- Persistent across sessions
- Bid notifications
- Hierarchical category structure
- Filter by category on homepage
- Category browsing page
- Full-text search across listings
- Search by title, description, or category
- Partial match suggestions
Run tests with:
python manage.py test auctions- Email notifications not yet implemented
- Real-time updates require page refresh
- Image handling could be improved with CDN
- Real-time bidding with WebSockets
- Email notifications
- Advanced search with filters
- User ratings and reviews
- Payment integration (Stripe)
- Mobile app version
- API for third-party integration
This project is licensed under the MIT License - see LICENSE file for details.
Contributions are welcome! Here's how:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Harvard's CS50 Web course for project specification
- Django documentation and community
- Bootstrap team for CSS framework
- All contributors and testers
Have questions or found bugs? Open an issue on GitHub!
Repository: Ahmed122000/Commerce
Last Updated: April 2026 | Built with β€οΈ by Ahmed Hesham