Welcome to Weather App — a modern, responsive web application providing real-time weather updates and news tailored to your location.
Built with:
- FastAPI backend serving a powerful and efficient API
- Beautiful TailwindCSS frontend for smooth user experience
- Interactive Leaflet.js maps for location visualization
- Integration with OpenWeatherMap & NewsAPI for accurate weather and news data
Whether you want to check current weather, forecast, or local news — this app has you covered.
- Search weather by city name, postal code, or geographic coordinates
- 5-day detailed weather forecast with temperature and conditions
- Interactive map showing your selected location
- Local news panel with latest news from the searched city
- Manage (CRUD) your saved weather data
- Export weather data in JSON, CSV, or PDF formats
- Responsive design for desktops and mobiles
| Layer | Technology |
|---|---|
| Backend | FastAPI, SQLAlchemy |
| Frontend | HTML, TailwindCSS, Leaflet.js, FontAwesome |
| Data Storage | SQLite |
| Utilities | httpx, FPDF |
| Containerization | Docker |
- Python 3.11 or higher
- Docker (optional but recommended)
- API keys from:
git clone https://github.com/shgyg99/Weather-App.git
cd Weather-App
⚠️ Important The API keys file (e.g.,config.py) is excluded from the repository for security reasons via.gitignore. After cloning, you must create this file manually to provide your API keys.
Create a config.py file in the project root with the following content:
openwether = "YOUR_OPENWEATHERMAP_API_KEY"
news = "YOUR_NEWSAPI_API_KEY"Replace the placeholders with your actual API keys.
python -m venv venv
source venv/bin/activate # Linux/MacOS
venv\Scripts\activate.bat # Windowspip install -r requirements.txtuvicorn main:app --reloadOpen your browser and visit: http://localhost:8000
docker build -t weather-app .docker run -d -p 8000:8000 --name weather-container weather-appOpen http://localhost:8000 in your browser.
Note: Ensure your
config.pyfile with API keys is available inside the Docker build context. If it’s not copied by default, you may need to mount it as a volume or include it in your Dockerfile.
| Endpoint | Method | Description |
|---|---|---|
/weather |
GET | Get weather by city, postal code, or coords |
/local-news |
GET | Fetch local news for a given city |
/weather-db |
GET/POST/PUT/DELETE | CRUD operations on saved weather data |
/weather-db/download |
GET | Export saved weather data (json, csv, pdf) |
/reset-db |
POST | Reset the database (drops & recreates tables) |
This project is licensed under the MIT License.
Shaghayegh Matlabi LinkedIn | GitHub
Thank you for checking out the Weather App! Feel free to contribute or open issues.

