PGI Coffee Shop
Running a whole business — customers, products, stock, orders, bookings, suppliers — from a single interface.
A business that’s just starting keeps everything in separate files, and none of them talk to each other.
Stock on one side, orders on another, customers somewhere else again. Every daily operation meant opening several documents, and nobody had a view of the business as a whole.
The brief called for a custom ERP: full management of eight entities, an interface that works on a phone, secure access, and a dashboard that shows the state of the business at a glance.
A Laravel application built on the MVC pattern: one model per entity, views as Blade templates, and controllers carrying the logic. The data lives in MySQL, the interface leans on Bootstrap, and the dashboard draws its charts with Chart.js.
Three decisions
-
01
An MVC architecture, not one script per page
Eight entities sharing the same validation and access rules. Splitting them into models, views and controllers meant not rewriting the same logic eight times.
-
02
Aggregates computed by the database
The dashboard summarises thousands of rows. Doing the maths in SQL rather than in PHP kept the page fast as the data piled up.
-
03
Server-side validation, every time
Browser checks help the user, but protect nothing. Every form is revalidated on the server before it reaches the database.
Each one with its own create, read, update and delete, behind validated forms and role-based access rights.
An application that covers the full cycle: a manager opens the dashboard, sees the day’s activity, and handles orders, stock and bookings without leaving the tool.
What I took from it: modelling the database before writing the first line of code saved far more time than it cost.
Next project