diff --git a/README.md b/README.md index e69de29..49e19e6 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,166 @@ +# ๐ŸŒค๏ธ Weather Forecast App + +A simple yet modern **Flask-based weather forecast application** that fetches real-time weather data from [OpenWeatherMap](https://openweathermap.org/) and provides a beautiful, responsive UI. + +This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cloud** using the included shell script. + +--- + +## ๐Ÿš€ Features + +- ๐ŸŒ Search weather for any city worldwide +- ๐ŸŒก๏ธ Shows temperature, feels-like, humidity, pressure, wind speed, and visibility +- ๐ŸŒ… Displays sunrise and sunset times +- ๐Ÿ“Š Auto-updating with timestamp +- ๐ŸŽจ Responsive and modern UI (HTML, CSS, JS embedded in Flask) +- ๐Ÿณ Dockerized for portability +- โ˜๏ธ CI/CD ready with Ghaymah Cloud + +--- + +## ๐Ÿ“‚ Project Structure + +``` +. +โ”œโ”€โ”€ app.py # Flask application with weather API integration +โ”œโ”€โ”€ CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud +โ”œโ”€โ”€ Dockerfile # Dockerfile to containerize the Flask app +โ”œโ”€โ”€ requirements.txt # Python dependencies +โ”œโ”€โ”€ templates/ # HTML templates (auto-generated by Dockerfile) +โ””โ”€โ”€ README.md # Documentation +``` + +--- + +## โš™๏ธ Prerequisites + +Before running or deploying the app, ensure you have: + +- [Python 3.9+](https://www.python.org/downloads/) +- [Docker](https://docs.docker.com/get-docker/) +- [Ghaymah CLI (`gy`)](https://docs.ghaymah.io) installed and configured +- An [OpenWeatherMap API key](https://home.openweathermap.org/api_keys) + +--- + +## ๐Ÿ› ๏ธ Local Development + +1. Clone this repository: + + ```bash + git clone https://github.com/your-username/weather-app.git + cd weather-app + ``` + +2. Create and activate a virtual environment: + + ```bash + python -m venv venv + source venv/bin/activate # Linux/Mac + venv\Scripts\activate # Windows + ``` + +3. Install dependencies: + + ```bash + pip install -r requirements.txt + ``` + +4. Run the app: + + ```bash + python app.py + ``` + +5. Open your browser at: + ๐Ÿ‘‰ http://127.0.0.1:5000 + +--- + +## ๐Ÿณ Running with Docker + +1. Build the Docker image: + + ```bash + docker build -t weather-app:1 . + ``` + +2. Run the container: + + ```bash + docker run -p 5000:5000 weather-app:1 + ``` + +3. Visit the app at: + ๐Ÿ‘‰ http://localhost:5000 + +--- + +## โ˜๏ธ CI/CD Deployment to Ghaymah Cloud + +This project includes a **CICDpipeline.sh** script that: +- Builds and tags Docker images +- Pushes them to Docker Hub +- Creates a `.ghaymah.json` config +- Deploys the app to **Ghaymah Cloud** + +### ๐Ÿ”ง Steps + +1. Make the script executable: + + ```bash + chmod +x CICDpipeline.sh + ``` + +2. Run the deployment script: + + ```bash + ./CICDpipeline.sh + ``` + +3. Follow the prompts: + - Enter your **Ghaymah Project Name** + - Enter your **App Name** + +4. If Ghaymah CLI is installed, the app will be deployed automatically. + +โœ… Your app will be accessible at: + +``` +https://.hosted.ghaymah.systems +``` + +--- + +## ๐Ÿงพ Environment Variables + +Set your OpenWeatherMap API key (recommended): + +```bash +export API_KEY="your_openweathermap_api_key" +``` + +If not set, a demo key will be used (limited requests). + +--- + +## ๐Ÿ“Š Health Check + +Check if the app is running: + +```bash +curl http://localhost:5000/health +``` + +Example response: + +```json +{ + "status": "healthy", + "timestamp": "2025-09-25T14:30:00" +} +``` + +--- + +