All workCase study 01 of 03

GitRoasted

Role
Product, full-stack and AI engineering
Year
2025 – now
Built with
Next.js, TypeScript, Groq, GitHub REST API, Firebase, Zod, PWA

It scores any GitHub profile out of 1,000, then has an LLM write a roast from the result. The number comes from code, so it holds up on a public leaderboard. The words come from the model.

This is the real site, in a frame. Type any GitHub username and it runs a live roast.Works on a phone too, or open it in a new tab.
Median live roast, 5 runs, range 1.8–5.6 s
~2.1s
Measured
Scoring dimensions, 1,000 points
8
From the code
Commits since November 2025
296
GitHub
GitHub stars, 2 forks
21
GitHub

Measured and counted in November 2026. Latency is end to end, from a browser on one connection, against the live site.

The problem

The score had to be fair. The roast had to sting.

A roast only works if it feels earned. If the score behind it changes every time you refresh, nobody trusts it, and a public leaderboard falls apart.

So I split the product in two. Everything that can be calculated gets calculated: stars, consistency, quality, community, activity. The model is handed that result and only writes about it, going after the weakest category first.

That split decided the rest of the system: what gets fetched, how much of it reaches the model, and what happens when the model misbehaves.

The architecture

One request, seven stops.

Click a part, or a step belowServer action

Server action

In the machine: the gate

One username comes in and is validated with Zod. The whole roast then runs inside this single request.

  1. Server action: One username comes in and is validated with Zod. The whole roast then runs inside this single request. (In the machine: the gate.)
  2. GitHub REST API: Profile, up to 1,000 repos and the last 100 events, with responses cached for 5 minutes. (In the machine: the hopper.)
  3. Scoring engine: Plain code across eight dimensions, out of 1,000. The burner sits well away from these drawers: no AI touches the number. The gauge shows my own 531. (In the machine: eight sieve drawers and a gauge.)
  4. Prompt limit: Only the first lines of at most 20 commit messages go forward, which keeps the prompt small and predictable. (In the machine: the belt.)
  5. Groq LLM: The model gets the score and the commits, and returns JSON. Two gas bottles, because there are two candidate models: if one fails, the other takes over. (In the machine: the burner and drum.)
  6. Parse the reply: The JSON object is pulled out even if the model wraps it in markdown, and anything else fails with a clear error. (In the machine: the chute and cooling tray.)
  7. Firestore: One leaderboard entry per username, upserted from the server. Clients can read it but can't write to it. (In the machine: the card rack.)

A single server action runs this whole path. The model only sees data that has already been fetched, capped and scored. The machine is an illustration, with every stage running at once like a production line. A real request passes through them in order, in about 2 seconds.

A GitRoasted result page showing a score of 531 out of 1000 and a three-line roast
Fig. 1A real result from my own profile. The AI wasn't told to go easy on me.

The decisions

The calls that shaped it.

  1. Score in code, words from the LLM

    Instead of one model doing both

    The score is ordinary TypeScript across eight dimensions. The model gets the result and writes about it, so the same data always gets the same number.

    Trade-off The weights are mine to tune by hand, and any unfairness in them is my fault.

  2. A direct Groq API call

    Instead of staying on the Genkit and Gemini flow

    In August 2026 I replaced the framework flow with one HTTP call in JSON mode, with the model name in an environment variable. There's less between the prompt and the response.

    Trade-off Keeping up with model changes is on me now, which caused the outage below.

  3. Hard limits on what gets read

    Instead of reading a whole account

    Up to 10 pages of 100 repos, the last 100 events and 20 commit messages keep GitHub usage and prompt size predictable. Responses are cached for 5 minutes.

    Trade-off A very large account is scored on partial data.

  4. Tolerant parsing of model output

    Instead of trusting JSON mode completely

    The parser pulls out the JSON object even if a model wraps it in markdown or adds a preamble, and fails with a clear error otherwise.

    Trade-off A malformed reply still fails the roast. There's no automatic retry yet.

src/app/actions.ts
const commitHistory = events
  .filter(e => e.type === 'PushEvent' && (e.payload as any).commits)
  .flatMap(e => (e.payload as any).commits)
  .map(commit => `- ${commit.message.split('\n')[0]}`)
  .slice(0, 20) // Limit commit history sent to AI
  .join('\n');

How much of someone's history the model sees: first lines of 20 commit messages, and nothing else from the code.

The failures

What broke.

  1. Anyone could edit the leaderboard

    The Firestore rules still allowed public writes, left over from the demo. With the public client config, anyone could have changed or deleted entries.

    Writes moved to the server through the Firebase Admin SDK, and the rules now reject every client write. Reads stay public.

  2. A dead model ID took roasts down

    The configured model started returning 404 from Groq, and with only one model configured, every roast failed.

    I replaced the model and added a fallback list. A month later I found that list held the same ID twice, so a genuinely different model went in.

  3. Three model changes in one day

    While moving to Groq I went from llama3-70b to llama-3.3-70b-versatile to groq/compound. Hosted model names change faster than application code.

    The model moved into an environment variable, so changing it no longer needs a code change.

  4. Leaderboard reads needed limits

    A live leaderboard can run up Firestore reads quickly once it grows.

    I added query limits, pagination, a manual refresh strategy and read monitoring.

Where it stands

  • Live and free, with a median roast of about 2 seconds in my test.
  • It grew from a score into a product: a leaderboard, one-on-one comparison, Quick Wins improvement steps, shareable cards and an installable PWA.
  • Open source, with 21 stars and 2 forks on GitHub.

What I'd do next

  • Retry once when a model returns malformed JSON, before showing an error.
  • Cache repeat roasts of the same profile for a few minutes, so they don't pay for another model call.
  • Measure latency from more than one connection.