How zhafranzainal/fk-kiosk-management-system works
Project Type and Purpose
• This is a full-stack, monolithic Laravel application that provides a Kiosk Management System for a faculty.
• It uses Laravel MVC, Fortify for authentication, Jetstream for user/team management, Blade templates for views, and communicates with external services such as a payment gateway and email/SMS providers.
Main Components
a. Client Layer (frontend)
– Web browser or kiosk device that loads HTML/CSS/JS.
– Static assets under public/assets (CSS, JS bundles, images).
b. Web Tier
– Web server (Nginx/Apache) serving public/index.php.
– Vite for asset bundling (vite.config.js).
c. Application Tier (backend)
– Laravel framework (app/ directory)
• HTTP Controllers (app/Http/Controllers)
• Middleware stack (app/Http/Middleware)
• Actions (Fortify & Jetstream custom actions in app/Actions)
• Models & Policies (app/Models & app/Policies)
• Service Providers (app/Providers)
– Routes (routes/web.php, routes/api.php, routes/console.php)
– Console commands & Scheduler (app/Console/Commands, Kernel.php)
d. Data Tier
– Relational database (MySQL, Postgres) configured in config/database.php
– Migrations & seeders (database/migrations & database/seeders)
– Caching & sessions (storage/framework, config/cache.php, config/session.php)
e. External Services
– Payment Gateway (config/payment-gateway.php)
– Email/SMS service (config/mail.php, config/services.php)
– Broadcasting/Real-time (config/broadcasting.php)
– Queue worker (config/queue.php)
– Third-party APIs (listed in config/services.php)
Relationships & Data Flow
• Client → Web Server: HTTP(S) requests for pages, API calls, form submissions.
• Web Server → Laravel App: all requests pass through public/index.php → HTTP Kernel → Routes → Controllers.
• Controllers ↔ Models: Controllers invoke Eloquent models to query/update the database.
• Controllers → Views: Controllers render Blade templates in resources/views.
• Application → Database: via PDO/Eloquent (config/database.php).
• App → External Services:
– PaymentController calls payment gateway APIs.
– Mail/Notification components call email/SMS providers.
– Broadcasting events (e.g., real-time updates).
• Scheduler: Laravel Scheduler (cron) triggers console commands such as GenerateMonthlyBill.
• Queue: Jobs dispatched via controllers or events go to a queue backend (Redis, database) and processed by queue workers.
Architectural Patterns & Design Principles
• MVC (Model-View-Controller)
• Action-based Command Pattern (Fortify & Jetstream custom actions)
• Policy-based Authorization (app/Policies)
• Service Container & Dependency Injection (Service Providers)
• Layered architecture (Presentation, Application, Domain, Infrastructure)
Essentials to Capture
– HTTP flow: Browser → Web Server → Laravel Kernel → Controller → Model → Database → Controller → View → Browser.
– Authentication & Authorization (Fortify & Policies).
– Asset pipeline (Vite, public/assets).
– Scheduled jobs (GenerateMonthlyBill) and queue workers.
– Integration points (PaymentGateway, Mail, Broadcasting).
– Database structure at a high level: Eloquent models like Kiosk, Student, Sale, Transaction.