How gursheyss/streamerstocks works
Project type and purpose
• This is a full-stack, real-time stock prediction/trading dashboard built with SvelteKit.
• Frontend: Svelte components under src/lib/components and page routes under src/routes.
• Backend/API: SvelteKit “+server.ts” endpoints handling predictions, trading, auth callbacks, Twitch EventSub, etc.
• Data and state layers: Supabase for persistent storage and auth; Redis for caching/updating stock snapshots.
• Sidecar microservice: A Python “stocks-script” that fetches and analyzes data (Reddit, Twitch, custom logic) and pushes updates via webhooks or cron.
File structure
• Top-level config: package.json, tsconfig.json, svelte.config.js, tailwind.config.js — sets up SvelteKit/TypeScript/Tailwind.
• src/lib/server: redis.ts, supabase.ts, updatestocks.ts — wrappers for external services and a stock-update scheduler.
• src/routes/api: /predict and /trade endpoints.
• src/routes/auth and eventsub: OAuth and Twitch EventSub webhook handlers.
• static/: public assets.
• stocks-script/: independent Python service in its own Docker container (Dockerfile) with analyzers and webhook.py to push data to the SvelteKit backend.
Elements
• Clear labels: “Browser (SvelteKit UI)”, “SvelteKit Server”, “Supabase DB & Auth”, “Redis Cache/PubSub”, “Python stocks-script Service”, “Twitch EventSub”, “Reddit API”.
• User → server → DB/cache → user.
• Python service → webhook → server → Redis/DB.
• External services → Python service or server endpoints.
• Client components (e.g., blue rectangles),
• Backend components (e.g., green),
• External services (e.g., orange clouds),