How 06skyadav/online-food-ordering-system-in-php-main works
Project type and purpose
• This is a monolithic, full‑stack PHP web application (“Online Food Ordering System in PHP”) that supports both customer‑facing ordering and an admin panel for managing restaurants, menus, orders, and users.
• Key use cases: user registration/login, browse restaurants & menus, place orders, view order history; admin CRUD on restaurants, categories, menus, orders, users.
File structure
• Top‑level PHP scripts (index.php, restaurants.php, dishes.php, checkout.php, etc.) serve the public customer site.
• “admin/” directory contains the entire back‑office interface (dashboard.php, add_menu.php, all_orders.php, etc.), plus its own CSS/JS/libs.
• “connection/connect.php” provides the database connection. “include/footer.php” is a shared view fragment.
• Assets:
• css/, js/, scss/, images/ for front‑end styling and client‑side scripts (mapbox.js, markerclusterer.js, etc.).
• admin/css/, admin/js/ for back‑office UI and plugins (DataTables, calendar, charts).
• Database script: DATABASE FILE/online_food_ordering_system.sql indicates a MySQL schema.
Extract architectural insights from the README
• Confirms core modules: food preview, account creation, ordering, order management, admin panel features (restaurant/category/menu management, delivery management).
• No microservices or external API integrations mentioned—this is a single PHP app with a relational DB.
Main components
a. Client layer
• Web browser/mobile browser running HTML, CSS, JS (mapbox, headroom, etc.)
b. Web server/PHP application
• Public portal modules: authentication, restaurant listing, menu browsing, cart/checkout, order history
• Admin portal modules: dashboard, user management, restaurant/category/menu CRUD, order & delivery management
c. Database
• MySQL (schema as per online_food_ordering_system.sql)
d. Static asset server
• Serves CSS/JS/images (could be the same server or a CDN)
e. (Optional) External libraries/APIs
• Mapbox/geolocation, markerclusterer for maps in the front end
Relationships and data flows
• Separate flow for admin: same HTTP/S channel but under “/admin” path, with authentication enforced.
• Static asset requests (CSS/JS/images) serve directly or via CDN.
Architectural patterns & design principles
• Monolithic MVC‑style layering (albeit without a formal framework):
• Model: connection/connect.php + SQL scripts + PHP data access in each module
• View: PHP templates (index.php, dashboard.php, include/footer.php) with embedded HTML/CSS/JS
• Controller: each PHP file (add_menu.php, update_orders.php) orchestrates input → DB → view
• Separation of concerns: public vs. admin modules in distinct directories.
• Reusable shared components: “include/” folder for common templates; “connection/” for DB connectivity.
Technologies & frameworks
• Back end: PHP 7+, MySQL
• Front end: HTML5, CSS3, SCSS, JavaScript (jQuery, mapbox.js, headroom.js, markerclusterer.js, infobox_packed.js)
• Admin UI plugins: DataTables, fullCalendar, C3 charts, SweetAlert, Toastr, Bootstrap
• Build tools: SCSS preprocessor