{"id":19315212,"url":"https://github.com/niv-devops/weather-webapp","last_synced_at":"2026-04-13T06:02:08.632Z","repository":{"id":261783541,"uuid":"864905359","full_name":"niv-devops/weather-webapp","owner":"niv-devops","description":"DevOps: CI/CD pipeline for Python weather web app","archived":false,"fork":false,"pushed_at":"2024-12-03T10:37:23.000Z","size":48406,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T03:41:35.739Z","etag":null,"topics":["ansible","aws","devops","docker","elk-stack","kubernetes","prometheus","python","terraform","webapp"],"latest_commit_sha":null,"homepage":"https://niv-devops.github.io/weather-webapp/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niv-devops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-29T13:37:18.000Z","updated_at":"2024-12-03T10:37:27.000Z","dependencies_parsed_at":"2024-11-08T12:33:52.128Z","dependency_job_id":"a2b96dea-d64a-48ce-aab1-621a7f478dcd","html_url":"https://github.com/niv-devops/weather-webapp","commit_stats":null,"previous_names":["niv-devops/weather-webapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niv-devops%2Fweather-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niv-devops%2Fweather-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niv-devops%2Fweather-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niv-devops%2Fweather-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niv-devops","download_url":"https://codeload.github.com/niv-devops/weather-webapp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240416930,"owners_count":19797906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","aws","devops","docker","elk-stack","kubernetes","prometheus","python","terraform","webapp"],"created_at":"2024-11-10T01:05:17.913Z","updated_at":"2026-04-13T06:02:08.615Z","avatar_url":"https://github.com/niv-devops.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather WebApp\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./images/thunderCast.png\" alt=\"DevOps Exercises\" width=\"300\"\u003e\n\u003c/div\u003e\n\n\nA simple weather web app built with Python, using Flask, Nginx and Gunicorn.\nCI/CD pipeline done with GitHub Actions.\n\n## Table of Contents\n\n- [Features](#features)\n- [Technologies Used](#technologies-used)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Running Tests](#running-tests)\n- [Docker](#docker)\n- [Continuous Integration](#continuous-integration)\n\n## Features\n\n- Check current weather conditions for any location.\n- Built using Flask and Gunicorn for efficient handling of requests.\n- Dockerized for easy deployment.\n- Integrated security checks with Snyk and Gitleaks.\n- Automated tests with pytest and linting with flake8 and pylint.\n\n## Technologies Used\n\n- Python 3.12\n- Flask\n- Gunicorn\n- Docker\n- GitHub Actions for CI/CD\n- Snyk for security scanning\n- Gitleaks for secret detection\n- [API: open-meteo](https://api.open-meteo.com/v1/forecast)\n\n## Installation\n\nTo run this project locally, follow these steps:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/niv-devops/weather-webapp.git\n   cd weather-webapp\n   ```\n\n2. Active env, install dependencies, run application\n\n   ```bash\n   cd existing_repo\n   . .venv/bin/activate\n   pip install --break-system-packages --user \u003cdependency\u003e\n   python3 weather.py\n   ```\n\n3. Install dependencies:\n\n   ```bash\n   python -m pip install --upgrade pip\n   pip install -r requirements.txt\n   ```\n   \n4. Set up environment variables as needed (e.g., API keys for weather services).\n\n## Usage\n\nTo run the application locally, use the following command:\n\n```bash\ngunicorn --bind 0.0.0.0:5000 wsgi:app\n```\n\nYou can then access the application at `http://localhost:5000`.\n\n## Running Tests\n\nTo run the tests, execute:\n\n```bash\npytest tests/\n```\n\n## Docker\n\nTo build and run the application using Docker, follow these steps:\n\n1. Build the Docker image:\n   ```bash\n   docker build -t weather-webapp .\n   ```\n\n2. Run the Docker container:\n   ```bash\n   docker run -p 5000:5000 weather-webapp\n   ```\n\n## Continuous Integration\n\nThis project uses GitHub Actions for CI/CD. The pipeline includes:\n\n- Running tests and linting on every push and pull request.\n- Building and pushing Docker images to GitHub Container Registry.\n- Scanning for vulnerabilities using Snyk and Gitleaks.\n\n### Pipeline Steps\n\n1. **Test**: Runs all tests and checks for code quality.\n2. **Build**: Builds the Docker image and pushes it to the GitHub Container Registry.\n3. **Monitor**: Sends notifications to a Slack channel regarding the pipeline status.\n\n***\n\n# GitLab additional options\n\n- [ ] [Edit README.md using makeareadme.com](https://www.makeareadme.com/)\n\n- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files\n- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:\n\n```\ncd existing_repo\ngit remote add origin http://3.122.61.221/niv/webapp.git\ngit branch -M main\ngit push -uf origin main\n```\n\n- [ ] [Set up project integrations](http://3.122.61.221/niv/webapp/-/settings/integrations)\n\n- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)\n- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)\n- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)\n- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)\n- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)\n\n- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)\n- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)\n- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)\n- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)\n- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniv-devops%2Fweather-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniv-devops%2Fweather-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniv-devops%2Fweather-webapp/lists"}