Skip to content

Weather App Assignment 🌦️

License: GPL-3.0

This is a Python-based web application that allows users to retrieve, log, and manage weather data. It features secure user authentication, real-time weather data retrieval using the OpenWeather API, and persistent logging with a PostgreSQL database.


Screenshots: A Visual Tour of the App 🖼️

1. Login Page - Night Mode

Login Page - Black Theme

2. Login Page - Day Mode

Login Page - White Theme


3. Registration Page - Night Mode

Registration Page - Black Theme

4. Registration Page - Day Mode

Registration Page - White Theme


5. Dashboard

Dashboard


6. Weather Logs Page - Night Mode

Weather Logs Page - Black Theme

7. Weather Logs Page - Day Mode

Weather Logs Page - White Theme


Key Features 🚀

  1. Real-Time Weather Data Retrieval

  2. Fetches weather data using the OpenWeather API for any city.

  3. Displays key details:
    • Temperature (Celsius or Fahrenheit)
    • Pressure
    • Humidity
    • Wind Speed and Direction
  4. Auto-refreshes weather data every 2 seconds.

  5. User Authentication

  6. Secure login based on credentials stored in a JSON file.

  7. Passwords hashed for secure storage and validation.
  8. Only authenticated users can access the app's features.

  9. Weather Logging

  10. Log the displayed weather data with a single click.

  11. Persistent storage using PostgreSQL, ensuring user-specific logs are saved.
  12. View logged data in a structured table or card view.
  13. Ability to delete individual logs.

  14. Enhanced Security

  15. CSRF protection and secure cookie management.

  16. API keys securely managed to prevent exposure.

  17. User Experience Enhancements

  18. Night mode for better readability in low-light conditions.

  19. Auto-logout after inactivity for enhanced security.
  20. Auto-refresh feature every 10 minutes for selected locations.

  21. Optional AWS Integration (Challenge)

  22. Serverless backend using AWS Lambda and API Gateway for storing weather logs in DynamoDB.

Technologies Used 🛠️

Backend

  • Python: Flask for server-side development.
  • PostgreSQL: For persistent and scalable database storage.
  • SQLAlchemy: ORM for seamless database integration.

Frontend

  • HTML, CSS, and JavaScript: Core frontend technologies.
  • Bootstrap: For responsive and modern design.

Third-Party Services

  • OpenWeather API: For fetching real-time weather data.
  • AWS Lambda & DynamoDB (optional): For cloud-based data storage.

Tools

  • Docker: Containerization for ease of deployment.
  • Vercel: Hosting and deployment.

Setup and Installation 🛠️

  1. Clone the Repository
git clone https://github.com/NitkarshChourasia/weather_app_assignment.git
cd weather_app_assignment
  1. Set Up the Environment

  2. Create a .env file for sensitive credentials (refer to .env.example):

    API_KEY=your_openweather_api_key
    DATABASE_URL=your_postgresql_database_url
    SECRET_KEY=your_flask_secret_key
    

  3. Install Dependencies

pip install -r requirements.txt
  1. Run the Application
flask run
  1. Access the App
    Navigate to http://localhost:5000 in your browser.