A mobile-optimized web app for logging running clothes and getting AI-powered clothing recommendations based on weather conditions and personal preferences.
Problem: Current location lookup takes 2-3+ seconds, causing slow UI rendering and poor UX.
Root Cause:
Affected Code Locations:
NewRunModal.tsx:82-102 - Initial location lookup on modal openNewRunModal.tsx:153-167 - Custom location searchPlanTab.tsx:28-47 - Location lookup on tab mountbackend/routes/weather.ts:170-214 - Forward geocode endpoint (no cache)backend/routes/weather.ts:229-272 - Reverse geocode endpoint (no cache)Recommended Solutions (in priority order):
Add server-side caching (Biggest impact)
Make UI non-blocking (Better UX)
localStorage caching (Quick win)
{lat, lon, name, timestamp}Consider alternative geocoding services (if problem persists)
Request deduplication
Implementation Priority: Start with #1 (caching) + #2 (non-blocking UI) for maximum impact.
├── 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
ANTHROPIC_API_KEY environment variable:
ANTHROPIC_API_KEY = your-api-key-herebackend/index.http.tsxANTHROPIC_API_KEY (required): Your Anthropic API key for Claude AI recommendationsGET /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 logGET /api/weather/current?lat=...&lon=... - Get current weatherGET /api/weather/forecast?lat=...&lon=...&datetime=... - Get forecast weatherPOST /api/recommendations - Get clothing recommendation
{ "weather": { "temp": 70, "dewPoint": 60, "conditions": "Clear", "time": "..." } }Each run log includes:
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