📂 How it works
The instance/ folder serves as the data core for your local Hattrick portal. When running the application, the template engine doesn't generate information out of nowhere; it requires a centralized location to read the current state of your club, profile, and store. This folder acts as a "simplified database" powered by flat files in JSON format.
Each JSON file within this directory has a single, well-defined responsibility. Separating data into dedicated files (teams.json, manager.json, and products.json) allows us to optimize queries, prevent the app from loading unnecessary overhead, and make manual or automated block editing straightforward and independent.
| Configuration File | Main Function | What happens if it's missing? |
|---|---|---|
instances/teams.json |
Club & sports data | The application will fail when attempting to load the squad, stadium, or league standings sections. |
instances/manager.json |
Manager identity | The application will fail to load the home page. |
instances/products.json |
Store catalog | The store section will appear completely empty. |
🚀 Generator: Quick Import and Hattrick Capture
Manually entering every player, their stats, stadium capacity, or league details from the Hattrick website into your config file can be time-consuming and prone to typos. JSON syntax is exceptionally strict—a single missing comma or unclosed quote will trigger a DecodeError, causing the application to crash.
To streamline this setup, our capture assistant is designed to **convert live data from the official Hattrick website directly into your local configuration file**. This allows you to import all your club's information in seconds without writing code or copying values one by one.
Want to save time importing manager data?
Use the web capturer to generate your Hattrick manager data directly into your manager.json file.
Want to save time generating your team?
Use the web capturer to generate your Hattrick club data into your teams.json file.
How the quick import process works:
teams.json or manager.json) that fits the app's requirements.
instances/ folder. Your portal will instantly reflect the current state of your official squad.
Efficiency Tip: Use this method especially during the first week of a new season. This keeps your portal fully updated with just a single click.
📝 Manual Editing & Variables Dictionary
If you prefer to manage your configuration the "old school" way or you are feeding data through your own automated script (such as data extracted via Jupyter or a custom Flask integration), you can open any .json file using a plain text editor or IDE (like VS Code, Notepad++, or even Notepad).
Within the template engine used in the templates/ folder, you can call any stored value using dynamic variables. When the application runs, it maps the fields from the JSON file and binds them as environment variables for the portal's rendering layout.
Feel free to append custom fields to the JSON and use them directly inside your HTML templates.
⚠️ Strict rules for manual JSON editing:
- Strings must use double quotes: Text strings cannot be saved without double quotes (e.g.,
"FC Giru"is correct;FC Giruwill cause a syntax crash). - Key separation: Every data element inside an object—except for the very last one—must be followed by a trailing comma (
,). - Numbers do not take quotes: Integer or floating-point numbers, such as stadium capacity or product prices, should be written directly without quotes (e.g.,
15000or45.00).