How elibaps/cafe-ninety-five-sales-inventory works
Cafe Ninety Five is a PHP/JavaScript sales and inventory management demo. Its main workflow is a cashier building a POS order, submitting it through the API, and receiving a confirmed sale after server-side recipe and stock validation; the same service supports product/recipe setup, inventory operations, waste, reconciliation, histories, and operational summaries. The README documents UI features whose JavaScript implementation was not sampled, so links from the browser to the API and from the API to service/state are grounded in the documented architecture and sampled PHP. Persistence is initialized by bootstrap and uses SQLite via PDO.
Main entry points: service.php Action dispatcher · data Demo database · api.php JSON API · bootstrap.php Database bootstrap
Components 14
POS and workspace
- Workspace shell
index.php - POS and views
assets/app.js
API and domain service
- JSON API
api.php - Action dispatcher
app/service.php - Role-specific state
app/service.php
Stock operations and records
- Checkout and sales
app/service.php - Products and recipes
app/service.php - Inventory and restock
app/service.php - Waste recording
app/service.php - Stock reconciliation
app/service.php
Persistence
- Database bootstrap
app/bootstrap.php - Relational schema
app/schema.sql - Demo database
data
Other components
- Cashier / owner
Connections 19
- Cashier / owner → Workspace shell: uses
- Workspace shell → POS and views: loads
- POS and views → JSON API: submits actions
- JSON API → Database bootstrap: opens database
- JSON API → Action dispatcher: dispatches mutations
- JSON API → Role-specific state: requests state
- Action dispatcher → Checkout and sales: dispatches sale
- Action dispatcher → Products and recipes: dispatches setup
- Action dispatcher → Inventory and restock: dispatches stock
- Action dispatcher → Waste recording: dispatches waste
- Action dispatcher → Stock reconciliation: dispatches count
- Database bootstrap → Relational schema: initializes
- Database bootstrap → Demo database: connects
- Checkout and sales → Demo database: records sale and movements
- Products and recipes → Demo database: stores products and recipes
- Inventory and restock → Demo database: updates stock ledger
- Waste recording → Demo database: records waste
- Stock reconciliation → Demo database: records adjustment
- Role-specific state → Demo database: reads role-filtered records