← Selected work

LokaTech — Internal Operations Platform

A full-stack operations platform for professional digital services teams — unifying scoped pricing, collaborative client sign-off, billing, and technical documentation in a single Next.js monorepo.

The internal admin and ops platform is private. This case study documents the system I built; the public site is the marketing front.

Role
Full-stack build
Stack
Next.js, Prisma, PostgreSQL, Auth.js
Scope
Pricing, scope sign-off, and project-first billing
01 — Problem → solution

The problem → the solution

source: project write-up
before · the problem

Fragmented agency operations

  1. ✕
    Inconsistent quoting: Every project type had different pricing rules; manual calculation led to under-pricing and rework.
  2. ✕
    No audit trail: Scope changed mid-negotiation with no single source of truth for what changed or what the client agreed to.
  3. ✕
    Slow sign-off: Proposals bounced over email and PDF with no structured feedback or formal baseline acceptance.
  4. ✕
    Disconnected billing & docs: Invoices were typed from scratch; requirements and architecture lived in separate tools.
after · the solution

One system for pre-sale → billing

  1. 01
    Catalog + pricing engine: Master scope catalog and rules-based calculators with transparent step-by-step breakdowns.
  2. 02
    Collaborative scope review: Admins publish rounds; clients interact via magic links — ticks, comments, and baseline lock on accept.
  3. 03
    Project-first billing: Multi-line invoices, payment status, overdue detection, and branded PDF export per project.
  4. 04
    Command dashboard: Attention feed for open reviews, client feedback, and overdue invoices — admin, marketing, and portal in one repo.
02 — Flow

Quote to billing

source: site copy · case study
live trace · Quote to billingscroll to play · tap a step on mobile
comments accept Typed project:portfolio, landing,corporate, custom Pricing engine:catalog + rules-basedcalculators Scope builder withlive breakdown Admin publishes areview round Magic link to client,scoped to one project ◆ Client accepts? Next round: NEW /MODIFIED flags Baseline locked +snapshot PDF Change orders withaudit history Project-first billing:invoices + PDF Overdue → dashboardattention feed
  1. 01
    Typed project: portfolio, landing, corporate, custom→ Pricing engine: catalog + rules-based calculators
  2. 02
    Pricing engine: catalog + rules-based calculators→ Scope builder with live breakdown
  3. 03
    Scope builder with live breakdown→ Admin publishes a review round
  4. 04
    Admin publishes a review round→ Magic link to client, scoped to one project
  5. 05
    Magic link to client, scoped to one project→ Client accepts?
  6. 06
    ◆ Client accepts?→ Next round: NEW / MODIFIED flags [comments]→ Baseline locked + snapshot PDF [accept]
  7. 07
    Next round: NEW / MODIFIED flags
  8. 08
    Baseline locked + snapshot PDF→ Change orders with audit history→ Project-first billing: invoices + PDF
  9. 09
    Change orders with audit history
  10. 10
    Project-first billing: invoices + PDF→ Overdue → dashboard attention feed
  11. 11
    Overdue → dashboard attention feed
03 — Sequence

Client scope review

source: site copy · engineering spotlight
live trace · Client scope reviewscroll to play · tap a step on mobile
Admin Server action Database Client Portal Dashboard 01publish review round 02Zod, requireSession(), then Prisma 0332-byte token, SHA-256 hash at rest 04open magic link (type + expiry per route) 05tick lines, comment 06accept: baseline locked 07attention feed: comments, open rounds
  1. 01
    Admin → Server actionpublish review round
  2. 02
    Server action → DatabaseZod, requireSession(), then Prisma
  3. 03
    Server action → Database32-byte token, SHA-256 hash at rest
  4. 04
    Client → Portalopen magic link (type + expiry per route)
  5. 05
    Client → Portaltick lines, comment
  6. 06
    Portal → Databaseaccept: baseline locked
  7. 07
    Database → Dashboardattention feed: comments, open rounds
04 — Data model

Data model (simplified, from the case-study copy)

