A one-month deadline, no team, and a working team in eight days
A studio promised its creator client an AI social app in a month with one developer. We scoped the real need and had four roles working eight days after the first call.
A franchise management platform where outlet managers close each day's cash, sales and expenses, and head office sees every outlet's gaps, payroll, orders and audits in one place.
A multi-outlet cafe franchise needed each outlet's nightly cash close, staff attendance and salary, supplier orders and inspections in one place, with head office able to see across all outlets at once.
The people entering the figures are outlet managers at the end of a long shift, on a phone. Head office needed to know what was wrong today, not to admire totals.
Managers open the app on a phone and land on today's close: sales per payment channel, purchases and expenses with bill photos, and a cash count. Every field saves as they go, and once the report is sent the day is locked.
Mistakes go through a change request. Head office approves it beside the sent figures, the day opens for 24 hours, and every change is recorded. Head office starts from a list of flags, runs salary with the working shown, tracks orders and audits, and downloads Excel and TallyPrime files for any period.
Under the hood it is one Next.js 16 app with every write going through a server action, on one Supabase project. Access rules and the day lock are enforced in Postgres row level security.
Sales by payment channel, purchases and expenses with bill photos, cash count with a required note on any difference, then send and lock. Autosaves every field.
A sent day reopens for 24 hours only after head office approves. Each edit records the field, old value, new value, who and when.
One list of what is wrong today: days not sent in the last week, cash differences past a threshold, pending change requests and overdue audit fixes.
Monthly salary per outlet from attendance, paid leave and overtime. Each row shows its working, and finalised months are stored and locked.
Orders open on set days until a cutoff in local time, checked on the server and in the database. Head office moves orders through dispatch and delivery.
Auditors rate a checklist. Low ratings become problems, which the outlet answers with a cause, an action and a photo. The audit closes when all are answered.
Profit and loss per outlet for any period, plus Excel and two TallyPrime import files, so the accountant never re-types figures.
Every list screen downloads an Excel file built on the server, honouring the screen's filters and the user's role.
Head office invites managers, auditors and order takers with one-time links. Sign-in lockout and rate-limited password reset.
A sibling outlet billing app shares this database. A button pulls its sales into the daily report, and a head-office home screen shows today's and recent billing figures by payment method.
Per-outlet GST and GSTIN, menu-level tax split, capped discounts, paid-in-advance deposits, and a record of every cancel or re-print of a printed bill.
Today's sales and who is being served lead the page, with a to-do list of exactly what is outstanding, a per-outlet live view, and a sales page for any period up to 62 days.
Phones and desktops talk to one Next.js app. A proxy refreshes the session on each request, pages render on the server, and every change goes through a server action that validates the input and checks the user's role and outlet.
Data, sign-in and files live in one Supabase project. The database enforces the same rules again with row level security, so a manager only ever gets their own outlet's rows and a sent day cannot be written to. The diagrams below show the layers, the data model, the change request and order flows, and how invited users sign in.
Architecture · Architecture

Infrastructure and delivery · Infrastructure

Data model · Data Model

Nightly close · User Flow

Change request · Sequence

Order window · Sequence

Invite and sign-in · Auth Flow

Chose Postgres row level security on every table, plus a role check in every server action over Checks only in application or API code
The main risk is one outlet's manager seeing another's revenue. With RLS a missed check in one screen still returns no rows, and the day lock holds even if a screen is wrong. A live test suite signs in as each role to prove it.
Chose Next.js server actions for every write, route handlers only for file downloads over A REST or GraphQL layer with a client data library
A form-heavy internal app with one client does not need an API layer. One hand-written validator module per form runs in the browser for inline errors and again on the server, which never trusts the client result.
Chose bigint paise for every amount and business dates resolved in the Asia/Kolkata timezone over Decimals and server-clock dates
Cash differences and accounting vouchers must balance exactly, and a close done after midnight belongs to the previous trading day. Both helpers are unit tested.
Chose Lazy expiry of reopened days and salary runs created on first open over Hourly and monthly cron jobs
Correctness never depends on a job having run: the read path and the database policy both check the reopen deadline. Fewer moving parts to run and monitor.
Chose This repo's migrations define the sibling billing app's tables and roles as well as this app's own; the billing app ships with no migrations of its own, and the two apps join only at report time through an explicit import action over A separate database per app, synced by an API call or a webhook
One schema owner avoids two migration histories fighting over the same tables. An earlier, automatic push of billing sales into this app's tables was replaced by an on-demand import button, moving the coupling from write time to report time on purpose.
Phase 1
Phase 2
Phase 3
Phase 4
Phase 5
2
Access leaks caught before launch
The live RLS suite found two holes on its first run (drafts visible to head office, salary unlockable by managers). Both fixed.
18 to 1
Migrations squashed, proven identical
Verified object by object against a fresh build of the old files and against the live database.
97%
Line coverage of tested core modules
97.49% lines, 86.79% branches across the library modules loaded by the unit tests, re-measured during this audit.
140
Row level security policies
Across 51 tables, including the sibling billing app's schema, so outlet isolation and the day lock hold in the database, not the screens.
273
Unit tests passing
Money, business dates, order window, salary math, TallyPrime export and billing-import shaping, run before every push.
3
Roles enforced in the database
Head office, outlet manager and auditor, each seeing only what it should.
The app covers every module in the original spec plus three later client requests: outlet audits, product photos and a finance view with TallyPrime export. The schema is applied to the live project, and the unit and live access-rule test suites pass.
Tell us what you're building and we'll show you how we'd approach it.
A studio promised its creator client an AI social app in a month with one developer. We scoped the real need and had four roles working eight days after the first call.
Gaming and PC optimizationA full-stack, design-first e-commerce build for a PC optimization brand, with cart, checkout and key delivery, that reached a client-reported 25% CTR in a low-conversion niche.
Gaming and PC optimizationA Discord bot that pulls the best gaming deals from Amazon through its Product Advertising API and posts them to the community every four hours.