Next.js, NestJS, Turbo, Prisma, Claude Code
Nights Plus — Platform Rebuild & Technical Oversight
Nights Plus (PaintNite) needed a full platform rebuild — the existing codebase had accumulated too much debt to maintain sustainably. The client wanted to build the replacement themselves using AI-assisted development. The work covered designing the full-stack architecture, configuring a structured Claude Code developer environment before the client started, reviewing every PR they raised, and running a thorough technical audit on each page before it went to production.
What needed to be solved
The old Nights Plus codebase had accumulated enough issues that fixing one bug regularly exposed another. There was no developer environment, no quality standards enforced during builds, and no audit process between building a feature and shipping it. When the client started rebuilding using AI-assisted development, the generated code looked correct on the surface but had real issues underneath: the events page queried the database directly without pagination, returning the full dataset on every load; filters ran entirely on the frontend; the event detail page had N+1 query patterns and serial database calls that could have run in parallel; and images were not lazy loaded — a significant performance hit on mobile.
Key Decisions & Challenges
Turbo Monorepo for Frontend
Situation
The rebuild would involve multiple frontend applications — the main customer-facing site and potentially an admin panel. The question was whether to manage them as separate repos or consolidate them under a monorepo.
Options Considered
- Separate repos per application — simpler to reason about individually, familiar setup, no additional tooling required
- Turbo monorepo — shared packages for UI components, TypeScript configs, and utility code; parallel build and test pipelines with caching across all apps
Decision
Turbo monorepo. Shared packages meant changes to design system components or TypeScript types propagated correctly across all apps without manual syncing. Turbo's build pipeline with caching also kept CI fast as the project grew. For a long-term rebuild, the upfront setup cost was worth it over the coordination overhead of managing shared code across separate repos.
Microservice Architecture Over a Clean Monolith
Situation
The old backend was a monolith with no clear internal boundaries — everything was coupled to everything. Starting the rebuild as a clean monolith would be faster to kick off, but the question was whether it would stay clean.
Options Considered
- Clean NestJS monolith — faster initial setup, simpler to develop early features, can extract services later if needed
- NestJS microservices with RabbitMQ from day one — more upfront setup, but defined service boundaries and async event-driven communication baked in from the start
Decision
Microservices from the start. The old app's structural problems came from a monolith that had grown without boundaries. Starting with explicit service domains communicating via RabbitMQ events meant the rebuild wouldn't accumulate the same coupling. The client was building long-term, not shipping a prototype, so getting the boundaries right upfront was worth the additional setup.
Full Claude Code Environment Before the Client Starts Building
Situation
The client planned to build the app using AI-assisted development. Without any guardrails, this approach produces working-looking code that has quality issues below the surface — no tests, wrong query approaches, missing performance patterns.
Options Considered
- No setup — let the client start building and catch issues entirely in PR review
- Configure a full Claude Code environment upfront — CLAUDE.md, custom skills per domain (testing, SEO, security, DB, microservices), MCP servers for real project context
Decision
Full Claude Code setup before the client wrote a line of code. Custom skills for unit testing, E2E testing, API integration, UI patterns, SEO, security audit, DB migrations, and microservice creation gave the AI clear patterns to follow. MCP servers for Playwright, Shadcn, Bitbucket, and read-only MySQL gave it real project context. This reduced the density of issues in PRs — though the vibe-coded nature still meant each page needed a thorough technical audit before it was production-ready.
Features
Turbo Monorepo Frontend
Next.js apps organized in a Turbo monorepo with shared packages for UI components, TypeScript configuration, and utility code. Turbo's build and test pipeline runs tasks in parallel with caching, keeping CI fast as the project grows.
NestJS Microservice Backend
Backend split into domain-specific microservices communicating via RabbitMQ for async event-driven workflows. Redis for caching, Prisma for type-safe database access, MySQL as the primary database.
Claude Code Developer Environment
Custom CLAUDE.md, skills for unit testing, E2E testing, API integration, UI patterns, SEO, security auditing, DB migrations, and microservice creation. MCP servers for Shadcn, Playwright, Bitbucket, and read-only MySQL — giving the AI real project context while building.
OpenSearch-Backed Events Listing
Replaced direct database queries with no pagination with AWS OpenSearch. Proper pagination added and all filters moved from the frontend to the backend — the browser receives only the results it asked for.
Per-Page Technical Audit
After each page was finalized by the client, a complete technical report covered SEO tags, JSON-LD structured data, frontend performance, database query patterns, and security concerns. All issues found were fixed before the page went to production.
GTM Integration
Google Tag Manager wired on the frontend for analytics instrumentation and A/B testing measurement — tracking user behaviour across the old and new site experiences.
Gradual Production Rollout
Each page went to production through a controlled rollout starting at 10–20% of traffic, scaling to 50%, then 100% — using A/B testing infrastructure built separately. No page shipped directly to all users.
My Role
I was the technical lead responsible for the full rebuild infrastructure. I designed and set up the frontend monorepo (Next.js with Turbo) and the backend microservice architecture (NestJS, RabbitMQ, Redis, Prisma, MySQL). I wrote the full Claude Code configuration — CLAUDE.md, custom skills, and MCP servers — before the client wrote a line of code. Once they started building, I reviewed every PR they raised, reworked the code structure where needed, and ran a complete technical report on each page before it went to production.
Tech Stack
Outcome
Events and event detail pages are live with 100% of traffic on the rebuilt site. Purchases have increased 19% compared to the old pages. The per-page technical audit and fix cycle was the quality gate that made confident production rollouts possible without reverting once live.