Campforce — Promotion Planning Platform hero image
Back to Projects
Web AppIn Progress

Campforce — Promotion Planning Platform

2026-07-18
Next.js 16 · TypeScript · PostgreSQL · Prisma 7 · NextAuth · Microsoft Entra ID · shadcn/ui · Tailwind CSS 4 · Recharts · Vercel

A promotion planning platform for a major outdoor equipment retailer in Australia and New Zealand — merchandise teams plan promotions across 15,000–25,000 SKUs drawn from a 170,000-item master list, with live margin and gross-profit analytics at every step of the workflow.

Problem Solved

Planning a retail promotion at this scale used to mean spreadsheets: exports from the ERP, VLOOKUPs across cost and price files, and no way to see the margin consequences of a discount decision until weeks later. Multiple contributors — category managers, supplier reps — worked on disconnected copies of the same list, and nobody owned a single source of truth.

Campforce replaces that with a shared workspace, built as a home for tactical web apps where the ERP system is too slow to respond to change. A promotion is broken into contributions — cohorts of SKUs owned by individual contributors, each with its own draft/submit workflow — and every discount entered is instantly repriced against cost, RRP, and projected sales to show unit GP, margin percentage, and total GP impact. By the time a promotion is submitted for approval, the business already knows what it will cost.

Key Features

Strategy-Driven SKU Selection

Selecting 15,000 items by hand is not a workflow. Strategies are reusable, shareable filter sets built with a visual query builder (AND/OR groups over brand, category, price, stock type and more), with a live count of matching items and an AI assistant that translates plain-language intent into query rules. Applying a strategy to a contribution pulls in thousands of SKUs in one action — batched server-side so it stays fast.

Contribution-Level Discount Planning

Each contribution gets a planning grid with per-SKU discount overrides, a blanket discount that applies to the whole cohort in a single SQL UPDATE, and a margin distribution chart that updates as you plan. Summary cards track projected promo GP, GP impact versus current pricing, and flag negative-margin items before they reach print.

Birds-Eye Analytics with Drill-Down

Every promotion has an analytics dashboard: discount distribution, average margin by category, brand profitability (discount vs margin bubble chart), GP impact by category, and SKUs broken down by historical sales ranking. Charts cross-filter the detail table beneath them, so a red bar is always one click away from the SKUs that caused it.

Filtering Built for 15k+ Rows

Every SKU list in the app shares the same fly-in filter panel: a two-level tree (default Category → Subcategory, but either level can be switched to Brand, Stock Type, etc.) where each node shows its matching SKU count. Combined with server-side pagination and filtering, the UI stays responsive whether a contribution holds 300 SKUs or 20,000.

Versioned Platform API

A versioned REST API under /api/v1/ accepting session or API-key auth, with rate limiting, standardized error envelopes, and audit logging on significant actions — ready for the next tactical app to land on the platform.

Self-Documenting Platform

An in-app MDX documentation system with an auto-generated API reference covers the platform, workflows, and API — so the platform documents itself for the next app that lands on it.

Architecture

Architecture Overview

A Next.js 16 App Router application with React Server Components doing the heavy lifting, backed by PostgreSQL via Prisma 7 with the pg driver adapter. The 170k-row item master is synced from the ERP, with batched upserts for CSV import and progress tracking.

Authentication is NextAuth v5 with Microsoft Entra ID SSO and database sessions, with a role hierarchy (viewer < editor < admin) scoped per application and platform admins above all.

  • Frontend: Next.js 16 App Router with React Server Components, shadcn/ui + Tailwind CSS v4, TanStack Table for data grids, Recharts for analytics widgets
  • Data: PostgreSQL via Prisma 7 with the pg driver adapter; 170k-row item master synced from the ERP; batched upserts for CSV import
  • Auth: NextAuth v5 with Microsoft Entra ID SSO and database sessions; per-app role scoping
  • API: versioned REST under /api/v1/ with session or API-key auth, rate limiting, standardized error envelopes, and audit logging
  • Docs: in-app MDX documentation system with auto-generated API reference
  • Hosting: Vercel

Key Decisions

1

Platform, not app

Campforce is built as a home for multiple tactical apps — promotions is simply the first tenant. Roles are scoped per app, the sidebar is gated by app access, and adding a new app is a documented seven-step recipe rather than an architecture change.

2

Contributions as the unit of work

Rather than one person owning a 20,000-SKU promotion, the promotion is split into contributor-owned cohorts with independent strategies, discount plans, and submission status. This matches how the merchandise team actually works and keeps each planning grid to a tractable size.

3

Set-based writes over ORM loops

Applying a blanket discount or a strategy to thousands of SKUs is done with single SQL statements and batched createMany calls, not row-by-row ORM transactions — the difference between a click and a timeout at this row count.

Screenshots

Campforce platform dashboard with promotion stats and the 169,345-item master count
Dashboard — platform landing page with promotion stats and the 169,345-item master count
Promotion list showing status, SKU counts, and date ranges
Promotion list — all promotions with status, SKU counts, and date ranges
Promotion detail with contributions and their workflow status plus the full SKU grid with pricing
Promotion detail — contributions with their own workflow status, plus the full SKU grid with pricing
Promotion analytics with discount distribution, margin by category, brand profitability, and GP impact charts
Promotion analytics — discount distribution, margin by category, brand profitability, and GP impact with cross-filtering
Contribution workspace showing a contributor's cohort with strategy, sales prediction, and planning actions
Contribution workspace — a contributor's cohort with strategy, sales prediction, and planning actions
Discount planner with blanket discount, margin distribution, and per-SKU repricing with live GP projections
Discount planner — blanket discount, margin distribution, and per-SKU repricing with live GP projections
Fly-in two-level SKU filter tree with per-node counts expanded to subcategory level
SKU filter tree — the fly-in two-level filter panel with per-node counts
Item master browser showing the 170k-row ERP item list with CSV import
Item master — the 170k-row ERP item browser with CSV import
Strategy list showing reusable filter sets with matching-item counts and team sharing
Strategy list — reusable filter sets with matching-item counts and team sharing
Strategy editor with visual query builder, AI assistant, and live category breakdown of matching items
Strategy editor — visual query builder with AI assistant and live category breakdown of matching items
In-app MDX documentation covering the platform, workflows, and API reference
In-app documentation — MDX docs covering the platform, workflows, and API reference
Administration screen with user and role management scoped per app
Administration — user and role management with per-app scoping

Interested in something similar?

We scope, design, and ship data and AI tools that solve the problems your team actually has.

Let's Talk