HTEco: A Data Toolkit for Hattrick, Evolved Over Two Years

Stephen Indie

Stephen Indie Thong Nguyen

HTEco: From a Learning Exercise to a Live Product

HTEco is more than just a technical project; it's my first-ever personal product, born from a passion for the Hattrick online game and a drive to master new technologies. What began as a learning exercise has now been a stable, operational application for over two years. This project chronicles my journey in building a self-sustaining product, solving real-world challenges, and continuously evolving my technical skills.

The Tech Evolution: A Full-Stack Migration

The project has undergone a significant technical evolution, reflecting my growth and adaptation to modern development trends.
Version 1.0 (The Foundation): The first iteration was built on a robust, separated stack: a NestJS backend serving a React frontend (built with Vite and Material UI). This phase was crucial for solidifying my core full-stack development skills in a traditional architecture.
Version 2.0 (The Great Migration): To embrace a more modern, unified, and performant architecture, I re-architected the entire application using Fresh. This full-stack framework, built on Deno and Preact, allowed me to create a seamless development experience from server to client, styled with Tailwind CSS for a faster, more flexible UI.

Key Challenges & My Solutions

1. Taming a Legacy API
The primary challenge was interfacing with Hattrick's legacy API, which uses SOAP/XML and OAuth 1.0. To solve this, I engineered an adapter layer that cleanly transforms the complex XML data into predictable JSON, creating a modern interface for the rest of the application to consume.
2. Engineering a Smart User Experience
The Hattrick API often experiences slowdowns and only provides data on user request. To prevent a laggy UI, I implemented an intelligent pre-fetching strategy. The system analyzes user behavior to proactively load and cache necessary data in the background. This was critical for turning a potentially frustrating wait into a smooth, uninterrupted interaction, especially when the app needed to aggregate multiple pages of historical data for its calculations.

From Raw Data to Actionable Insights

My role extended beyond development into data analysis. The core value of HTEco is its ability to transform raw data into insights. This involved:
Aggregating data and calculating new derivative metrics.
Most importantly, intelligently grouping disparate data rows into logical sets that tell a coherent story to the user through data visualization.

Architecture & Operations

The deployment architecture also evolved alongside the tech stack.
Initially, the application was deployed on a DigitalOcean Droplet, with NGINX serving as a reverse proxy for both the frontend and backend services.
Following the migration to Fresh, I moved the deployment to Deno Deploy, leveraging its native support for the Deno runtime and edge computing capabilities for superior performance and simplified operations.
Like this project

Posted Jul 23, 2025

A 2-year passion project. I modernized Hattrick's legacy API into a fast data toolkit using Deno/Fresh and a smart data pre-fetching strategy.

Likes

0

Views

0

Timeline

May 6, 2023 - Ongoing