Skip to content

danielfeloiola/pizza

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

180 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  _____  _                          _     _       _
 |  __ \(_)                        | |   (_)     ( )
 | |__) |_ _ __   ___   ___ ___ ___| |__  _  ___ |/ ___
 |  ___/| | '_ \ / _ \ / __/ __| __| '_ \| |/ _ \  / __|
 | |    | | | | | (_) | (_| (__| |_| | | | | (_) | \__ \
 |_|    |_|_| |_|\___/ \___\___|\__|_| |_|_|\___/  |___/
                                       PIZZA & SUBS

🍕 Pinocchio's Pizza & Subs

Status Completed Django Postgres Python Bootstrap

📖 Overview

Pinocchio's Pizza is a full-stack e-commerce platform built with Django. It was developed as part of CS50’s Web Programming with Python and JavaScript.

The system solves the challenge of digitizing a complex restaurant menu (handling multiple size variations and topping combinations) and managing the complete order flow, from ingredient selection to transactional email confirmations.

The project is deployed in the cloud (Koyeb) using a production-grade PostgreSQL database and SMTP (Brevo) for email services.


✨ Key Features

This project goes beyond a simple CRUD application. Here are the main features:

1. 🛍️ Advanced Content & Menu Management

  • Dynamic Opening Hours: The store hours displayed on the Homepage are 100% managed via Django Admin. The administrator can update business hours without touching the code or redeploying.
  • Size & Price Variation: Logic to handle items with multiple prices based on size (Small vs. Large) efficiently.
  • Topping Logic: The system validates the exact number of allowed toppings.
    • Example: A "2-Topping Pizza" strictly requires the user to select exactly 2 ingredients before adding to the cart.

2. 🔐 Robust Authentication & Recovery

  • Full Account Flow: Secure Registration and Login.
  • Password Recovery: Real-world implementation of "Forgot Password". The system sends a unique, secure link via email (SMTP) allowing users to reset their credentials.
  • Email Validation: Ensures only users with valid email addresses can operate on the platform.

3. 🛒 Smart Cart & Checkout Simulation

  • Data Persistence: The shopping cart is saved in the database (Cart Model), allowing users to close the browser and resume their order later (unlike session-only carts).
  • Real-time Calculation: Subtotal and Total update automatically as items are added.
  • Checkout Flow: The system records the order in the database and clears the cart, simulating a real purchase flow.

4. 📧 Email Integration (SMTP)

  • Transactional Notifications: Integrated with Brevo (formerly Sendinblue) API via SMTP.
  • Email Templates: Automatic sending of order receipts to the client and password reset links.

5. ⚙️ Admin Panel (Back-office)

  • Total Management: User-friendly interface to add new pizzas, toppings, change prices, or update store hours.
  • Order Workflow: Administrators can view incoming orders in real-time.

🛠️ Tech Stack & Architecture

  • Backend: Python 3.11 + Django 4.2
  • Frontend: HTML5, CSS3, JavaScript (Vanilla), Bootstrap 5 (Responsive)
  • Database: PostgreSQL 16 (Cloud Hosted)
  • Infrastructure:
    • Deploy: Koyeb (PaaS)
    • Web Server: Gunicorn
    • Static Files: WhiteNoise
  • Email Service: Brevo SMTP Relay

📸 Visual Demo

Dynamic Menu Topping Selection
Menu Toppings
Shopping Cart Email Received
Cart Email

🚀 How to Run Locally

  1. Clone the repository:

    git clone [https://github.com/your-username/project3.git](https://github.com/your-username/project3.git)
    cd project3
  2. Install dependencies:

    pip install -r requirements.txt
  3. Configure Environment Variables (.env): Create a .env file or export these variables:

    DB_NAME=your_db_name
    DB_USER=your_db_user
    DB_PASSWORD=your_db_password
    DB_HOST=your_db_host
    EMAIL_HOST_USER=your_brevo_login
    EMAIL_HOST_PASSWORD=your_smtp_key
    DEFAULT_FROM_EMAIL=your_verified_email
  4. Run Migrations and Start Server:

    python manage.py migrate
    python manage.py runserver

Access: http://127.0.0.1:8000


📝 License

This project was developed for educational purposes (CS50 Web @ Harvard).

About

CS50 web project 3 (it's actually project 4...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published