How eddieugly/whatsapp-order works
Project Type and Purpose
• This is a full-stack Laravel application with an Inertia/Vue.js-powered front end and a traditional admin back-end.
• Purpose: serve a customer-facing SPA for browsing menus, placing orders, and reading blogs; plus an admin panel for managing blogs, categories, menus, orders, users, roles/permissions, and general site settings.
Top-Level Structure
• Backend (PHP/Laravel)
• app/Http/Controllers: MVC controllers (Admin and Auth)
• app/Models: Eloquent models for Blog, Menu, Order, User, etc.
• config/, routes/: application configuration & route definitions (web, api, admin, auth)
• database/: migrations, factories, seeders
• storage/: file uploads, sessions, caches, logs
• resources/views: Blade root view for Inertia
• Frontend (JavaScript/Vue)
• resources/js: Vue components, pages, layouts organized under Components, Pages, Layouts
• Inertia.js bridges server-side controllers to the client
• Vite/Webpack build config (vite.config.js, postcss.config.js)
• Public/Deployment
• public/: entry point (index.php), assets (compiled JS/CSS, images)
• .env, web server (Nginx/Apache) points to public/
Key Architectural Patterns & Technologies
• MVC on the server (Controllers → Models → Views via Inertia)
• SPA delivered via Inertia.js + Vue.js
• Eloquent ORM for DB access
• Database migrations & seeders for schema and initial data
• Spatie Permissions package for role/permission management
• Laravel Queues (config/queue.php) for background jobs (e.g., notifications)
• File storage via Laravel Filesystem (local/public s3-ready)
• Third-party integrations: payment gateway (Flutterwave via Vue components & backend API), email notifications (config/mail.php)
Main Components & Interactions
• CLIENT BROWSER (Customer SPA / Admin SPA)
↔ HTTP(S) →
• WEB SERVER (Nginx/Apache + PHP-FPM)
→ Laravel entrypoint (public/index.php)
• Middleware (authentication, CSRF, Inertia)
• Controllers (Auth, Admin, Cart, Payment, etc.)
→ Services / Jobs
→ Eloquent Models
→ Database (MySQL/Postgres)
→ Filesystem (uploads, images)
→ Cache/Session Store (Redis, Memcached)
→ Queue Workers (async jobs, notifications)
→ Mailer (SMTP, Mailgun, etc.)
→ External Payment API (Flutterwave)
• BUILD TOOLCHAIN
• Vite/Webpack compiles Vue components → public/assets/app.js & app.css
• versioned & served by web server
Final Touches
• Related components (e.g., app/Http and app/Models under “Laravel Application”)
• Keep it modular: separate frontend, backend, data stores, external services