How hossain-arafat/pizzago works
1. What this repository is
PizzaGo is a PHP/MySQL restaurant ordering system built around an MVC split: browser-facing PHP views, request-handling controllers, and database models. It is not a single-page app; each interaction is a server-rendered request/response cycle.
2. Application entry and request routing
index.php is the top-level entry point. From there, the app presents the landing/auth flow and delegates feature actions to dedicated controllers. The architecture suggests standard PHP page navigation rather than a framework router.
3. Presentation layer
The view/ directory contains the rendered pages for customer, staff, and admin workflows: login/signup, menu/cart, dashboard, orders, profile, pizza management, staff management, and password recovery. Shared UI chrome lives in header.php, footer.php, navigationBar.php, and sidebar.php, which indicates a template-based layout boundary.
4. Business logic layer
The controller/ directory is where form submissions and actions are handled. Controllers are split by feature, including authentication (loginController.php, signupController.php, logoutController.php, forgetPassController.php), account management (profileController.php, passwordController.php), ordering (orderController.php), and admin/staff operations (addPizzaController.php, updatePizzaController.php, deletePizzaController.php, addStaffController.php, pizzaAvailabilityController.php, pizzaStatusController.php).
5. Data access layer
The model/ directory encapsulates persistence. connection.php centralizes the MySQL connection, while user.php, pizza.php, and order.php represent the main data domains. This is the main boundary between application logic and the database.
6. Core data domains
The system is organized around users, pizzas, and orders. Users carry roles such as customer, staff, and admin. Pizzas are the catalog/inventory entity. Orders connect customers to purchased pizzas and carry status progression through the workflow.
7. Order and cart flow
Customer shopping is session-driven: browse menu in view/menu.php, add items to view/cart.php, then submit through orderController.php. The controller likely computes totals, creates order records, and writes order items through the model layer. This is the primary transactional path in the system.
8. Operational workflows for staff/admin
Admin and staff use separate operational screens such as dashboard.php, orders.php, availability.php, assigned.php, staff.php, and the pizza management views. pizzaStatusController.php manages order lifecycle updates, while pizzaAvailabilityController.php controls whether menu items are in stock. These are the main back-office control points.
9. Authentication and session boundary
Authentication is handled server-side with PHP sessions. Login/signup/forgot-password flows establish the session identity, and role-based access determines which view/controller set is reachable. This makes session state a key architectural dependency across all modules.
10. Frontend assets
The css/ and js/ directories are organized per screen or feature, so styling and client-side validation are modular but not central to the business architecture. image/ holds static menu assets, while assets/ appears to store documentation screenshots rather than runtime dependencies.
11. Infrastructure and runtime
The stack is traditional PHP 7.4+ on Apache with MySQL 5.7+ access via procedural MySQLi. There is no evidence of an ORM, API backend, or separate service tier; the database is directly accessed through the model classes/functions.
12. Diagram boundaries to emphasize
For an architecture diagram, the important boundaries are: browser/UI views, PHP controller layer, model/database access layer, and MySQL persistence. The key flows are authentication, menu/cart checkout, order-status updates, and admin inventory/staff management. Role-based access sits across all of them.
Main entry points: login.php Login · menu.php Menu · dashboard.php Dashboard · index.php index.php
Components 22
Presentation
Server-rendered pages and shared layout for customer, staff, and admin workflows.
- index.php · Top-level application entry and landing flow.
index.php - Login · Customer/staff/admin sign-in page.
view/login.php - Signup · Account creation page.
view/signup.php - Recover · Password recovery page.
view/forget.php - Menu · Browse pizzas and add items to cart.
view/menu.php - Cart · Session-driven shopping cart and checkout screen.
view/cart.php - Dashboard · Staff/admin landing and operational summary.
view/dashboard.php - Orders · Back-office order queue and status workbench.
view/orders.php - Pizzas · Pizza catalog management screen.
view/manage_pizzas.php - Add Pizza · Form for creating pizza records.
view/add_pizza.php - Staff · Staff management screen.
view/staff.php - Profile · User profile and account details page.
view/profile.php - Shell · Shared header, navigation, sidebar, and footer used across pages.
Controllers
Request handlers for authentication, ordering, and back-office actions.
- Auth · Login, signup, logout, and password recovery handlers.
- Account · Profile and password update handlers.
- Orders · Checkout, order creation, and customer order submission.
controller/orderController.php - Pizza Ops · Add, update, delete, availability, and status actions for pizzas and orders.
Models
Persistence and domain access over MySQL.
Static assets
Screen-specific CSS, JavaScript, and images that support the views.
- UI Assets · Screen-specific CSS and JavaScript for forms and page behavior.
Connections 29
- index.php → Login: landing/auth · Entry point presents the sign-in flow.
- index.php → Menu: browse · Authenticated users reach the menu experience.
- index.php → Dashboard: roles · Role-based navigation reaches staff/admin areas.
- Login → Auth: submit · Login form posts credentials to authentication handlers.
- Signup → Auth: submit · Signup form creates a new account through auth handlers.
- Recover → Auth: recover · Password recovery requests are handled by auth controllers.
- Auth → Users: users · Authentication and account actions read/write user records.
- Profile → Account: update · Profile and password forms submit account changes.
- Account → Users: profile · Account changes persist through the user domain model.
- Menu → Cart: cart · Users move from browsing to cart review.
- Cart → Orders: checkout · Cart submission creates an order.
- Orders → Orders: orders · Checkout writes orders and order items.
- Orders → Pizzas: items · Checkout resolves pizza details and pricing.
- Dashboard → Orders: ops · Dashboard links into operational order management.
- Orders → Pizza Ops: status · Order queue actions update lifecycle state.
- Pizzas → Pizza Ops: catalog · Pizza management screens post create/update/delete actions.
- Add Pizza → Pizza Ops: create · Pizza creation form submits to pizza controllers.
- Staff → Pizza Ops: staff · Staff administration routes through back-office controllers.
- Pizza Ops → Pizzas: pizzas · Pizza operations persist catalog and availability changes.
- Pizza Ops → Orders: status · Order status updates persist through the order domain model.
- Pizzas → MySQL: sql · Pizza persistence uses the shared MySQL connection.
- Users → MySQL: sql · User persistence uses the shared MySQL connection.
- Orders → MySQL: sql · Order persistence uses the shared MySQL connection.
- Shell → Login: chrome · Shared page shell is reused by auth pages.
- Shell → Menu: chrome · Shared page shell is reused by customer pages.
- Shell → Dashboard: chrome · Shared page shell is reused by staff/admin pages.
- UI Assets → Login: style · Page assets support login and other form screens.
- UI Assets → Menu: style · Page assets support menu and cart screens.
- UI Assets → Dashboard: style · Page assets support dashboard and admin screens.