KTO Group · Jun 2025 — Present
Rebuilding KTO’s sportsbook frontend
From a third-party hosted sportsbook to a custom React and TypeScript platform, with ownership of frontend architecture and core customer journeys.
- Problem
- Replace a hosted sportsbook with a custom frontend that loads quickly and handles live data.
- My role
- Senior Front-End Developer, owning frontend architecture and core customer journeys.
- Result
- Faster initial loading and return visits in performance testing, with checks to protect bundle size.
Performance results
Results from performance testing, as reported in my CV.
- faster first contentful paint
- 40%
- faster largest contentful paint
- 25%
- lower blocking time
- 20%
- less transferred data
- 9.3%
- faster return navigation
- 11×
The work
KTO operates a sportsbook and online casino in the Brazilian market. I led the frontend transformation from a third-party hosted product to a custom platform, within a business serving 1.4M active users and 5B bets placed.
I owned the frontend architecture and core customer journeys. The performance work covered rendering, bundles, service loading and real-time data processing.
Getting the first view on screen
I changed the loading sequence to fetch and render the initial events, main markets and odds before setting up live updates and progressively subscribing the markets. This reduced the work that had to finish before the first view could appear.
- Initial snapshotFetch events, markets and current odds
- First viewRender the initial market data
- Live updatesSet up and progressively subscribe
Before: live setup was part of the work preceding the first view. After: render the snapshot first. This shows ordering, not measured durations.
Alongside that, I split code, lazy-loaded non-critical services, removed unused translations and used lighter dependency builds. Deferring work can make a feature’s first use slower, and the initial market snapshot still needs to transition correctly into live state.
Avoiding repeated setup on return visits
Returning to the sportsbook could repeat expensive Kambi client initialisation. Keeping the initialised client alive for reuse avoided that bootstrap work and made the tested return journey around 11 times faster. This result applies to leaving the sportsbook and coming back, rather than a first visit.
Reuse retains state and memory, so session validity, the client’s container, subscriptions and listeners all matter to a usable return.
Making consumers pay for one icon
Importing one icon from our shared package’s root entry retained roughly 65 KB gzip. Inspecting the built output showed that generated icon components were flattened into the root module; marking the package side-effect-free had not achieved the expected isolation.
I changed the package API to generate isolated per-icon entry points. A representative single-icon import then retained roughly 0.3–0.4 KB gzip. I added a bundle budget and structural tests to protect that behaviour. This was a separate package measurement, not the overall sportsbook’s transferred-data result.
Separating responsibilities
I designed a modular sportsbook architecture across a pnpm/Turborepo monorepo spanning 27 packages and 22 modules, separating reusable UI, domain logic, data providers and third-party integrations.
- Reusable UI
- Domain logic
- Data providers
- Third-party integrations
Keeping high-frequency processing off the main thread
The real-time pipeline used browser Web Workers, Socket.IO and Zustand. Heavier normalisation, filtering and sorting ran in a worker, with batched snapshots containing the fields each subscriber needed sent back to main-thread stores for React to consume.
- Live feedSocket and subscription updates
- Web WorkerProcess data and batch subscriber snapshots
- Stores → ReactPublish state and render on the main thread
Processing moves off the main thread; rendering stays on it. Batching trades fewer updates for some display latency.
Workers add messaging overhead and another lifecycle boundary; batching can add display latency. Rendering still happens on the main thread, so focused UI updates remain important. The loading-time blocking result does not isolate the worker’s effect on live interactions.
How I measured the work
I used Lighthouse, network profiling and browser performance marks around bootstrap stages, including route loading, session availability, hydration and client initialisation. Testing included slow-4G conditions.
The paint, blocking-time and transferred-data figures are combined results across the wider loading work. They do not isolate any single optimisation. Return navigation and the icon-package comparison are separate measurements.