Add React frontend for energy trading system

Implements React + TypeScript UI with Vite and Tailwind CSS.
Features dashboard with real-time WebSocket updates, backtesting
page, model management interface, trading controls, and settings.
Includes state management with Zustand, API integration with
Axios/TanStack Query, and interactive charts with Recharts.
This commit is contained in:
2026-02-12 01:01:08 +07:00
parent fe76bc7629
commit c6bca0b7bb
48 changed files with 5978 additions and 0 deletions

28
frontend/src/lib/utils.ts Normal file
View File

@@ -0,0 +1,28 @@
import { type ClassValue, clsx } from 'clsx';
export function cn(...inputs: ClassValue[]) {
return clsx(inputs);
}
export function formatDate(date: string | Date): string {
const d = new Date(date);
return d.toLocaleString();
}
export function formatCurrency(value: number, currency: string = 'EUR'): string {
return new Intl.NumberFormat('en-EU', {
style: 'currency',
currency,
}).format(value);
}
export function formatNumber(value: number, decimals: number = 2): string {
return new Intl.NumberFormat('en-EU', {
minimumFractionDigits: decimals,
maximumFractionDigits: decimals,
}).format(value);
}
export function formatPercentage(value: number, decimals: number = 2): string {
return `${formatNumber(value * 100, decimals)}%`;
}