How anupammallick88/accounting-system-pos works
Project Type & Purpose
• This is a monolithic, full-stack Laravel 5.8 application providing a POS (Point of Sale) and accounting system.
• The backend is built on Laravel MVC, uses Eloquent ORM for database operations, Laravel Events/Listeners for domain events, Artisan Console Commands for background jobs and CRON scheduling, and Laravel Passport for OAuth2.
• The frontend is server-side rendered Blade templates (AdminLTE theme) with some Vue components (passport clients UI), and asset compilation via Laravel Mix (webpack.mix.js).
File Structure
• Top-level:
• app/ (Models, Controllers, Events, Listeners, Console commands, Utilities, Mail, Notifications, HTTP/Middleware)
• resources/ (Blade views under resources/views, JS & Vue components, SASS, language files, AdminLTE & plugin assets)
• public/ (entry point index.php, compiled assets, uploads, static templates)
• routes/ (web.php, api.php, console.php)
• config/, database/migrations + seeds, bootstrap/, vendor/ – standard Laravel setup
• Architectural patterns:
• MVC (Models in app/, Controllers in app/Http/Controllers/, Views in resources/views/)
• Event-Driven (app/Events → app/Listeners → queued jobs)
• Command Line Tools (app/Console/Commands + Kernel for scheduled tasks)
• OAuth2 Authorization (Laravel Passport under resources/js/components/passport + routes/api.php)
• Utilities/Service classes (app/Utils, app/Providers)
README & Config Insights
• Purpose: POS with transaction processing, inventory, reporting, customer & employee management, third-party integrations (payment gateways).
• Technical stack: PHP/Laravel, MySQL (or other RDBMS), Redis or in-memory cache (if configured), SMTP for mail, third-party APIs (Dropbox, PayPal, Paystack, Pesapal).
Main Components
a. Presentation Layer (Frontend)
• Browser / Client (Desktop, Mobile)
• Static assets (CSS/JS served from public/)
b. Application Layer (Backend)
• Web Server (Nginx/Apache + PHP-FPM)
• Laravel MVC:
• Controllers (app/Http/Controllers)
• Models (app/*.php)
• Views (resources/views)
• OAuth2 Server (Laravel Passport)
c. Data Layer
• Database Server (MySQL/PostgreSQL) ← migrations & Eloquent models
• Cache/Session Store (Redis or file) ← config/cache.php, config/session.php
• Queue Worker (Redis/Database queue) ← config/queue.php
d. Background & Integrations
• Scheduler / Cron (app/Console/Kernel)
• Artisan Commands (recurring invoices, payment reminders, dummy data, etc.)
• Events & Listeners → Notification system (app/Notifications), Mail (SMTP/Sendmail), Webhooks
• External Services:
• Payment Gateways (PayPal, Paystack, PesaPal)
• File Storage (Dropbox via DropboxServiceProvider)
• Email Delivery (SMTP, config/mail.php)
e. Third-Party UI Components & Plugins
• AdminLTE theme & DataTables
• Vue Components for Passport clients
Relationships & Data Flows
• User → Browser → Nginx/Apache → Laravel → Controllers → Models → DB
• Controllers dispatch Events → Listeners → Jobs to Queue
• Queue Worker → sends Emails / Notifications / external API calls
• Scheduler → Artisan Commands → batch jobs (e.g., recurring invoices)
• OAuth2 Clients (JS/Vue) call API endpoints → Laravel Passport guards → Eloquent
Architectural Patterns & Design Principles
• MVC layered separation
• Event-Driven architecture for decoupling side-effects
• Command pattern (Artisan Commands) for repeatable tasks
• Service Providers for bootstrapping and dependency injection
• Util/Helper classes for cross-cutting concerns
• Blue = UI / Clients
• Green = Core Application
• Orange = Datastores
• Gray = External Integrations