Building a Laravel + Inertia Microsite for Indonesia's Independence Day

Notes from building a live event microsite for HUT RI — mini games, a real-time live chat with team reactions, a CMS-managed leaderboard, and the engineering decisions behind each piece.

7 min read

For this year’s HUT RI (Indonesia’s Independence Day), I built a microsite at work: a live event site with mini games, a real-time chat room, and a leaderboard, all wired up for a live stream audience. It’s live in production at kemerdekaan.liputan6.com, built with a Laravel backend and an Inertia.js + React frontend. It turned into a good exercise in building for a live, concurrent, time-boxed event rather than a regular content site.

Here are the parts I found most interesting to build.

The Shape of the Site

The site itself is a handful of pages — home, latest news, gallery, video, and a “live match” page — served through Inertia.js with a React 19 and TypeScript frontend, styled with Tailwind v4 and a shadcn/Radix component set. Nothing unusual there; it’s the same pattern as any modern Laravel + Inertia app.

What makes it different from a typical content site is that most of the interesting behavior isn’t page navigation — it’s what happens while people are watching the live stream: playing mini games, reacting in real time, and climbing a leaderboard.

Mini Games Behind a Real Gate

The centerpiece is a set of classic Lomba 17 Agustus games — balap karung (sack race), panjat pinang (greasy pole climbing), and tarik tambang (tug of war) — each built as a small standalone HTML/JS game.

The interesting decision here was where those games physically live. The index.html for each game sits in resources/games/<slug>/, outside of public/, and is only ever served through a controller:

public function show(string $game): Response
{
    abort_unless($this->games->isOpen(), 404);

    $path = resource_path("games/{$game}/index.html");

    abort_unless(is_file($path), 404);

    // ...
}

If the games lived in public/, a feature-flag “close the games” switch would be cosmetic — the static files would still be directly downloadable by URL. Keeping them in resources/ means the on/off switch (GamesSwitch) actually closes access, not just hides a link. Static assets for the games (images, CSS) do still live under public/game-assets/<slug>/, deliberately unguarded — if someone downloads a background image while the games are closed, that’s harmless, unlike downloading the playable game itself.

One Asset Helper, Two Languages

Static assets needed to work in three environments: local dev, a staging subpath, and production behind a CDN. Laravel already solves this on the backend with asset(). On the frontend, the same idea got mirrored as a small TypeScript helper:

const ASSET_ORIGIN = (__ASSET_URL__ || BASE_PATH).replace(/\/+$/, "");

export const assetUrl = (path = ""): string =>
  `${ASSET_ORIGIN}/${String(path).replace(/^\/+/, "")}`;

__ASSET_URL__ is injected by Vite at build time from an ASSET_URL env var. Empty locally (falls back to root-relative paths, same as before), pointed at a CDN origin in production. Every image reference in React goes through assetUrl() instead of a hardcoded path, so the CDN switch is a one-line env change rather than a find-and-replace across components.

Real-Time Reactions Without Melting the Websocket

The live match page lets viewers react in real time, grouped into two teams. The naive implementation — broadcast every single tap immediately — falls apart with enough concurrent viewers; a popular moment in the stream would mean a websocket message per click, per viewer.

Instead, reactions get aggregated server-side before they’re ever broadcast:

public function react(string $room, string $team, string $reaction): void
{
    $key = sprintf(self::REACTION_KEY, $room);

    Redis::pipeline(function ($pipe) use ($key, $room, $team, $reaction) {
        $pipe->hincrby($key, "{$team}:{$reaction}", 1);
        $pipe->sadd(self::REACTION_ROOMS_KEY, $room);
        $pipe->expire($key, self::REACTION_TTL_SECONDS);
    });
}

Each reaction just increments a Redis hash — no broadcast happens here at all. A separate ticker runs on an interval, drains the counters for every active room, and broadcasts one compact frame per room, only if there’s anything to send:

public function flushReactions(): int
{
    $flushed = 0;

    foreach (Redis::smembers(self::REACTION_ROOMS_KEY) as $room) {
        $frame = $this->drainReactions($room);

        if ($frame === []) {
            continue;
        }

        ReactionBatchSent::dispatch($room, $frame);
        $flushed++;
    }

    return $flushed;
}

The result: viewers still see reactions flowing in close to real time, but the number of websocket broadcasts is bounded by the tick rate, not by how many people are tapping. It’s a small pattern — counter now, batch-broadcast later — but it’s the difference between a chat feature that scales and one that doesn’t.

Chat Moderation as Composable Rules

The live chat accepts a username, a team, and a message, and runs each through the same content filter using Laravel’s validation rules:

'message' => [
    'required', 'string', 'min:1', 'max:200',
    new NoBadWords($this->filter),
    new NoJudol($this->filter),
    new NoPolitics($this->filter),
],

NoJudol blocks online-gambling spam — a real and constant problem for any public Indonesian comment section — and NoPolitics keeps the room focused on the event instead of turning into an argument. Each is its own rule object rather than one large filter function, so they can be tested, toggled, and reused independently (usernames run through the bad-words and judol filters too, just with a different error message so the frontend knows to reopen the “pick a name” prompt instead of showing an inline error).

There’s also a CMS toggle to turn on bot personas — scripted messages that keep the chat room feeling alive before real viewers show up in numbers. It’s a small thing, but an empty chat room is worse than no chat room at all.

A CMS That Deliberately Isn’t Inertia

The admin panel — live stream management, game toggles, leaderboard periods, chat controls — is plain Blade, not Inertia. That’s a deliberate call, and it’s spelled out right in the route file:

The React bundle in this project ships to the audience. There’s no reason to grow that bundle for pages only a handful of committee members ever open. It also means the CMS keeps working to fix things even if the frontend build is broken.

That second point matters more than it sounds: during a live event, if a bad deploy breaks the React build, you still want to be able to log in and turn off a broken feature. A Blade-only admin panel doesn’t depend on the same build pipeline as the audience-facing site, so it stays usable exactly when things are going wrong.

The leaderboard reset is guarded the same way — not a browser confirm() dialog, but a “type the confirmation text exactly” check in the controller, because a leaderboard reset during a live event is not a mistake you get to undo.

What Made This Different from a Regular Site

A few things stood out compared to the content sites I usually build:

  • Feature switches need to be structural, not cosmetic. Hiding a link isn’t the same as closing access — the games-outside-public/ pattern is the clearest example of that.
  • Real-time features need a throttling story from day one. “Broadcast on every event” works in a demo and fails under real concurrency; aggregate-then-flush is a pattern worth reaching for by default, not after the first incident.
  • The admin tooling deserves its own resilience story, especially for a live, time-boxed event where the failure mode isn’t “fix it next sprint” but “fix it in the next five minutes while people are watching.”
  • Moderation is not one filter, it’s several, each answering a different question (is this abusive, is this spam, is this off-topic) and each worth being able to reason about on its own.

Building a content site and building a live-event site turn out to be different disciplines, even when the tech stack looks similar on paper. This one was a good reminder of that.