Case study N° 04 · Sports

SimWorld Sports platform

The league website, the coaches' live game-day portal and the media desk for a simulated basketball league network.

One site and one portal
2leagues
SWU plays halves and SW Prep plays quarters; schedules, box scores and brackets handle both.
Per base-strategy reset
27engine calls
Sent in seven batches, then logged to coaching_actions. A timeout also posts to the team’s Discord.
Region pairs priced for recruiting
15,799pairs
An offer’s cost is one lookup, from the player’s home region to the team’s.
SWU schedule page in the demo: a week picker on today, with final scores by half, records at tip-off, networks, venues and box score links
Fig. 1|The SWU schedule on invented data. Records are as of tip-off, and every number comes from the league’s own API routes and SQL.

Two leagues, one website

SimWorld Sports ran a simulated basketball world with a college league (SWU) and a prep league (SW Prep). I built the public site in Next.js on Postgres: a schedule for every day, conference standings with last-five records and streaks, team pages, box scores and tournament brackets.

  • Each game saves both teams’ records as of tip-off, so old box scores read the way they did that night.
  • Brackets come straight from the data. A bracket template is stored as JSON, each game has a round and a slot, and the page fills in the template.
  • SWU plays halves and SW Prep plays quarters, and one box score component handles both.

A coach’s adjustment, from button to game

Coaches signed in with Google or Discord. Only emails already in the league’s users table could get in, and middleware checked each coach’s role and league. During a live game, Coaches Corner is the sideline, and every live button goes through the same steps:

  1. Check in Postgres that the game is live and the team is playing in it.
  2. Send the settings to the game engine. Resetting to a coach’s base strategy takes 27 requests in seven batches: points of emphasis, offensive sets, coach sliders, 17 defensive settings and the defensive game plan.
  3. Post a line to the team’s Discord locker room as the coach. Timeouts, substitutions and adjustments do this; base-strategy resets don’t.
  4. Log a row in coaching_actions with the request, the engine’s reply and any Discord message.

Before tip-off, coaches set presets for each player (starter, scoring option, ball handler, minutes and touches), along with the team’s on-ball philosophy, pick-and-roll coverage and pressure.

Recruiting on a budget

Each coach recruits on a budget. An offer’s cost depends on how far the player lives from the program, which comes down to one lookup in a 15,799-row table of home regions to program regions. The recruiting page lists open offers, the players still available and what each one would cost.

The media desk

Before the web platform, I built the SimWorld Media Control Panel for the media team: a cross-platform Python desktop app (Kivy) for writing and publishing league content.

  • It drafted recaps and graphics for all 32 teams with the OpenAI API, using league data from Google Sheets.
  • Images were hosted on Imgur, and files lived in Google Drive.
  • A separate scheduler handled recurring posts, and installer scripts let non-technical staff set it up on their own.

How the demos work

Both demos are the original apps, exported as static sites and running on made-up data. Teams, arenas and events come from the repo’s own SQL, and every player, coach and score is generated.

  • The website’s API routes and SQL ran unchanged at build time, against Postgres compiled to WebAssembly (PGlite). Their responses are served as JSON, with the dates shifted so there are always games today.
  • The coach portal runs its route handlers right in your browser, against the same embedded Postgres. Calls to the game engine and to Discord show up in a “Behind the scenes” panel instead of being sent.

Getting the old code running again turned up a few bugs, which I fixed:

  • The strategy page crashed in production because it read the team from React state before that state was set.
  • The team schedule never loaded, because its data request ran before the coach id was read from the URL.
  • A React hook came after an early return, which React doesn’t allow.
  • One stats route asked for columns the players table doesn’t have.
  • Prep coaches’ dashboard links pointed to the college league’s pages.
  • Game dates showed up a day early in US time zones.
  • The coach portal used Tailwind 4 with Tailwind 3’s setup lines, so none of its styles were ever generated.
  • The individual-defense table loaded its players before the team was known, so it was always empty.

Then I gave the coach portal a design pass: one dark “game mode” look across every page, the live game pinned in a bar at the top, messages that say exactly what reached the engine (instead of alert() pop-ups), and a recruiting budget meter that warns you before an offer round goes over budget.

Where it stands

The site and the coach portal were built for the league’s fourth season. The player hub was never finished, so its demo shows the in-progress design with sample data.

Figures

Coaches Corner in the demo: a live bar with the score and a hold-to-call timeout, eight team numbers with context, then rotation presets for each player and the team’s offensive and defensive presets
Fig. 2|Coaches Corner during a live game. The score stays pinned at the top with the one red control, a hold-to-call timeout; the team’s numbers each carry the comparison that gives them meaning.
Coaches Corner with the demo’s Behind the scenes panel open, listing the game-engine requests that a Base strategy press produced
Fig. 3|Pressing Base strategy in the demo. The panel lists the 27 game-engine requests the portal’s own route code builds, which are captured here instead of sent.
Tournament page for the SWTV Classic Tipoff Invitational: an eight-team bracket with quarterfinal, semifinal and final results
Fig. 4|A tournament bracket, drawn from a stored bracket template and the games tagged with each round and slot.

Methods

Stack
Next.js 15, React 19, TypeScript, PostgreSQL (AWS RDS), NextAuth (Google, Discord), Tailwind, Discord webhooks, Python, Kivy, OpenAI API.
Data
The demo runs in your browser on sample data; nothing is sent anywhere.
Status
Shipped Oct 2025. SWU and SW Prep coaches, fans.