Skip to content

Full-featured weather app with Flask and SQLAlchemy. Search real-time weather and 5-day forecasts by city, zip code, or coordinates. Perform full CRUD on saved queries, view locations on Google Maps, watch related YouTube videos, and export data. Robust input validation and API integration.

Notifications You must be signed in to change notification settings

mohdirfan-code/Weather-App

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌦️ Weather App β€” Real-Time Weather, Forecast & Air Quality Platform

Created by Irfan
Fullstack AI/ML Software Engineer Project


πŸš€ Project Overview

This repository hosts the Weather App, a robust full-stack application designed to provide real-time weather data and air quality information for any locationβ€”using a modern, user-friendly interface and a scalable, extensible backend.

Both Technical Assessment #1 (Core Weather App) and #2 (Advanced Features & CRUD) are fully completed and demonstrated in this project.

Built as part of an AI/ML Software Engineer technical assessment, this project demonstrates best practices in API design, user input handling, data validation, database CRUD operations, and optional integrations with third-party platforms (e.g., YouTube, Google Maps).

Key Value:

  • Real-world API integration
  • Clean, modular codebase
  • Designed for extensibility and professional deployment
  • Ready for demonstration, portfolio, or further development

✨ Features

  • Universal Location Input:
    Search weather and air quality by city, zip code, coordinates, or landmarks. Robust validation and fuzzy matching for user convenience.

  • Real-Time Weather & 5-Day Forecast:
    Live data from OpenWeatherMap, including detailed weather info, icons, and at-a-glance summaries.

  • Air Quality Index (AQI) Data:
    Instantly retrieve current air quality information for user-selected locations, powered by OpenWeatherMap Air Pollution API.

  • Geolocation Support:
    Instantly fetch weather and air quality for your current positionβ€”using your browser/device location (with user permission).

  • Comprehensive CRUD:
    Save, update, view, and delete weather and air quality queries/records. All data is persisted in a robust SQLite database via SQLAlchemy ORM.

  • Data Export:
    Export your search history or saved records to JSON, CSV, XML, or PDF formats with one click. Great for data portability, analytics, and reporting.

  • API Integrations:

    • Google Maps: Visualize searched locations on the map.
    • YouTube: Watch trending videos about your searched location.
    • OpenWeatherMap Weather & Air Quality APIs
  • Responsive & Accessible UI:
    Clean, mobile-friendly design with flexible color gradients and intuitive controls. Accessibility best practices followed.

  • Error Handling:
    Clear, actionable error messages for every input and API call.

  • No Authentication Required:
    All features are open for demonstration and review.

  • Info Button:
    Learn about the Product Manager Accelerator (PMA) from within the app.


πŸ› οΈ Tech Stack

  • Backend: Python 3.12+, Flask, SQLAlchemy, SQLite
  • Frontend: HTML5, CSS3, JavaScript (ES6+), Jinja2
  • APIs: OpenWeatherMap (Weather & Air Quality), YouTube Data API, Google Maps
  • Utilities: Pandas (export), FPDF (PDF export), python-dotenv (for secure API key management)
  • Testing: (Add your test framework, e.g., pytest, if implemented)
  • Deployment: Easily deployable on Heroku, Render, or any WSGI-compatible service

πŸ–ΌοΈ App Screenshots

Home Page Home Page

Search Result Search Result

Air Quality Air Quality

Google Location & YouTube Videos Google Location & Youtube Videos

Records (CRUD) Records (CRUD)

Info Page Info Page


πŸ—οΈ Project Structure

weather-app/ β”‚ β”œβ”€β”€ .env β”œβ”€β”€ .gitignore β”œβ”€β”€ README.md β”œβ”€β”€ requirements.txt β”œβ”€β”€ run.py β”œβ”€β”€ test.py β”‚ β”œβ”€β”€ app/ β”‚ β”œβ”€β”€ air_quality.py β”‚ β”œβ”€β”€ export.py β”‚ β”œβ”€β”€ forms.py β”‚ β”œβ”€β”€ geocode.py β”‚ β”œβ”€β”€ maps_api.py β”‚ β”œβ”€β”€ models.py β”‚ β”œβ”€β”€ routes.py β”‚ β”œβ”€β”€ utils.py β”‚ β”œβ”€β”€ weather_api.py β”‚ β”œβ”€β”€ youtube_api.py β”‚ └── __init__.py β”‚ β”œβ”€β”€ instance/ β”‚ └── weather_app.db β”‚ β”œβ”€β”€ static/ β”‚ β”œβ”€β”€ style.css β”‚ β”œβ”€β”€ css/ β”‚ β”œβ”€β”€ img/ β”‚ └── js/ β”‚ β”œβ”€β”€ templates/ β”‚ β”œβ”€β”€ base.html β”‚ β”œβ”€β”€ create.html β”‚ β”œβ”€β”€ edit.html β”‚ β”œβ”€β”€ history.html β”‚ β”œβ”€β”€ index.html β”‚ β”œβ”€β”€ info.html β”‚ β”œβ”€β”€ list.html β”‚ β”œβ”€β”€ view.html β”‚ └── weather.html β”‚ └── __pycache__/ 

⚑ Quickstart Guide

1. Clone the Repository

git clone https://github.com/yourusername/weather-app.git cd weather-app

2. Create and Activate a Virtual Environment

python -m venv venv # Activate: # Windows: venv\Scripts\activate # Mac/Linux: source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Setup Environment Variables

5. Run the Application

flask run

πŸ’Ύ CRUD & Data Export

  • Create: Save any weather or air quality search with location and date range.
  • Read: Review all your saved queries and their results.
  • Update: Modify existing records (location or date).
  • Delete: Remove any record with one click.
  • Export: Download all your data in JSON, CSV, XML, or PDF.

πŸ“ Assessment Requirements Mapping

Requirement Implemented? Notes
User-friendly location input βœ… Supports city, zip, coords, landmarks
Real API weather data βœ… OpenWeatherMap integration
Air Quality Data βœ… OpenWeatherMap AQI API
5-day forecast βœ… Shown with icons and summary
Current location support βœ… Uses browser geolocation
CRUD (Create, Read, Update, Delete) βœ… All operations with validation
Data export (JSON, CSV, XML, PDF) βœ… Multiple formats supported
API integration (YouTube, Maps) βœ… YouTube and Google Maps
Info button (PMA description) βœ… Linked to PMA LinkedIn
Error handling & validation βœ… All user input & API errors handled
Demo video βœ… Demo video link

πŸ“Ή Demo Video

Embed your screencast or YouTube demo link below for reviewers and LinkedIn viewers:

πŸ“Ή Watch Demo on Vimeo


🌐 About Product Manager Accelerator (PMA)

Product Manager Accelerator (PMA) is a premier training and internship platform for aspiring product managers and AI engineers.
PMA offers hands-on projects, mentorship from industry leaders, and a direct pathway to launching your PM/AI career. Learn more at pmaccelerator.io or visit their LinkedIn page.


πŸ“‡ Contact


⭐ Show your support!

If you found this project useful or inspiring:

  • Star this repo ⭐
  • Fork and contribute 🀝

Thank you so much for checking out my Weather App!


About

Full-featured weather app with Flask and SQLAlchemy. Search real-time weather and 5-day forecasts by city, zip code, or coordinates. Perform full CRUD on saved queries, view locations on Google Maps, watch related YouTube videos, and export data. Robust input validation and API integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published