{"id":19924429,"url":"https://github.com/akshitmittal20/monitoringapp_python","last_synced_at":"2025-11-26T04:02:35.914Z","repository":{"id":216439188,"uuid":"741295402","full_name":"akshitmittal20/MonitoringApp_Python","owner":"akshitmittal20","description":"This repository contains the source code for the MonitoringApp_Python, a system monitoring application built with Python, Flask, and Docker. This application provides a web interface to monitor CPU and memory usage.","archived":false,"fork":false,"pushed_at":"2024-07-25T03:53:11.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T00:25:49.702Z","etag":null,"topics":["cicd","flask","gcp","python","scripting"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akshitmittal20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-10T05:11:19.000Z","updated_at":"2024-07-25T03:56:20.000Z","dependencies_parsed_at":"2024-07-25T04:46:06.053Z","dependency_job_id":"6f06ed35-e929-432a-92a6-95fafbd4653d","html_url":"https://github.com/akshitmittal20/MonitoringApp_Python","commit_stats":null,"previous_names":["akshitmittal20/monitoringapp_python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshitmittal20%2FMonitoringApp_Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshitmittal20%2FMonitoringApp_Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshitmittal20%2FMonitoringApp_Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshitmittal20%2FMonitoringApp_Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshitmittal20","download_url":"https://codeload.github.com/akshitmittal20/MonitoringApp_Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241351500,"owners_count":19948685,"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":["cicd","flask","gcp","python","scripting"],"created_at":"2024-11-12T22:17:24.172Z","updated_at":"2025-11-26T04:02:35.909Z","avatar_url":"https://github.com/akshitmittal20.png","language":"HTML","readme":"# MonitoringApp_Python\n\nThis repository contains the source code for the MonitoringApp_Python, a system monitoring application built with Python, Flask, and Docker. This application provides a web interface to monitor CPU and memory usage.\n\n\u003cimg width=\"1265\" alt=\"image\" src=\"https://github.com/akshitmittal20/MonitoringApp_Python/assets/63283989/b7c0bbd7-ae13-4615-a720-648588d060c3\"\u003e\n\u003cimg width=\"556\" alt=\"Screenshot 2025-03-31 at 10 26 36 PM\" src=\"https://github.com/user-attachments/assets/88a30936-0649-4ef7-85d8-161f86d28180\" /\u003e\n\n\n## Table of Contents\n- [Prerequisites](#prerequisites)\n- [Setup Instructions](#setup-instructions)\n- [Running the Application](#running-the-application)\n- [Creating Docker Image and Container](#creating-docker-image-and-container)\n- [Deploying on Google Cloud Platform](#deploying-on-google-cloud-platform)\n- [Incrementing Git Tag](#incrementing-git-tag)\n- [Folder Structure](#folder-structure)\n\n## Prerequisites\n- Python 3.9 or later\n- Docker\n- Git\n- Google Cloud Platform account\n- SSH key setup for GitHub\n\n## Setup Instructions\n\n1. **SSH Connection to GitHub**:\n   - Ensure you have created an SSH connection from GitHub to your local system. Follow GitHub's guide [here](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) if needed.\n\n2. **Clone the Repository**:\n   ```bash\n   git clone git@github.com:yourusername/MonitoringApp_Python.git\n   cd MonitoringApp_Python\n   ```\n\n3. **Create and Install Requirements**:\n   - Create a `requirements.txt` file with the necessary dependencies.\n   - Install the requirements:\n     ```bash\n     pip install -r requirements.txt\n     ```\n\n4. **Create Frontend HTML Template**:\n   - Create the `index.html` file in the `templates` folder.\n\n5. **Create the app.py File**:\n   - Develop the `app.py` file which includes the Flask application code.\n\n## Running the Application\n\nTo run the application locally:\n```bash\npython app.py\n```\nThe application should be accessible at `http://localhost:5000`.\n\n## Creating Docker Image and Container\n\n1. **Create Dockerfile**:\n   - Create a `Dockerfile` with the necessary instructions to build the image.\n\n2. **Build Docker Image**:\n   ```bash\n   docker build -t monitoringapp_python .\n   ```\n\n3. **Run Docker Container**:\n   ```bash\n   docker run -p 5000:5000 monitoringapp_python\n   ```\nTest the container by accessing `http://localhost:5000`.\n\n## Deploying on Google Cloud Platform\n\n1. **Create a Service Account**:\n   - Create a service account in GCP and set up the necessary AMI IDs.\n\n2. **Set Up GitHub Actions for CI/CD**:\n   - Create a `.github/workflows/gcp.yml` file for the Docker build and push workflow.\n\n3. **Push Docker Image to Google Artifact Registry**:\n   - Use the GitHub Actions workflow to automate the process.\n\n## Incrementing Git Tag\n\n1. **Create the `git_update.sh` Script**:\n   - This script increments the git tag for each commit and uses it for the Docker image versioning.\n\n2. **Run the Script**:\n   ```bash\n   ./scripts/git_update.sh -v [major|minor|patch]\n   ```\n\n## Folder Structure\n\n```\nMonitoringApp_Python/\n├── .github/\n│   └── workflows/\n│       └── gcp.yml\n├── scripts/\n│   └── git_update.sh\n├── templates/\n│   └── index.html\n├── Dockerfile\n├── app.py\n├── requirements.txt\n└── README.md\n```\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n\n- Created a ssh connection form github to your local system\n- Clone the empty repository for the application\n- Create the Requirements.txt file\n- Install all the Requirements file\n- Create the frontend html template file.\n- Create the app.py file.\n- Run the application on the localhost via given port\n- After succesfull running the app, create the docker file to create for the image of application\n- Run the docker image to create the container. Test the container by running the application\n- Now, Create the service account in GCP and set up AMI ids\n- Create Github Actions Docker build and Push workflow for deploying the application on the Google Container Repository\n- Use github action to push docker to Google Artifact Registry\n- Increment git tag for each commit and use it for docker image.\n\n\n# Development Completed\n- System Monitoring web App\n  \n\u003cimg width=\"1265\" alt=\"image\" src=\"https://github.com/akshitmittal20/MonitoringApp_Python/assets/63283989/b7c0bbd7-ae13-4615-a720-648588d060c3\"\u003e\n\n- Workflow in Github Action\n  \n\u003cimg width=\"1268\" alt=\"image\" src=\"https://github.com/akshitmittal20/MonitoringApp_Python/assets/63283989/33e1da45-8479-4b15-8e7e-850d896be876\"\u003e\n\n- Google Container Registery\n  \n\u003cimg width=\"1224\" alt=\"image\" src=\"https://github.com/akshitmittal20/MonitoringApp_Python/assets/63283989/aa50cac4-be79-448f-8790-d86c578da874\"\u003e\n\n- Google Artifact Repository\n  \n\u003cimg width=\"1228\" alt=\"image\" src=\"https://github.com/akshitmittal20/MonitoringApp_Python/assets/63283989/fa263c19-8266-43f7-8cdd-8cd98e4fe317\"\u003e\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitmittal20%2Fmonitoringapp_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshitmittal20%2Fmonitoringapp_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitmittal20%2Fmonitoringapp_python/lists"}