The Data Science at Georgia Tech platform. The repo lives in the club org. I built it end to end: the public site, the member portal, admin, and Hacklytics registration, check-in, and judging.
The club needs a public site and a place for members to pay dues, check into events, follow bootcamp, apply to projects, and upload a resume. Hacklytics, the club hackathon, needs interest, registration, teams, check-in, a point store, and live judging for 1,500+ participants. Each year also wants a marketing site that can be restyled without shipping the portal.
Those products share people. A member might also be a hacker, a judge, or staff. They do not share a lifecycle. Membership is a paid year. A hackathon is an edition with a weekend, a schedule, and a results table. The bug that forced the split: treating “the current hackathon” as one global pointer made membership disappear when someone drafted next year’s edition.
Architecture
pnpm and Turborepo. sites/mainweb is Next.js on Firebase App Hosting, which runs it as a Cloud Run service. sites/hacklytics2027 and sites/hacklytics2026 are Astro builds on Firebase Hosting. They ship files. They do not open a database connection. A visitor who wants to register follows /login?callbackUrl=/hacklytics onto the portal.
Traffic. The Astro sites stop at a login link. Every write happens in mainweb.
statichacklytics2027Astro on Firebase Hosting. No database client.
statichacklytics2026Archived edition, same shape, its own Hosting target.
core@query/coreShared constants. No runtime dependencies.
ui@query/uiTokens and primitives. Source only, off the request path.
Drizzle
data@query/db → PostgresNeon in production, Postgres in local Docker. One database, two domains.
Outside the request, called from route handlers or imported by staff
paymentsStripeWebhook for dues and the bootcamp add-on.
filesCloud StorageResume book and bootcamp ZIPs.
mailSMTPSign-in codes and transactional mail.
importDevpostOrganisers import an export. Judging does not call Devpost live.
Five internal packages sit under the portal: @query/api, @query/auth, @query/core, @query/db, and @query/ui. The static sites compile a sixth, @query/event-kit, which is the page shell for an edition. Turborepo tags each workspace, and CI runs pnpm turbo boundaries. @query/core depends on nothing else in the repo, so a static site can import a constant. The Astro sites are tagged static: they may not import the database or the API. @query/api and @query/auth may not import @query/ui. Nothing may depend on an app. A relative import into another workspace fails the same check.
One database, two domains
Club tables are not scoped to a hackathon row. Membership is one paid year per person, with a start and an end. Club events, bootcamp weeks, initiatives, and Stripe payments live there. Bootcamp sessions are event rows with a week and a term. A generated column marks them club or bootcamp. Workshop ZIPs sit in Cloud Storage, and a download is gated on that workshop’s term.
Hackathon tables hang off hackathon. Editions, the interest list, registration, teams, submissions, the weekend schedule, badge scans, the judge roster, judging, the point store, and announcements. Hackathon registration does not require a paid membership. Club benefits do. A lapsed member row is not treated as active.
The schema boundary. Drafting next year’s edition must not move a membership.
clubYear-roundmember, membership history, events, bootcamp, initiatives, Stripe. Keyed by person and dates.
resolveCurrentHackathonId in @query/db is the only definition of the current edition: an in-progress event if one exists, otherwise the newest edition whose status is not draft or announced. Portal gates and club check-in read that function. They do not read “whatever row was inserted last.”
Diagrams
A solid outline is the path in the repo. A dashed outline is the alternative that shape is refusing.
The Astro sites ship files and stop at a login link. Every write happens in sites/mainweb. Portal calls use /api/trpc, sign-in uses /api/auth, and Stripe arrives on its webhook. Drizzle is the only database client.
flowchart TD
visitor[Visitor]
astro["Astro event sites, Firebase Hosting"]
web["sites/mainweb, Firebase App Hosting"]
publicRoutes["Public routes"]
portalRoutes["Portal, judge, and admin routes"]
trpc["/api/trpc"]
authn["/api/auth, NextAuth"]
hook["Stripe webhook"]
db["Drizzle to Neon Postgres"]
visitor --> astro
astro -->|"/login?callbackUrl=/hacklytics"| web
visitor --> web
web --> publicRoutes
web --> portalRoutes
portalRoutes --> trpc
portalRoutes --> authn
trpc --> db
authn --> db
hook --> db
class visitor,astro,web,publicRoutes,portalRoutes,trpc,authn,hook,db chosen
A yearly restyle stays on Firebase Hosting, with no database client and no Cloud Run deploy. The portal API is tRPC, so the router types are the client types. Membership, events, and judging are rows that join, which is the Postgres shape.
flowchart TD
host{Where a yearly site runs}
host -->|"files only, no database client"| astro["Astro on Firebase Hosting"]
host -->|"a restyle ships with Cloud Run"| nest["Marketing routes inside mainweb"]
api{Portal calls}
api -->|"tRPC over REST: end-to-end types"| trpc["@query/api"]
api -->|"a handler and a client to keep in sync"| rest["Hand-written REST"]
data{How rows relate}
data -->|"Neon Postgres over a document store: joins"| pg["Drizzle and Neon"]
data -->|"no join across member and edition"| doc["Document store"]
class astro,trpc,pg chosen
class nest,rest,doc rejected
Club rows are a paid year, keyed by person and dates. Hackathon rows hang off an edition. resolveCurrentHackathonId ignores draft and announced. The other shape is the bug: membership followed whichever hackathon was current, so drafting next year cleared it.
flowchart TD
q{Where membership lives}
q -->|"a paid year, not an edition"| club["Club tables by person and dates"]
q -->|"drafting next year retargets it"| bug["Membership on the current hackathon"]
class club chosen
class bug rejected
Why this shape
Static marketing site, all writes in the portal
A yearly event site is a design artifact. A restyle ships as files on Firebase Hosting, with no database migration and no Cloud Run deploy. The cost is a hop through login before anyone can register, and the marketing site cannot ask Postgres whether registration is open. The link is the contract. If the callback URL is wrong, the static site still looks fine.
Three ways in, database sessions
NextAuth takes Google, GitHub when both client credentials are set, and a 6-digit code. Codes are drawn with a CSPRNG, last 10 minutes, and the previous codes for that address are deleted. When DATABASE_URL is set, sessions are database rows. On a successful sign-in the server tries to claim a paid Stripe payment for that verified email and grant membership. If that link throws, sign-in still succeeds. A payment glitch cannot lock someone out of the account they just proved they own.
Prices live in one module
Annual membership is $25. The bootcamp add-on is $10 on top. Both Checkout and Payment Intents read those amounts from @query/api. The webhook, the portal link button, and the sign-in hook are three ways to attach a payment. The amount is not one of the things they are allowed to disagree on.
Cache in the process, invalidation on a bus
Role lookups and portal context sit in an in-memory TTL cache, about 60 seconds, because the values hold dates and dozens of call sites read them synchronously. A successful mutation evicts by a path map. Cloud Run can run several instances, and a write on one does not touch the others. If Upstash is configured, the values still stay in memory. Redis only records the deletes. Each instance polls that stream every 2 seconds. A few abuse-prone routes (resume and bootcamp files, judge interest, points codes) count their rate limit in Redis. The per-request tRPC limiter stays in memory. Every Redis call times out at 250ms and does not retry.
Judging is an import, then a weekend
Organisers bring projects in from a Devpost export, or by promoting submissions already in the portal. Judging does not call Devpost on the request path. After the first room link or the first claim, the inventory locks and a later import can only add projects. A saved schedule, or any evaluation, freezes the challenge tree. Opening judging fixes the rubric.
A challenge is scheduled (a timed appointment in a room), unscheduled (a queue, no clock), or remote (untimed, and hidden from hackers). The queue hashes judge, project, and challenge, and offers that judge the first three open projects in their order. They can skip a team that is away. They cannot pick through the whole set. Scheduled challenges are assigned by a deterministic pass, greedy plus local search, with a preference to keep a judge in one room.
The adaptive pieces are advice on a solved preview, rooms the roster cannot staff, a suggested window, and live re-balance. Re-balance is not a worker. It runs when someone reads the organiser board or a judge’s itinerary, at most every 30 seconds in that process. It changes who is assigned to an open presentation. It does not move the room or the time. A presentation nobody present can take is left unassigned. If nobody opens those pages, nothing moves.
Check-in has a spacing rule, and the flag outlives the event
Nobody is checked into two hackathon events that overlap, or into two less than 30 minutes apart. Meals are exempt. A refused attempt is stored. Organisers see the full flag on the team during judging. Judges see a marker. Hackers never see flags, and flags stay out of public payloads. Deleting the event clears its id and the organiser view says the event was deleted. The flag remains. Organisers, not the schema, decide whether that team is pulled from prizes.
Failure modes
A new edition used to erase membership
When club state was hanging off “the current hackathon,” inserting a draft retargeted that pointer. Membership checks followed it and came back empty. The guard now is the schema split plus resolveCurrentHackathonId ignoring draft and announced. A new code path that picks the newest row by insert time will bring the bug back. The layer tags do not catch that. It is a convention around one function.
Caches disagree across instances
With Redis unset, a mutation evicts the instance that handled it. The others serve the old role or portal context until the TTL. With Redis set, a dropped poll is worse in a specific way: once Redis answers again, that instance drops its whole cache, because it may have missed deletes. During the outage, shared rate limits fall open to the in-memory counter, so the limit is per instance for those routes too. The site keeps serving. The limit is looser, and a role change can be late by about 60 seconds, or by about 2 seconds when the bus is healthy.
Signed in, and not a member
Linking a Stripe payment is best-effort at sign-in. Club pages then check a paid, unexpired membership, not the session. The person can land in the portal and still be refused at bootcamp or initiatives until a later link works. That is the trade for not failing login. The portal has to show the unpaid state honestly, or it looks like a random 403.
Re-balance waits for a reader, and it cannot move time
A judge who walks out is picked up from presence: left for 5 minutes, or no heartbeat for 10. The move still waits for the next board read or itinerary read, plus the 30 second per-process throttle. Several instances each throttle on their own. And the move only reassigns. A slot with no free judge stays empty in that room at that time. It is not slid later. A quiet board means the schedule keeps naming someone who left.
The static site can lie by omission
Hacklytics pages cannot read registration state. They can be up, cached at the CDN, and pointing at a portal that is closed, draft, or mid-migration. The boundary that keeps a marketing deploy from taking down judging is the same boundary that keeps the marketing deploy from knowing judging is down.
Where to read it
docs/architecture.md
for the layer tags, the schema split, and the cache.
docs/judging
for the weekend itself, including the scheduler and the adaptive pass.
The repo is Apache-2.0.
Also Buzz, which makes the opposite cut: the public site and the portal share a deploy and refuse to share a session. Smaller experiments are on Side projects.