running-clothes
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v27View latest version
A mobile-optimized web app for logging running clothes and getting AI-powered clothing recommendations based on weather conditions and personal preferences.
- Plan Tab: Get personalized clothing recommendations based on current or future weather conditions
- Log Tab: View, edit, and delete your run history in an information-dense table
- New Run Form: Quickly log runs with automatic weather data fetching
- AI Recommendations: Uses Claude AI to analyze your clothing preferences and suggest optimal outfits
- Weather Integration: Automatic current and forecast weather data from Open-Meteo
- Backend: Hono (HTTP framework)
- Frontend: React 18.2.0 with TypeScript
- Database: SQLite (Val Town built-in)
- Styling: TailwindCSS (via Twind)
- Weather API: Open-Meteo (no API key required)
- AI: Claude 3.5 Sonnet (Anthropic)
- Hosting: Val Town
βββ backend/
β βββ database/
β β βββ migrations.ts # Database schema
β β βββ queries.ts # Database operations
β βββ routes/
β β βββ runLogs.ts # CRUD endpoints for run logs
β β βββ weather.ts # Weather data endpoints
β β βββ recommendations.ts # AI recommendation endpoint
β βββ index.http.tsx # Main entry point
βββ frontend/
β βββ components/
β β βββ App.tsx # Main app component
β β βββ PlanTab.tsx # Recommendations view
β β βββ LogTab.tsx # Run history view
β β βββ NewRunModal.tsx # New run form
β βββ index.html
β βββ index.tsx # Frontend entry point
β βββ style.css
βββ shared/
βββ types.ts # Shared TypeScript types
- Create a new Val Town project
- Copy all files from this repository into your Val Town project
- Set the
ANTHROPIC_API_KEYenvironment variable:- Get your API key from https://console.anthropic.com/
- In Val Town, go to Settings β Environment Variables
- Add:
ANTHROPIC_API_KEY=your-api-key-here
- The main entry point is
backend/index.http.tsx - Deploy and access your app!
ANTHROPIC_API_KEY(required): Your Anthropic API key for Claude AI recommendations
GET /api/run-logs- Get all run logsGET /api/run-logs/:id- Get a specific run logPOST /api/run-logs- Create a new run logPUT /api/run-logs/:id- Update a run logDELETE /api/run-logs/:id- Delete a run log
GET /api/weather/current?lat=...&lon=...- Get current weatherGET /api/weather/forecast?lat=...&lon=...&datetime=...- Get forecast weather
POST /api/recommendations- Get clothing recommendation- Body:
{ "weather": { "temp": 70, "dewPoint": 60, "conditions": "Clear", "time": "..." } }
- Body:
- Responsive design optimized for mobile screens
- Touch-friendly UI elements
- Geolocation support for automatic location detection
- Prevents zoom on input focus
- Smooth scrolling for tables
- Fixed floating action button for quick access
Each run log includes:
- Date and time
- Location
- Clothing choices (head, base layer, outer layer, bottom, gloves, shirt off)
- Weather conditions (temperature, dew point, conditions)
-
Logging a Run: Click the + button to log what you wore and the weather conditions. The app automatically fetches current weather data based on your location.
-
Getting Recommendations: The Plan tab uses your location and shows current/future weather. Claude AI analyzes your historical clothing choices and recommends an optimal outfit.
-
Viewing History: The Log tab displays all your runs in a compact, mobile-friendly format. Edit or delete entries as needed.
MIT