Skip to content
SYS–01Case studyIn production

The Mad Space

Print-on-demand marketplace connecting creators and consumers. ~15,000 LOC, 30+ API endpoints, custom session-based auth, Google OAuth 2.0, GDPR/Loi 25 compliance, 7+ B2B integrations and automated Gelato fulfillment.

Role
Only engineer
Duration
~3 months (MVP)
Stack
Next.js · PostgreSQL
Status
In production
01

Context

A print-on-demand marketplace built to reward creative ideas, with transparent profit-sharing.

  • Profit-sharing: 10–20% idea-givers, 20–35% designers
  • 3 user roles: admin, creator, client
  • 4 currencies (CAD, USD, EUR, GBP) and 2 languages
  • 7+ external integrations, maintained by a single engineer
02

Constraints

A fast MVP, secured from the first payment, compliant from day 1.

  • ~3 months for the MVP
  • Real payments from launch: security non-negotiable
  • GDPR, Law 25 and Law 96 compliance from day 1
  • Non-technical client: every decision explained
03

Decisions

Three architecture decisions shaped the project — each a deliberate trade-off.

WordPress or custom stack?
Constraint
MVP in ~3 months, single dev, multi-currency.
Choice
Custom Next.js (App Router).
Trade-off
More initial code to write.
Edge Functions and complex workflows made possible.
Payment security
Constraint
Real payments from launch.
Choice
HMAC-signed Stripe webhooks + rate limiting.
Trade-off
Longer error paths to code.
Resists forged requests and duplicate webhooks.
Workflow organization
Constraint
4 business workflows to maintain alone.
Choice
Modules isolated per workflow.
Trade-off
Some structural duplication.
4th workflow (loyalty) added in days.
04

Architecture

The path of an order, from client to fulfillment: request → API verified by HMAC signature → Prisma/PostgreSQL → automated Gelato/Stripe fulfillment, no manual step.

05

Results

The most concrete win: complex-order processing, more than halved.

~15,000
TypeScript LOC
30+
REST endpoints
4
business workflows
150–300ms
API latency
06

Lessons

The structural choices paid off; test tooling should have come earlier.

  • Custom Next.js over WordPress made everything else possible
  • Isolated workflows: 4th (loyalty) added in days
  • Next time: Playwright + Stripe test-mode integration tests earlier