How wuninsu/pos-advanced works
Purpose and Entry Points
This is a Laravel-based advanced POS and operations system: inventory, sales/orders, invoices, customers, suppliers, transactions, services, expenditures, reporting, SMS, and administration. HTTP enters through public/index.php, Laravel bootstraps via bootstrap/app.php, and application routing is defined in routes/web.php with auxiliary API, console, and broadcast-channel routes in routes/api.php, routes/console.php, and routes/channels.php.
Interactive Application Layer
The primary UI is server-rendered Blade plus Livewire, not a separate SPA. Admin operational screens are stateful Livewire components paired with templates, notably app/Livewire/Admin/Pos.php, app/Livewire/Admin/Orders.php, and resources/views/livewire/admin/pos.blade.php. Shared layouts establish authenticated/admin shell boundaries in resources/views/layouts/app.blade.php and resources/views/layouts/sidebar.blade.php.
Identity, Roles, and Access Boundaries
Authentication includes login, password recovery/reset, and OTP verification through app/Livewire/Auth/LoginForm.php, app/Livewire/Auth/ForgetPasswordForm.php, and app/Livewire/Auth/VerifyOTP.php. Role-specific middleware separates admin, manager, cashier, and general user access: app/Http/Middleware/AdminMiddleware.php, app/Http/Middleware/CashierMiddleware.php, and app/Http/Middleware/CheckRoleMiddleware.php. The user model and role/permission schema anchor authorization at app/Models/User.php and database/migrations/0create_roles_models_table.php.
Sales, POS, and Financial Flow
The central transaction flow is POS/cart → order and order details → transaction/invoice records. Core persistence models are app/Models/CartItemsModel.php, app/Models/OrdersModel.php, app/Models/OrderDetailsModel.php, app/Models/TransactionsModel.php, app/Models/Invoices.php, and app/Models/InvoiceDetail.php. UI/form boundaries for this flow are app/Livewire/Admin/Pos.php, app/Livewire/Forms/OrderForm.php, and app/Livewire/Forms/InvoiceForm.php; dedicated controllers support order actions, POS endpoints, and invoice generation in app/Http/Controllers/OrdersController.php, app/Http/Controllers/PosController.php, and app/Http/Controllers/InvoiceGenerator.php.
Inventory and Business Master Data
Products are connected to categories, suppliers, units, customers, and users. The principal model boundary is app/Models/ProductsModel.php, with supporting entities in app/Models/CategoriesModel.php, app/Models/SuppliersModel.php, app/Models/Unit.php, and app/Models/CustomersModel.php. Product/order-detail relationships described by the README make inventory data a dependency of sale fulfillment. Stock monitoring and alert UI live in app/Livewire/StockAlerts.php and app/Livewire/Admin/Monitor.php.
Operations, Notifications, and Service Work
The system tracks service catalogues and service requests independently of retail orders via app/Models/Service.php, app/Models/ServiceRequest.php, and app/Livewire/Admin/ServiceRequests.php. Domain events represent stock alerts and order-deletion workflow: app/Events/StockAlertEvent.php, app/Events/DeleteOrderRequestReceived.php, and app/Events/OrderDeleteEvent.php. Notifications and SMS are modeled internally through app/Notifications/OrderDeletionRequest.php, app/Models/SMSTemplate.php, and app/Models/SMSLog.php; mail integration is configured through config/mail.php and implemented in app/Mail/ForgotPasswordMail.php.
Persistence, Outputs, and Runtime Services
Laravel Eloquent persists the domain schema through database/migrations, including orders, transactions, invoices, inventory, queues, cache, and personal tokens. Environment-selectable DB, cache, session, filesystem, queue, mail, broadcasting, and Reverb real-time services are configured under config/database.php, config/queue.php, config/reverb.php, and related Laravel config. Reports and portable outputs cross into Excel/PDF-style export views through app/Exports/ExportOrders.php, app/Exports/ExportInvoice.php, and resources/views/exports/invoice.blade.php. Operational maintenance includes database backup commands at app/Console/Commands/DBBackup.php and app/Console/Commands/BackupSqlite.php.
Main entry points: migrations Database schema · OrdersModel.php Orders & order details · OrdersController.php Sales action controllers · CheckRoleMiddleware.php Authentication & roles
Components 19
Laravel Runtime
- HTTP entry
public/index.php - Application bootstrap
bootstrap/app.php - Route boundaries
routes/web.php - Authentication & roles · Role middleware gates admin, cashier, manager, and user routes.
app/Http/Middleware/CheckRoleMiddleware.php - Users, roles & permissions
app/Models/User.php - Database schema · Persists inventory, sales, financial, queue, cache, and token data.
database/migrations
Interactive UI
- Authenticated admin shell
resources/views/layouts/app.blade.php - POS workspace · Stateful retail cart and checkout interface.
app/Livewire/Admin/Pos.php - Orders workspace
app/Livewire/Admin/Orders.php
Sales & Finance
- Order & invoice forms
app/Livewire/Forms/OrderForm.php - Sales action controllers · Handles order actions, POS endpoints, and invoice generation.
app/Http/Controllers/OrdersController.php - Orders & order details
app/Models/OrdersModel.php - Transactions & invoices
app/Models/TransactionsModel.php
Business Operations
- Products & master data · Products connect categories, suppliers, units, customers, and users.
app/Models/ProductsModel.php - Stock monitoring
app/Livewire/StockAlerts.php - Service requests · Service work is independent of retail orders.
app/Models/ServiceRequest.php - Domain events & notifications · Carries stock alerts and order-deletion requests.
app/Events/StockAlertEvent.php
Outputs & Operations
- Reports & exports
app/Exports/ExportOrders.php - Database backup
app/Console/Commands/DBBackup.php
Connections 23
- HTTP entry → Application bootstrap: boots
- Application bootstrap → Route boundaries: loads routes
- Route boundaries → Authentication & roles: applies guards
- Authentication & roles → Users, roles & permissions: authorizes against
- Authentication & roles → Authenticated admin shell: admits authenticated users
- Authenticated admin shell → POS workspace: hosts
- Authenticated admin shell → Orders workspace: hosts
- POS workspace → Order & invoice forms: checkout input
- Orders workspace → Sales action controllers: order actions
- Order & invoice forms → Sales action controllers: submits
- Sales action controllers → Orders & order details: creates and updates
- Sales action controllers → Transactions & invoices: records payment and invoices
- Orders & order details → Products & master data: fulfills from products
- Stock monitoring → Products & master data: monitors stock
- Stock monitoring → Domain events & notifications: raises alerts
- Domain events & notifications → Orders workspace: notifies deletion workflow
- Service requests → Database schema: persists
- Orders & order details → Database schema: persists
- Transactions & invoices → Database schema: persists
- Products & master data → Database schema: persists
- Transactions & invoices → Reports & exports: generates reports
- Orders & order details → Reports & exports: exports orders
- Database backup → Database schema: backs up