A SvelteKit app that tracks ski resort conditions and creates personalized alerts using AI. This is the starter project for the Svelte on Vercel course.
npm install
cp .env.example .env # Add your AI_GATEWAY_API_KEY
npm run devOpen http://localhost:5173 to see the app.
The UI, data layer, and routing are ready to go:
- Conditions dashboard showing live weather for 5 ski resorts
- Alerts page with localStorage persistence
- Chat interface wired up and waiting for a streaming endpoint
- Resort data for Mammoth, Palisades Tahoe, Grand Targhee, Steamboat, and Mt. Bachelor
- Weather service pulling from Open-Meteo (free, no API key needed)
- Alert schemas validated with Valibot
Look for // TODO: comments in the codebase. Throughout the course, you'll implement:
- AI chat endpoint (
src/routes/api/chat/+server.ts): Streaming responses with tool calling - Structured output (
src/routes/api/parse-alert/+server.ts): Natural language to structured alert data - Background workflow (
src/routes/api/workflow/+server.ts): Durable execution with error handling - ISR caching (
src/routes/+page.server.ts): Incremental Static Regeneration for the dashboard - AI provider (
src/lib/ai/provider.ts): Centralized model config with usage tracking
src/
├── lib/
│ ├── ai/ # AI provider config (TODO)
│ ├── components/ # ResortCard, AlertCard, Chat
│ ├── data/ # Resort metadata
│ ├── schemas/ # Alert Valibot schemas
│ └── services/ # Weather API, alert evaluation
├── routes/
│ ├── +page.svelte # Conditions dashboard
│ ├── alerts/ # My Alerts page
│ └── api/
│ ├── chat/ # AI streaming endpoint (TODO)
│ ├── evaluate/ # Alert evaluation
│ ├── parse-alert/ # Structured output (TODO)
│ └── workflow/ # Background workflow (TODO)
| Variable | Description |
|---|---|
AI_GATEWAY_API_KEY |
API key for the AI Gateway (required for AI features) |
Switch to the complete branch to see the finished implementation:
git checkout complete- SvelteKit with adapter-vercel
- AI SDK v6 for streaming chat and tool calling
- Valibot for schema validation
- Tailwind CSS v4
- Open-Meteo for weather data