Tools Vertical Architecture
The Trezoriq Tools vertical is a registry-driven system designed for high performance, modularity, and offline availability. Every calculator follows a strict structural mandate.
The Registry System
Instead of creating static pages for every tool, Trezoriq uses a centralized registry located in `src/tools/registry/`. This allows us to:
- Manage metadata (SEO, tags, keywords) in one place.
- Dynamically generate routing and sitemaps.
- Standardize components across 320+ tools.
// src/tools/registry/[pillar].ts
export const GROW_TOOLS: ToolDefinition[] = [
{
name: "SIP Calculator",
slug: "sip-calculator",
category: "grow",
component: "SipCalculator",
engine: "calculateSIP",
// ... metadata
}
];Mathematical Engines
All financial logic is isolated into **Pure Engines** (`src/tools/engines/`). These engines:
- Are pure JavaScript/TypeScript functions.
- Contain NO React hooks or UI state.
- Use the `Money` class for all financial precision.
Financial Precision
NEVER use floating-point numbers for intermediate financial calculations. Always wrap values in the `Money` class to avoid IEEE 754 rounding errors common in JavaScript.
Canonical UI Components
To maintain visual consistency, all tools must use the standard component set:
InputPanel
Standardized sliders and numeric inputs with validation.
ResultSection
Visual output area with ValueCards and Charts.