source: site copy · entity names only
explorer · Data model (simplified, from the case-study copy)click a table

Tap a table to see what it links to.

CLIENT
PROJECTenum type
REVIEW_ROUND
PORTAL_LINKstring tokenHashenum linkTypedatetime expiry
SCOPE_LINEenum flagbool ticked
BASELINE
CHANGE_ORDER
INVOICEenum status
  • CLIENT has PROJECT 1 → many
  • PROJECT publishes REVIEW_ROUND 1 → many
  • PROJECT scoped to PORTAL_LINK 1 → many
  • REVIEW_ROUND contains SCOPE_LINE 1 → many
  • PROJECT locks on accept BASELINE 1 → 0..1
  • BASELINE audits CHANGE_ORDER 1 → many
  • PROJECT bills INVOICE 1 → many
05 — Features

Features

open a row to read more
01

Dashboard & attention feed

Billing metrics — unpaid total, overdue count, MTD revenue, active projects — plus a needs-attention feed for unread client comments, open review rounds, and overdue invoices. Quick links jump straight to the project or invoice that needs action.

02

Pricing & project workspace

Each engagement gets a typed project (portfolio, landing page, corporate site, or custom system) with a rules-based pricing engine, live breakdown, scope builder, requirements notebook, and live UML editor — all in one workspace.

03

Collaborative scope review

Admins publish review rounds and generate secure magic links. Clients tick lines, leave structured comments, and formally accept a locked baseline — replacing email back-and-forth with an auditable negotiation workflow.

04

Billing & documents

Project-first billing hub with invoice CRUD, mark paid/unpaid, filters, and overdue detection. Branded PDF export for scope proposals, invoices, and baseline scope snapshots after client acceptance.

06 — Details

More details

open a row to read more
01

Impact

Quoting

Manual per-type math and hand-copied catalog prices → transparent calculators and catalog-driven custom scope with floors and modifiers.

Scope & change control

Email and PDF loops with unclear diffs → review rounds with NEW/MODIFIED flags, client ticks, comments, and change-order audit history after baseline lock.

Billing

Ad-hoc line items and weak overdue visibility → project-first billing hub with status badges, filters, and branded invoice PDFs.

Client access & ops visibility

Screenshots or full account creation → typed magic links for scope review vs read-only docs; dashboard feed links directly to what needs action.

02

Engineering Spotlight

01. Server action architecture

Every mutation follows the same contract: Zod validation before Prisma, requireSession() on admin actions, standardized {`{ success, data } | { success, error }`} returns, and revalidatePath() for immediate UI consistency — scaling across 8+ action modules without ad-hoc error handling.

02. Client portal security + PDF strategy

32-byte random tokens with SHA-256 hash at rest, separate link types and expiry per route, scoped to a single project. PDF generation runs client-side via @react-pdf/renderer to stay within Vercel serverless limits; Prisma Decimals serialize to plain numbers before crossing the RSC boundary.

03

Audience snapshot

Admin

Session-gated staff hubs — clients, scopes, projects, billing, and the command dashboard.

Marketing

Public lokatech.co site in the same monorepo, with its own theme — unchanged URLs, no admin pollution.

Client portal

Token-based magic links, no account — separate URLs for interactive scope review vs read-only project docs.

04

Tech Stack

Full-stack TypeScript on Next.js App Router — PostgreSQL as the source of truth, validation at every mutation boundary.

Next.js React Tailwind CSS Prisma PostgreSQL Vercel

Framework: Next.js (App Router), React, TypeScript · UI: Tailwind CSS v4, Shadcn UI

Database: PostgreSQL (Neon) · ORM: Prisma · Auth: Auth.js v5 (credentials, JWT sessions)

Validation: Zod · Diagrams: Mermaid · PDF: @react-pdf/renderer (client-side)

05

Future Roadmap

Project status pipeline

Lead → scoping → proposal sent → won → in progress → completed → archived, with gates for billing and scope edits.

Email notifications

Resend integration for scope review published, invoice sent, payment received, and scheduled overdue reminders.