The Architecture of Pop-Up Infrastructure: Inside t3-cloneathon

How a Next.js and Convex stack used strict AI guardrails to process high-stakes hackathon submissions at breakneck speed.

6 min read • View on GitHub • More from T3-Content

A wild mechanical horse controlled by strict geometric glowing lines, representing AI vibe coding constrained by strict rules.
Strict architectural rules can tame the chaos of AI-assisted code generation.

ANNOUNCING THE FIRST EVER CLONEATHON Build an open source clone of T3 Chat, win up to $5,000 Deadline is next Wednesday. Good luck and have fun nerds 🫡

Theo Browne, Creator of T3 Chat and Cloneathon Organizer · ANNOUNCING THE FIRST EVER CLONEATHON
Key Takeaways

The One-Week Deadline

Building a custom platform to manage a high-stakes competition is usually a multi-month endeavor. When Theo Browne announced the T3 Chat Cloneathon, the timeline was brutal: developers had one week to build a clone, which meant the infrastructure to accept, manage, and judge those submissions had to be built even faster.

Portrait of Theo Browne

A simple web form would not suffice for a $10,000 prize pool. The event required secure state management, authenticated GitHub links, and a multi-tiered judging process to handle thousands of developers. The solution was a masterclass in pop-up infrastructure.

Vibe Coding with Guardrails

The repository describes itself as a vibe coded work in progress. However, a look under the hood reveals surprisingly strict architectural constraints. The team used Cursor's AI capabilities to move fast, but they built a cage for the AI first.

By placing custom instructions in the .cursor/rules directory, the developers forced the LLM to adhere to strict Convex syntax, Next.js 15 App Router patterns, and rigid TypeScript validation. This approach allowed them to generate complex logic rapidly without the typical spaghetti code associated with hackathon-driven development.

// Example of the strict rules enforced in .cursor/rules/convex_rules.mdc
// Enforce Zod-like validation using Convex's 'v' validator
import { v } from "convex/values";

export const submissionSchema = {
  status: v.union(v.literal("in-progress"), v.literal("submitted")),
  githubUrl: v.optional(v.string()),
  score: v.optional(v.number()),
};
// AI is instructed NEVER to bypass these validations.

Trusting the Backend

A major bottleneck in traditional full-stack applications is authentication boilerplate. Writing middleware to pass, decode, and verify JSON Web Tokens takes time that a one-week deadline does not permit. The t3-cloneathon stack bypasses this entirely.

A vault door shaking hands seamlessly with a bouncer, representing zero-friction integration between database and authentication.
Clerk and Convex function as a single unit without fragile middleware.

By using the ConvexProviderWithClerk integration, the frontend authentication maps perfectly to the backend state out of the box. A simple helper function checks Clerk's public metadata to instantly lock down judging endpoints, providing robust Role-Based Access Control with minimal code.

Traditional Stack (Postgres/Express)t3-cloneathon Stack (Convex/Clerk)
Manual JWT verification middlewarectx.auth.getUserIdentity() built-in
Complex SQL migrations for schema changesImplicit schema pushing on save
Manual WebSockets for realtime updatesZero-config reactive subscriptions via useQuery

The Judging State Machine

A submission is not just a static row in a database. In this repository, it undergoes a strict lifecycle defined directly within the schema. It transitions from a draft state into a finalized submission.

To prevent administrative chaos, the system implements a claim workflow. Judges can lock a submission by populating a judgeId field, preventing double work. Once reviewed, the submission enters an array of finalist scores, allowing multiple judges to evaluate the top contenders efficiently.

The submission lifecycle operates as a strict state machine governed by the Convex schema.