Sign inSign up

ritesh355/weather-app-backend

By ritesh355

โ€ขUpdated about 1 year ago

A Dockerized Flask backend for the Weather App

Image
0

185

ritesh355/weather-app-backend repository overview

โ ๐ŸŒค๏ธ Weather App (Dockerized Flask + Nginx)

A simple weather app built with Flask and served via Nginx using Docker Compose. Enter a city name and get real-time weather data fetched from the OpenWeatherMap API.

โ ๐Ÿ“‚ Project Structure

weather-app/
โ”‚
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ app.py               # Flask app
โ”‚   โ””โ”€โ”€ requirements.txt     # Python dependencies
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ index.html           # Simple HTML frontend
โ”‚
โ”œโ”€โ”€ nginx/
โ”‚   โ””โ”€โ”€ default.conf         # Nginx reverse proxy config
โ”‚
โ”œโ”€โ”€ Dockerfile               # Flask Docker image
โ”œโ”€โ”€ docker-compose.yml       # Docker Compose setup
โ””โ”€โ”€ README.md                # Project documentation

โ ๐Ÿš€ Features

  • ๐Ÿ Python Flask backend
  • ๐ŸŒ Nginx as a reverse proxy
  • ๐Ÿณ Docker + Docker Compose support
  • ๐Ÿ”„ Realtime weather data using OpenWeatherMap
  • ๐Ÿ’ป Clean and simple frontend UI

โ โš™๏ธ Setup Instructions

โ 1. ๐Ÿงฐ Prerequisites

Make sure you have:

โ 2. ๐Ÿ› ๏ธ Clone the Repo
git clone https://github.com/yourusername/weather-app.git
cd weather-app
โ 3. ๐Ÿ” Configure Environment

Create a .env file in the project root:

API_KEY=your_openweathermap_api_key_here
โ 4. ๐Ÿ“ฆ Build & Run Containers
docker-compose up --build

Access the app at: http://localhostโ 

โ 5. ๐Ÿงช Example Usage
  • Open the browser.
  • Type Mumbai or New York in the input box.
  • Click Get Weather to see real-time weather.

โ ๐Ÿ“ Tech Stack

ToolPurpose
FlaskPython Web Framework
OpenWeatherMapWeather API Provider
NginxReverse Proxy
DockerContainerization
Docker ComposeMulti-container setup
HTML/CSSFrontend UI

โ ๐Ÿ“ธ Screenshot

Live โ  resultโ 

โ ๐Ÿงน Cleanup

To stop and remove containers:

docker-compose down

โ ๐Ÿ“Œ Notes

  • For production, use Gunicorn instead of Flask's development server.
  • Add error handling and input validation for better UX.

โ ๐Ÿ™Œ Acknowledgments

โ ๐Ÿ”— Connect with Me

Tag summary

Content type

Image

Digest

sha256:096777f82โ€ฆ

Size

50.5 MB

Last updated

about 1 year ago

docker pull ritesh355/weather-app-backend