diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..f710581 --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,2 @@ +VITE_API_URL=http://localhost:8000 +VITE_WS_URL=ws://localhost:8000/ws/real-time diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..d24f8c6 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,26 @@ +# Dependencies +node_modules/ +dist/ + +# Logs +*.log +npm-debug.log* + +# Environment +.env +.env.local +.env.*.local +.env.production +!.env.example +!.env.template + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..91afa54 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,13 @@ + + +
+ + + +{alert.message}
+{alert.message}
+{message}
+ {onRetry && ( + + )} +Loading...
+| Timestamp | +Buy Region | +Buy Price | +Sell Region | +Sell Price | +Spread | +Volume | +
|---|---|---|---|---|---|---|
| {formatTimestamp(opportunity.timestamp)} | +{opportunity.buy_region} | +{formatPrice(opportunity.buy_price)} | +{opportunity.sell_region} | +{formatPrice(opportunity.sell_price)} | ++ + +{opportunity.spread.toFixed(2)} + + | +{formatVolume(opportunity.volume_mw)} | +
| Model ID | +Type | +Version | +Created | +Status | +Metrics | +
|---|---|---|---|---|---|
| {model.model_id} | +{MODEL_TYPE_LABELS[model.model_type]} | +{model.version} | +{formatTimestamp(model.created_at)} | ++ + {status.charAt(0).toUpperCase() + status.slice(1)} + + | +
+ {Object.entries(model.metrics).map(([key, value]) => (
+
+ {key}: {value.toFixed(3)}
+
+ ))}
+ |
+
| Timestamp | +Type | +Region | +Price | +Volume | +Revenue | +
|---|---|---|---|---|---|
| {formatTimestamp(trade.timestamp)} | ++ + {TRADE_TYPE_LABELS[trade.trade_type]} + + | +{trade.region || '-'} | +{formatPrice(trade.price)} | +{formatVolume(trade.volume_mw)} | += 0 ? 'text-green-400' : 'text-red-400'}`}> + {trade.revenue >= 0 ? '+' : ''}{trade.revenue.toFixed(2)} € + | +
| Name | +Status | +Created | +Actions | +
|---|---|---|---|
| {backtest.name} | ++ + {BACKTEST_STATUS_LABELS[backtest.status]} + + | +{formatTimestamp(backtest.created_at)} | ++ + | +
{backtest.name}
+{BACKTEST_STATUS_LABELS[backtest.status]}
+{formatDuration(backtest.started_at, backtest.completed_at || undefined)}
+{selectedModel.model_id}
+{MODEL_TYPE_LABELS[selectedModel.model_type]}
+{selectedModel.version}
+{formatTimestamp(selectedModel.created_at)}
++ Configure trading parameters and battery settings. Changes take effect immediately. +
+ +Energy Trading UI v1.0.0
+Real-time energy trading dashboard with backtesting and ML model management.
+| Region | +Position (MW) | +Battery Charge | +P&L (€) | +
|---|---|---|---|
| {pos.region} | +{pos.position_mw?.toFixed(2)} | +{pos.battery_charge_pct?.toFixed(1)}% | += 0 ? 'text-green-400' : 'text-red-400'}`}> + {formatPnL(pos.pnl)} + | +