Case study

Krushna Forge Admin

Admin panel · Billing & stock

In development

A private admin panel and billing system for a forging company in Rajkot. It brings stock, production, GST billing, payments, purchases, expenses, staff salary, and monthly profit into one app that works in any browser — on a computer or a phone.

The problem

Why it needed building

Krushna Forge is a forging job-work unit in Rajkot. It takes job orders from parties, forges the pieces, bills them with GST and collects payment. That work lived in registers, Excel sheets and a separate billing program, so nobody could say at a glance what was in production, what was billed, who owed money or whether the month made a profit. This is live accounting data, so totals had to be exact to the paisa, invoice numbers had to be gapless, and the owner, who is not technical, needed simple screens and plain-language errors.

My role

What I owned

  • Sole developer, working directly with the business owner
  • Design and front end in Next.js, React and Tailwind, desktop-first and usable on a phone
  • Supabase database: 21 tables, 65 functions and 37 migrations
  • GST bill print that matches the client’s existing printed bills exactly
  • Security audit and hardening before real data went in

The approach

Key decisions

  1. 1

    One flow from order to profit

    Order → daily production → GST bill → payment → balance → P&L. Expenses, supplier dues and staff salary feed into the same P&L, and the Home screen shows today’s production, receivables, supplier dues, this month’s P&L and the order pipeline.

  2. 2

    Business rules live in Postgres

    Every write goes through a database function that checks the input and enforces the rules, and signed-in users have no direct access to tables. The browser cannot skip a rule, which keeps the front end simple and the data trustworthy.

  3. 3

    GST bills that match the client’s own

    Bills are made from completed orders with CGST/SGST or IGST per line, HSN codes, round-off and amount in words. The print is an SVG drawn at the exact coordinates of the client’s existing A4 PDF bill, with or without letterhead. Checked against a real ₹96,151 bill, it matched exactly.

  4. 4

    Payments, balances and ledgers

    Payments by cash, UPI, bank or cheque are allocated to specific bills, and leftover money is kept as party credit. Company Balance shows outstanding and advance per party with ageing, and each party ledger has a running balance, CSV export and a WhatsApp reminder.

  5. 5

    Year-wise, like accounting software

    One company-wide financial year (April–March) scopes every module and report. A staff salary sheet handles weekly offs, overtime and advances, and a read-only audit log records every change in plain language (“Rate: ₹42 → ₹45”) with who made it.

The product

Workflow

Swipe to see more · tap a screen to open it full size

Challenges

The hard parts

Invoice numbers that never skip

A counter per financial year is taken inside the same transaction that creates the bill, so numbers like KF/52 are gapless and never repeat. Each bill also freezes a copy of the seller and party details, so editing the company profile never changes an old bill.

Numbers that always agree

The dashboard, balances and P&L all sum money in SQL from the same helper functions. The app only displays the results, so no two screens can show different totals.

Rules that can’t be broken

Database triggers and unique indexes block over-production, double billing and cancelling a paid bill, not just UI checks.

Two people, one record

Every update sends the version it last saw. A stale write is rejected with a clear “changed on another device” message instead of silently overwriting someone else’s work.

Protecting real business data

Sign-ups are off, every database function checks for a live user, new tables and functions get no access until granted, bill photos sit in a private bucket behind short-lived links, and strict security headers and a CSV formula-injection guard are in place.

Results

What it achieved

  • One system from order to profit, with 12 connected modules replacing registers and spreadsheets
  • GST bills identical to the client’s existing ones, with gapless numbering
  • Production, receivables, supplier dues and monthly profit on one screen
  • Every change traceable in the audit log
  • ~15.5k lines of TypeScript and ~9.8k lines of SQL, security-audited before real data went in