Skip to content
webdmamun
All work

AM IT Solution

The operating system for my own software company: public website and internal CRM in one application, from lead through proposal, project, invoice and payment.

Industry
Custom software
Status
in development2026

Built with Next.js, TypeScript, PostgreSQL, Drizzle ORM, Vercel, Resend, Sentry

Visit the live system

In this case study

The problem

A software company that sells operational systems cannot credibly run itself on spreadsheets. It also cannot afford to spend six months building an internal platform against imagined requirements before it has won any work.

What was needed

One application covering the public website and the internal CRM, built in thin slices in the order money actually moves through the business, and only ever one slice ahead of real need.

What I built

A single Next.js application: marketing site at the root, staff CRM behind authentication. The domain model is governed by a written dictionary that the code follows — entities, statuses, permissions and every financial definition — and the invariants that matter are enforced by the database and by build-time checks rather than by discipline.

What it does

  • Public website and CMS

    Marketing pages, services and portfolio managed in the same application.

  • Lead capture and pipeline

    Enquiries and bookings become deals; deals carry their own history forward.

  • Proposals

    Issued documents that cannot be edited after sending.

  • Projects and milestones

    Won work converts into delivery without losing the sales history.

  • Finance

    Invoices, payments, credit notes and expenses, on three explicit money bases.

  • Roles and permissions

    A static matrix of roles and capabilities, enforced in the service layer.

The hard parts

Three different numbers people all call revenue

Contract value on the day a deal is won, invoiced value on the day an invoice is issued, and cash on the day money arrives are three different quantities on three different dates. Reports that blur them are worse than no reports. The word "revenue" without a basis is banned from the product, and every figure states which basis it is on.

History that cannot be rewritten

Financial records are protected by database triggers, not by good intentions: the activity log rejects updates and deletes outright, an issued invoice rejects edits to its frozen fields, payments cannot be edited or deleted, and a milestone amount freezes once its invoice is issued. Corrections happen the documented way — credit note, void and reissue, or a reversal row.

Deriving instead of storing

Paid status, outstanding balance, overdue, project health, progress: all of them are derived. None of them gets a column. The moment a derived value is stored it starts disagreeing with the rows it came from, and every report built on it inherits the disagreement.

Architecture

One Next.js application, one PostgreSQL database, no microservices, no queue and no cache tier. Every tenant-scoped query carries the organisation taken from the session; application code cannot reach an unscoped database handle, and a build-time check fails the build if that ever leaks.

Where it stands

Foundation, public website, CMS, lead capture, proposals, delivery and finance are implemented. Staging verification and provider configuration are the remaining gate before release.

The marketing site and the staff CRM are one application, so published content and the pipeline behind it do not drift apart. An enquiry becomes a deal and a won deal becomes delivery work, carrying its history forward instead of being re-entered. Invoices, payments, credit notes and expenses sit on three explicit money bases defined in a written dictionary the code follows. Roles and capabilities are a static matrix enforced in the service layer rather than checked in the interface.

Want something like this? Tell me how your business runs today.