A full-stack Weather Dashboard built using FastAPI, React, SQLAlchemy, and WeatherAPI. The application provides real-time weather information, 5-day forecasts, weather history management, statistics, and data export functionality.
Developed as part of the AI Engineer Intern Technical Assessment.
- Search weather by city or location.
- Real-time weather information using WeatherAPI.
- Weather condition icons.
- Displays:
- Temperature
- Feels Like Temperature
- Humidity
- Pressure
- Wind Speed
- Visibility
- UV Index
- Sunrise & Sunset
- Location autocomplete/search suggestions.
- Fuzzy location matching.
- Select locations directly from search results.
- Displays:
- Date
- Average Temperature
- Minimum Temperature
- Maximum Temperature
- Weather Condition
- Humidity
- Air Quality
- Weather Icon
- Total Searches
- Average Temperature
- Highest Temperature
- Lowest Temperature
- Most Searched City
- Stores weather records in SQLite.
- Full CRUD functionality:
- Create
- Read
- Update
- Delete
- Export weather history to CSV.
- Export weather history to PDF.
- Invalid location handling.
- API error handling.
- Database validation.
- Proper HTTP status codes.
- FastAPI
- SQLAlchemy
- SQLite
- Pydantic
- HTTPX
- React
- Vite
- Axios
- WeatherAPI
weather-assistant/
│
├── app/
│ ├── core/
│ ├── models/
│ ├── routers/
│ ├── schemas/
│ ├── services/
│ └── utils/
│
├── weather-frontend/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ ├── pages/
│ │ └── assets/
│
├── requirements.txt
├── README.md
└── .gitignore
git clone https://github.com/Athrv-D/weather-assistant/Create Virtual Environment
python -m venv .venvActivate Environment
.venv\Scripts\activatepip install -r requirements.txtRun Backend
uvicorn app.main:app --reloadBackend URL
http://127.0.0.1:8000
Swagger Documentation
http://127.0.0.1:8000/docs
Move to frontend
cd weather-frontendInstall packages
npm installRun frontend
npm run devFrontend URL
http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
| GET | /weather/search |
Search locations |
| GET | /weather/current |
Current weather |
| GET | /weather/forecast |
5-Day Forecast |
| GET | /weather/history |
Weather history |
| GET | /weather/statistics |
Weather statistics |
| GET | /weather/export/pdf |
Export PDF |
| GET | /weather/export/csv |
Export CSV |
| PUT | /weather/{id} |
Update weather record |
| DELETE | /weather/{id} |
Delete weather record |
The application stores:
- City
- Country
- Latitude
- Longitude
- Temperature
- Feels Like Temperature
- Humidity
- Pressure
- Wind Speed
- Visibility
- Weather Condition
- Description
- Weather Icon
- UV Index
- Air Quality
- Sunrise
- Timestamp
- User Authentication
- Weather Charts
- Weather Alerts
- Multiple Export Formats
- Maps Integration
- AI Weather Recommendations
React Frontend │ ▼ FastAPI Backend │ ▼ WeatherAPI │ ▼ SQLite Database │ ▼ Response to Frontend
Atharv Gupta
AI Engineer Intern Technical Assessment