CASE STUDY
Puro Link
Water refilling station platform
Puro Link is a multi-tenant SaaS for water refilling stations in the Philippines. Station owners record sales, track their 5-gallon containers and collect what customers owe, and customers find the nearest station and order a refill to their door. I designed and built all of it on my own, from the database schema and API to the interface, tests and deployment.
- Role
- Solo developer, design to deployment
- Type
- Personal project
- Status
- Built, preparing for launch

30
API modules
34
Database tables
185
API routes
1,800+
API tests
01.The problem
A neighborhood water refilling station runs on a notebook. Who borrowed how many gallons, who still owes for last week's refill, and which containers are out, damaged or lost all live in handwriting and memory. Orders come in by text and phone call, and the owner can't see how a second branch is doing without being there.
Puro Link puts each station's sales, gallons, balances and orders in one place, and gives customers a simple way to find a station near them and order without installing anything.
It's deliberately a record-keeping tool. Payments are recorded at the counter or on delivery, and it issues no official receipts and computes no VAT.
02.What it does
POS and sales
A counter screen for refills, new containers and other items, for walk-ins or saved customers. Sales can be paid in full, in part or later, and a void reverses the gallons and balances with a reason.
Gallon tracker
Every container type is counted by status: available, for cleaning, reserved, out for delivery, with a customer, damaged or lost. One function moves the counts, refuses to go below zero and writes the ledger.
Payments and balances
A payment goes to one chosen sale or to the oldest unpaid sales first. Balances are grouped by age, credit limits are checked at the POS, and each customer has a printable statement.
Orders and delivery
Customers order from the nearest station and follow the order live over Socket.IO. The station accepts, prepares and assigns a rider, and the delivery becomes a sale with cash collected and empties returned.
Nearest station map
Customers search by address or their location and see approved stations by distance on a Leaflet map, with prices, hours and delivery area. Geocoding goes through a cached, rate-limited proxy.
Staff and stations
An owner runs several stations under one business. Staff sign in with a station code and get permission presets (counter, rider, manager) that the owner can fine-tune per person.
Plans and billing
Free, Pro and Business plans with limits on stations, staff and features. Upgrades go through PayMongo GCash checkout, confirmed by a signed webhook, with renewal reminders and a grace period.
Reports and admin
A dashboard and reports for sales, refills, collections, balances, gallons and orders. A platform admin approves stations from their permits and sees counts and billing across the platform.
03.Inside the app





04.An order, end to end
A customer's order moves through the same steps at every station. Each step updates the customer, the station and the rider live, and the delivery itself becomes a sale.
ORDER STATUS
- Pending
- Accepted
- Preparing
- Out for delivery
- Delivered
AT THE STATION
Preparing reserves full gallons. Sending a rider moves them out for delivery.
New orders ring on the board, and an order nobody accepts is cancelled automatically after the station's time limit.
AT THE DOOR
The rider records cash collected and empties returned, even when it's only part of the total.
What's left unpaid goes to the customer's balance, and the gallons they keep go to their holdings.
One delivery updates the sale, the balance and the gallon ledger together.
Owner, counter, rider, manager, customer and platform admin each map to permission codes enforced by the API
05.Engineering decisions
Strict tenant isolation
Every station request carries its business and station, and every query filters by them. A user who isn't a member, or a station a staff member isn't assigned to, gets 404, not 403, so they can't tell it exists.
One path for every gallon
Gallon counts change only through one function that locks the rows, refuses to go negative and records who moved what and why. Sales, orders, returns and voids all go through it, so the counts always match the ledger.
Money in centavos, prices from the database
Amounts are PHP stored as bigint centavos. Prices are read from the station's products, never from the request, and an order keeps the prices it was placed with.
The admin never sees station data
The platform admin sees counts, billing and verification, never a station's customer list or sales. A privacy contract test fails if an admin or public route returns internal fields.
Not an official receipt
Puro Link records sales; it doesn't replace a BIR-registered POS. There is no VAT, no OR or SI numbering, and any printed summary says NOT AN OFFICIAL RECEIPT.
Private permit documents
Station permits are authenticated Cloudinary uploads, signed by kind, size and type. Only the owner and the platform admin can open them, through short-lived signed links.
06.Testing
Isolation between stations and the gallon and money rules have to hold on every route, including ones added later. Alongside its feature tests, the API's Vitest and Supertest suite has contract tests that check those rules across the whole API.
- ▸Tests run in-process against a real PostgreSQL database and a real Redis, with nothing in the data path mocked.
- ▸Contract tests fail the suite on a route with no permission check, a write with no audit row, an :id route with no isolation fixture, or internal fields on a public or admin answer.
- ▸A route coverage guard fails the suite if any route has no passing test.
- ▸A load check builds 5,000 stations, a million sales, half a million orders and three million gallon movements, then times search, the order board, balances, reports and the dashboard against their budgets.
- ▸Deploys health-check the new containers and roll back automatically, and a nightly backup is restored into a fresh database to prove it works.
07.Tech stack
- TypeScript
- Express 5
- React 19 (Vite)
- TanStack Router & Query
- Base UI
- Tailwind CSS
- Leaflet
- PostgreSQL
- Drizzle ORM
- Redis
- Socket.IO
- PayMongo
- Cloudinary
- Resend
- Zod
- Recharts
- Vitest
- Docker
- Caddy
- Sentry
The interface has its own aqua theme, a light mode and a deep-ocean dark mode, with every text pair checked for contrast. The customer and rider screens are built for phones, work as an installable web app, and load the map library only on pages that show a map.
Still running your business on a notebook?
I build business systems end to end: the records, the checks and the tests that keep them correct. Let's talk about yours.