Sales quoting tool
An internal app where the sales team searches vendor price lists, builds a quote, and sees the margin on every line before the client does.
- Role
- Sole developer
- When
- 2026
The problem
ITFocus resells products from vendors like Fortinet and adds its own services and labor on top. Quotes were built by hand from vendor price lists of tens of thousands of rows, with discounts and margins worked out separately. That was slow, and a mistake in the math went straight to the client.
What I built
A web app for the sales team. Admins upload each vendor's price list and manage ITFocus's own services and labor rates. Salespeople search the catalog, build a quote, set client and vendor discounts, and get totals with margin broken down by vendor and category. Quotes export to PDF and Excel.
How it works
- Each price-list upload is a dated snapshot, such as
2026-Q2. Activating a new one retires the old one, so sales always search current prices. - Quote lines store their own frozen prices. A new quarter's price list never changes a quote that already went out.
- Only SKU and price are required columns. Every other column in the vendor's file is kept as JSON, so a new vendor's format works without a code change.
- The margin math lives in one pure module: client discount sets the invoice price, vendor discount sets the cost, and totals are grouped by category and vendor with each group's share of total margin.
- Two roles: admins manage users, vendors and price lists; sales can only read catalogs and edit their own quotes.
- Runs as Docker containers on Postgres, so the same image can move to a cloud host by changing one connection string.
What broke and how I caught it
The first real Fortinet price list wouldn't upload. The error said "Unexpected end of form", which pointed at the CSV. The file was fine. Next.js has two request size limits, one for server actions and one applied earlier by middleware, and the 10 MB default was cutting the file off before my code ever saw it. I raised both limits.
The next upload got through and then silently disappeared. I had wrapped the insert of 20,000+ rows in a single database transaction, and the ORM's default 5-second transaction timeout rolled all of it back. Now the small setup steps run inside a transaction, and the rows go in afterward in chunks.
Result
- The sales team uses it for some of its quotes; it isn't the default for every quote yet.
- Price lists of 20,000+ rows upload in one step, and old quotes keep the prices they were sent with.
Built with
Built with Next.js, TypeScript, PostgreSQL, Prisma, NextAuth, Tailwind, Docker