Implemented issue #9 - Frontend Project Setup with Svelte and TypeScript. Changes: - Created SvelteKit project with TypeScript - Set up routing structure: - / (landing page) - /login - /register - /dashboard - /bot/[id] - /bot/[id]/backtest - /bot/[id]/simulate - /settings - Created Svelte stores for state management: - userStore - Current user info - botsStore - List of user's bots - currentBotStore - Selected bot - chatStore - Chat messages - backtestStore - Backtest results - simulationStore - Simulation signals - authStore - Authentication state - Created API client for backend communication - Set up environment variables (.env.example) - Created auth store with protected routes and login/register functionality
13 lines
284 B
TypeScript
13 lines
284 B
TypeScript
import { writable } from 'svelte/store';
|
|
import type { Bot } from '$lib/api';
|
|
|
|
export const currentBotStore = writable<Bot | null>(null);
|
|
|
|
export function setCurrentBot(bot: Bot | null) {
|
|
currentBotStore.set(bot);
|
|
}
|
|
|
|
export function clearCurrentBot() {
|
|
currentBotStore.set(null);
|
|
}
|