https://github.com/bartlomiejsadza/weatherapp--pythonbackend
Weather app backend via. FastAPI framework
https://github.com/bartlomiejsadza/weatherapp--pythonbackend
fastapi python
Last synced: 2 months ago
JSON representation
Weather app backend via. FastAPI framework
- Host: GitHub
- URL: https://github.com/bartlomiejsadza/weatherapp--pythonbackend
- Owner: BartlomiejSadza
- Created: 2025-01-24T15:23:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-25T15:42:38.000Z (over 1 year ago)
- Last Synced: 2025-01-28T04:31:45.525Z (over 1 year ago)
- Topics: fastapi, python
- Language: Python
- Homepage: https://proud-water-05321801e.5.azurestaticapps.net/
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weather Forecast and Solar Energy Prediction Application
This repository contains the solution for the recruitment task provided by Codibly IT Academy. The application is built with the following stack:
- **Backend**: Python + Flask
- **Frontend**: React + TypeScript + Next.js
## Project Overview
The application provides weather forecasts for the next 7 days and estimates solar energy production based on the forecasted weather conditions.
## Backend
### Features
- **Two API Endpoints**:
1. **7-day Weather Forecast**:
- Returns:
- Date
- Weather code
- Minimum and maximum temperatures
- Estimated energy production in kWh
2. **Weekly Summary**:
- Returns:
- Average pressure
- Average daily sun exposure time
- Extreme temperatures of the week
- General weather summary (e.g., "Rainy week" or "Dry week")
- **Calculation**:
- Solar energy production:
```
Energy [kWh] = Power [kW] x Sun Exposure Time [h] x Panel Efficiency
```
- Power = 2.5 kW
- Efficiency = 20%
- **Validation**:
- Validates latitude and longitude inputs.
- Handles errors from external API.
- **Data Integration**:
- Fetches weather data from the [Open-Meteo API](https://open-meteo.com/).
## Frontend
### Features
- **Weather Table**:
- Displays:
- Date (DD/MM/YYYY)
- Weather icon
- Minimum and maximum temperatures
- Estimated energy production (kWh)
- **Footer Summary**:
- Displays:
- Weekly extreme temperatures
- Average pressure
- Average sun exposure time
- General weather summary
- **Extras**:
- Automatically detects user location.
- Responsiveness and Dark Mode.