Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pizzeria Project

This is PHP/PostgreSQL pizzeria website developed for the PRI course at UJEP.

Technologies Used

  • Backend: PHP, PostgreSQL
  • Frontend: HTML5, CSS3, JavaScript (ES6+, Fetch API, LocalStorage)
  • Infrastructure: Docker & Docker Compose
  • Design Patterns: Singleton (Database Connection), Memento (Profile state)
  • Tools: Mermaid.js (System diagrams)

Features

  • Main Page: Features an image slider and pizzeria description.
  • Authentication: Login and Registration system with session management.
  • Menu/Ordering: Browse available pizzas and add them to a local storage-based basket.
  • Basket/Checkout: Manage cart items and place orders with delivery details (Czech Republic presets).
  • User Profile: View order history and update delivery presets.
  • EU Publicity: Header and Footer include mandatory EU funding information.

How to Run

  1. Ensure you have Docker and Docker Compose installed.
  2. Clone the repository.
  3. Run the following command in the root directory:
    docker-compose up -d --build
  4. Access the site at http://localhost:8080.
  5. The database will be automatically initialized with sample data from src/scripts/init_db.sql.

Project Structure

  • src/index.php: Main router and entry point.
  • src/includes/: Core logic (DB Singleton, Auth).
  • src/models/: Data models and Design Patterns (Memento).
  • src/controllers/: Business logic for orders.
  • src/views/: UI templates.
  • src/assets/: CSS, JS, and image placeholders.

System Diagrams

Function Call Diagram (Mermaid)

graph TD
    index.php --> Auth::isLoggedIn
    index.php --> OrderController::processOrder
    index.php --> Header[views/header.php]
    index.php --> Home[views/home.php]
    index.php --> Order[views/order.php]
    index.php --> Basket[views/basket.php]
    index.php --> Checkout[views/checkout.php]
    index.php --> Profile[views/profile.php]
    
    Order --> Database::getInstance
    Order --> addToCart[JS: addToCart]
    
    Basket --> renderBasket[JS: renderBasket]
    Basket --> removeFromCart[JS: removeFromCart]
    
    Checkout --> Auth::getCurrentUser
    Checkout --> processOrder[JS: Submit Order]
    
    OrderController::processOrder --> Database::getInstance
    OrderController::processOrder --> PDO::beginTransaction
    OrderController::processOrder --> PDO::commit
    
    Profile --> Auth::getCurrentUser
    Profile --> Database::getInstance
    
    Auth::login --> Database::getInstance
    Auth::register --> Database::getInstance
Loading

Database ER Diagram

erDiagram
    users ||--o{ orders : places
    orders ||--|{ order_items : contains
    menu ||--o{ order_items : "is part of"
    
    users {
        int id
        string email
        string password
        string full_name
        string phone
        text address
    }
    
    menu {
        int id
        string name
        text description
        decimal price
        string image_url
    }
    
    orders {
        int id
        int user_id
        decimal total_price
        string status
        string delivery_name
        text delivery_address
        timestamp created_at
    }
    
    order_items {
        int id
        int order_id
        int menu_id
        int quantity
        decimal price
    }
Loading

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages