SkyCast is a full-stack weather app with a FastAPI backend, SQLite caching, optional AI insights, and a static HTML/CSS/JS frontend.
- Current weather, 5-day forecast, and air quality via OpenWeatherMap
- Optional AI weather summary via Anthropic
- SQLite-backed cache, search history, and favorites
- Polished single-page frontend with dynamic visuals, unit toggle, and light/dark mode
backend/FastAPI app, database, and environment configfrontend/static frontend (served by the backend)requirements.txtPython dependencies
- Python 3.10+
- OpenWeatherMap API key
- (Optional) Anthropic API key for AI insights
-
Create the backend environment file:
- Copy
backend/.env.exampletobackend/.env - Set
OWM_API_KEYto your OpenWeatherMap key - Optionally set
ANTHROPIC_API_KEY
- Copy
-
Install dependencies (from repo root):
pip install -r requirements.txtStart the backend (from repo root):
uvicorn backend.main:app --reload --port 8000Open the app at http://localhost:8000.
OWM_API_KEY(required): OpenWeatherMap API keyANTHROPIC_API_KEY(optional): Enables AI insightsCACHE_TTL(optional, default 600): Cache TTL in secondsDB_PATH(optional, defaultskycast.db): SQLite file path
GET /api/weather?city=LondonCurrent weather, forecast, AQI, AI insightGET /api/history?limit=10Recent searchesGET /api/favoritesList favoritesPOST /api/favorites?city=ParisAdd favoriteDELETE /api/favorites/{city}Remove favoriteGET /api/statsApp statsGET /docsSwagger UI
- The backend serves the frontend from
frontend/index.htmlat the root path/. - SQLite data is stored in
backend/skycast.dbby default.