Weather App Assignment 🌦️
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
2. Login Page - Day Mode
3. Registration Page - Night Mode
4. Registration Page - Day Mode
5. Dashboard
6. Weather Logs Page - Night Mode
7. Weather Logs Page - Day Mode
Key Features 🚀
-
Real-Time Weather Data Retrieval
-
Fetches weather data using the OpenWeather API for any city.
- Displays key details:
- Temperature (Celsius or Fahrenheit)
- Pressure
- Humidity
- Wind Speed and Direction
-
Auto-refreshes weather data every 2 seconds.
-
User Authentication
-
Secure login based on credentials stored in a JSON file.
- Passwords hashed for secure storage and validation.
-
Only authenticated users can access the app's features.
-
Weather Logging
-
Log the displayed weather data with a single click.
- Persistent storage using PostgreSQL, ensuring user-specific logs are saved.
- View logged data in a structured table or card view.
-
Ability to delete individual logs.
-
Enhanced Security
-
CSRF protection and secure cookie management.
-
API keys securely managed to prevent exposure.
-
User Experience Enhancements
-
Night mode for better readability in low-light conditions.
- Auto-logout after inactivity for enhanced security.
-
Auto-refresh feature every 10 minutes for selected locations.
-
Optional AWS Integration (Challenge)
- 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 🛠️
- Clone the Repository
-
Set Up the Environment
-
Create a
.env
file for sensitive credentials (refer to.env.example
): -
Install Dependencies
- Run the Application
- Access the App
Navigate to http://localhost:5000 in your browser.