ByteHint Logo™
HomeServices
Industries
Resources
About Us
Contact
ByteHintByteHintByteHintByteHint
ByteHint Logo

Building innovative solutions for the digital future. Transform your ideas into reality with our cutting-edge technology.

Quick Links

HomeAbout UsBlogCase StudiesContactClient Testimonials

Legal

Privacy PolicyTerms & ConditionsRefund Policy

Get In Touch

Veerbhadra Nagar
Pune City, Maharashtra
India 411045

info@bytehint.com
+91 93709 55842
© 2026 ByteHint. All rights reserved.
Case studiesFranchise Management Platform

A franchise management platform for nightly cash close, payroll, ordering and audits

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.

Client
A multi-outlet cafe franchise in India
Industry
Food and beverage
Type
Web App

Navigate

The problem

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.

  1. 01

    Daily figures arrive late or not at all

  2. 02

    Cash in the drawer does not match sales

  3. 03

    Sent figures can be quietly edited

  4. 04

    Salary disputes with staff

  5. 05

    Orders and accounts typed twice

The solution

ByteHint built one Next.js app on one Supabase project, with every write going through a server action. Access rules and the day lock are enforced in the database, so a manager only sees their own outlet and a sent day cannot be edited.

Nightly close in one page

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.

Change requests with a field-by-field record

A sent day reopens for 24 hours only after head office approves. Each edit records the field, old value, new value, who and when.

Head office flags

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.

Attendance and salary with visible working

Monthly salary per outlet from attendance, paid leave and overtime. Each row shows its working, and finalised months are stored and locked.

Supplier ordering inside a weekly window

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.

Outlet audits with photo proof

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.

Finance and TallyPrime export

Profit and loss per outlet for any period, plus Excel and two TallyPrime import files, so the accountant never re-types figures.

Excel export everywhere

Every list screen downloads an Excel file built on the server, honouring the screen's filters and the user's role.

Invite-only access, three roles

Head office invites managers and auditors with one-time links. Sign-in lockout and rate-limited password reset.

How it works

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 that head office approves, and every change is recorded. Head office starts from a list of flags, runs salary with the working shown, and downloads Excel and TallyPrime files.

Architecture · Architecture

Architecture
Clients, the Next.js app, the access and business rule layer, Supabase, and the two external pieces: SMTP email and TallyPrime import files.

Infrastructure and delivery · Infrastructure

Infrastructure and delivery
Pre-push checks, the migration runner, the schema verifier and the live RLS suite, with the app on Vercel and data on Supabase.

Data model · Data Model

Data model
Main entities. One submission per outlet per business date, money in integer paise, variance and audit problems as generated columns.

Nightly close · User Flow

Nightly close
The manager's nightly journey, from sales to a locked day visible to head office.

Change request · Sequence

Change request
Request, approval, a 24-hour reopen enforced by the database, a field-by-field record, and resubmission.

Order window · Sequence

Order window
The ordering window is checked on the server and again in a database policy, so a closed window can never take an order.

Invite and sign-in · Auth Flow

Invite and sign-in
Invite-only accounts with one-time links verified on submit, then local session checks and row level security on every request.

Key decisions

Access rules in the database

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.

Server actions instead of a separate API

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.

Integer money and local business dates

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.

No scheduled jobs

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.

Stored salary working

Chose Store every computed salary figure when a month is finalised; generated columns for cash variance over Recompute on read

A salary sheet finalised in March must read the same in December after the rules change, and a generated column cannot drift from its inputs.

Automated testingEngineering & Delivery
152 unit tests for money, dates, order window, salary and TallyPrime export, plus a live RLS suite that signs in as each role with throwaway fixtures.
ReliabilityReliability & Operations
The day lock is enforced in the database, each migration runs in a transaction, a correction reopens the day before approval is recorded, and email can never fail a write.
AuthenticationSecurity & Access
Invite-only accounts, one-time links verified on submit so mail scanners cannot burn them, lockout after 5 failed sign-ins, rate-limited reset that does not reveal accounts.
PermissionsSecurity & Access
80 row level security policies across 27 tables, plus a guard in every page and action. Managers see only assigned outlets; head office never sees drafts.
MigrationsArchitecture
Forward-only numbered SQL, each in a transaction. A verifier builds them in in-memory Postgres and diffs every object against live, which made an 18-file squash safe.

How we delivered it

  1. Phase 1

    Foundation and core modules

  2. Phase 2

    Live setup and security hardening

  3. Phase 3

    Interface, speed and usability

  4. Phase 4

    Client additions

  5. Phase 5

    Cleanup and QA

Results

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.

95%

Line coverage of tested core modules

95.21% lines, 86.16% branches across the 17 library modules loaded by the unit tests, measured 2026-10-09.

80

Row level security policies

Across 27 tables, so outlet isolation and the locked day hold in the database, not just in the screens.

152

Unit tests passing

Money, business dates, order window, salary math and TallyPrime export, 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.

Tech stack

Languages & Runtime

  • TypeScript5.9.3Whole codebase in strict mode, type-checked at build
  • Node.jsRuntime for the app, database scripts and tests

Frameworks

  • Next.js16.3.8App Router, Server Components, server actions and download routes

UI

  • React19.2.8UI components and form state
  • Tailwind CSS4.3.3Styling with brand colour from CSS custom properties

Backend Libraries

  • Nodemailer10.0.13Invite, reset and notification emails over SMTP
  • ExcelJS4.4.0Server-side Excel exports on every list screen
  • node-postgres8.23.1Direct database connection for the migration runner

Database & Storage

  • SupabaseOne project for Postgres, Auth and file storage
  • PostgreSQL27 tables, 80 row level security policies, generated columns and SQL functions
  • Supabase StoragePrivate buckets for bills and audit photos with signed URLs
  • PGlite0.5.8In-memory Postgres that proves the migrations match the live schema

Third-party APIs

  • TallyPrimeAccounting import files generated as XML (ledgers and vouchers)

Auth

  • Supabase AuthInvite-only email and password sign-in with one-time links

Cloud & Infrastructure

  • VercelConfigured hosting, region pinned to Singapore

Testing

  • Node.js test runnerUnit tests and live row level security tests

Dev Tooling

  • tsx4.23.15Runs TypeScript tests and database scripts
  • ESLint9.39.5Linting with the Next.js rule set
  • dotenv18.0.5Loads env vars for the database scripts
  • Git hooksPre-push hook runs lint, unit tests and production build

Have a similar challenge?

Tell us what you're building and we'll show you how we'd approach it.

Talk to us

Navigate

Get started with
your project

More case studies

A one-month deadline, no team, and a working team in eight days
Consumer apps and creator economy
AI Social App Team BuildProject

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.

React NativeExpoLLM orchestration
Velocity Tweaks: a design-first e-commerce site that reached a 25% CTR
Gaming and PC optimization
Velocity TweaksWebsite

Velocity Tweaks: a design-first e-commerce site that reached a 25% CTR

A 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.

ReactExpressStripe
An Amazon deals bot that posts the best gaming discounts to Discord
Gaming and PC optimization
Amazon Deals BotBot

An Amazon deals bot that posts the best gaming discounts to Discord

A Discord bot that pulls the best gaming deals from Amazon through its Product Advertising API and posts them to the community every four hours.

Pythondiscord.pyAmazon Product Advertising API