{"id":16725313,"url":"https://github.com/veerendra2/flask-app","last_synced_at":"2026-04-17T17:31:08.280Z","repository":{"id":102104968,"uuid":"207975110","full_name":"veerendra2/flask-app","owner":"veerendra2","description":"A simple flask app, converts HEX color representation to RGB","archived":false,"fork":false,"pushed_at":"2020-02-12T13:55:04.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T15:14:41.397Z","etag":null,"topics":["docker","flask","hpa","kubernetes","minikube","python-flask-application"],"latest_commit_sha":null,"homepage":"https://veerendra2.github.io/hex2RGB-flask-app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veerendra2.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":"2019-09-12T05:55:09.000Z","updated_at":"2023-03-10T11:09:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"43e362a2-9f2f-4a7c-8640-8b8e743534a3","html_url":"https://github.com/veerendra2/flask-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/veerendra2/flask-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veerendra2%2Fflask-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veerendra2%2Fflask-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veerendra2%2Fflask-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veerendra2%2Fflask-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veerendra2","download_url":"https://codeload.github.com/veerendra2/flask-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veerendra2%2Fflask-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31938590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","flask","hpa","kubernetes","minikube","python-flask-application"],"created_at":"2024-10-12T22:48:47.419Z","updated_at":"2026-04-17T17:31:08.036Z","avatar_url":"https://github.com/veerendra2.png","language":"Python","readme":"# HEX to RGB Flask App\n## Introduction\nA simple application exposes an endpoint that takes a HEX color and returns its RGB representation, implemented in Python `Flask` framework. \n\n##### `POST`\n\n`curl -X POST -H 'Content-Type: application/json' -d '{\"code\": \"\u003cHEX color code\u003e\"}' \u003capp-ulr\u003e`\n\n## Deployment\n\n```\n+--------------------------------------------------------+\n|                                                        |\n|                                                        |\n|                  +------------------------------+      |\n|                  |                              |      |\n|        +---------------+                        |      |\n|        | mod_wsgi|     |   APACHE WEB SERVER    +\u003c---------------------- Requests\n|        ++--------------+                        |      |\n|         |        |                              |      |\n|         |        +------------------------------+      |\n|         |                                              |\n|         |                                              |\n|         |        +------------------------------+      |\n|         |        |                              |      |\n|         +-------\u003e+       Python Flask App       |      |\n|                  |                              |      |\n|                  +------------------------------+      |\n|                                                        |\n|                                                        |\n+--------------------------------------------------------+\n```\n\n## Containerization\n```\nQUAY_USER=\"\"\nQUAY_PASS=\"\"\n\nsudo docker build -t color .\nsudo docker tag color:latest quay.io/$QUAY_USER/color:latest\nsudo docker push quay.io/$QUAY_USER/color:latest\n```\n\nKubernetes deployment manifest files to deploy on K8s cluster.\n```\n$ kubectl create -f app-deployment.yaml\n$ kubectl create -f app-hpa.yaml\n```\n\n* `app-deployment.yaml` deploys app pod and creates K8s `service` with type as `NodePort`.\n* `app-hpa.yaml` creates [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) for scalability \n\n**NOTE**: In order to work `HPA`, the K8s cluster should have `metric-server` installed\n\n## Deploy on `minikube`\n\u003e Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a Virtual Machine (VM) on your laptop for users looking to try out Kubernetes or develop with it day-to-day.\n \n\nGet the `minikube` cluster info like below and run `test.py`\n```\n## Make sure minikube up and running\n$ minikube ip\n192.168.39.228\n\n## Copy the cluster node IP\n\n## Make app running in minikube cluster\n$ kubectl get svc colors -o wide\nNAME     TYPE       CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE   SELECTOR\ncolors   NodePort   10.111.37.3   \u003cnone\u003e        80:32438/TCP   93m   name=color\n\n## Copy Nodeport\n\n## Run test script to test it\n$ python test.py 192.168.39.228 32438\n[+] Running Positive Test Cases\n[*] PAYLOAD =\u003e {\"code\": \"#C0C0C0\"}, RESPONSE=\u003e {\"result\": \"(192, 192, 192)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#808080\"}, RESPONSE=\u003e {\"result\": \"(128, 128, 128)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#000000\"}, RESPONSE=\u003e {\"result\": \"(0, 0, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#FF0000\"}, RESPONSE=\u003e {\"result\": \"(255, 0, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#800000\"}, RESPONSE=\u003e {\"result\": \"(128, 0, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#FFFF00\"}, RESPONSE=\u003e {\"result\": \"(255, 255, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#808000\"}, RESPONSE=\u003e {\"result\": \"(128, 128, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#00FF00\"}, RESPONSE=\u003e {\"result\": \"(0, 255, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#008000\"}, RESPONSE=\u003e {\"result\": \"(0, 128, 0)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#00fFFF\"}, RESPONSE=\u003e {\"result\": \"(0, 255, 255)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#008080\"}, RESPONSE=\u003e {\"result\": \"(0, 128, 128)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#0000FF\"}, RESPONSE=\u003e {\"result\": \"(0, 0, 255)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#000080\"}, RESPONSE=\u003e {\"result\": \"(0, 0, 128)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#fF00FF\"}, RESPONSE=\u003e {\"result\": \"(255, 0, 255)\"}, RESPOSE CODE=\u003e 200\n[*] PAYLOAD =\u003e {\"code\": \"#800080\"}, RESPONSE=\u003e {\"result\": \"(128, 0, 128)\"}, RESPOSE CODE=\u003e 200\n[+] Running Negetive Test Cases\n[.] PAYLOAD =\u003e {\"code\": \"#GGGGGGG\"}, RESPONSE=\u003e {\"result\": \"Invalid POST data/HEX color code\"}, RESPOSE CODE=\u003e 400\n[.] PAYLOAD =\u003e {\"code\": \"#12121212FF\"}, RESPONSE=\u003e {\"result\": \"Invalid POST data/HEX color code\"}, RESPOSE CODE=\u003e 400\n[.] PAYLOAD =\u003e {\"code\": \"$0000FF\"}, RESPONSE=\u003e {\"result\": \"Invalid POST data/HEX color code\"}, RESPOSE CODE=\u003e 400\n[.] PAYLOAD =\u003e {\"code\": \"#$A0000\"}, RESPONSE=\u003e {\"result\": \"Invalid POST data/HEX color code\"}, RESPOSE CODE=\u003e 400\n[.] PAYLOAD =\u003e {\"code\": \"#AAAA7\"}, RESPONSE=\u003e {\"result\": \"Invalid POST data/HEX color code\"}, RESPOSE CODE=\u003e 400\n[.] PAYLOAD =\u003e {\"code\": \"AAAAFF\"}, RESPONSE=\u003e {\"result\": \"Invalid POST data/HEX color code\"}, RESPOSE CODE=\u003e 400\n\n```\n\n## Metrics\nAdded basic instrumentation to get application metrics with help of `prometheus-flask-exporter` which are exportable to [Prometheus](https://prometheus.io/). This module by default exposes the metrics on application port `/metrics` endpoint.\n\n## Project Tree\n```\n.\n├── app\n│   ├── colors_app\n│   │   └── __init__.py\n│   └── colors_app.wsgi\n├── app-deployment.yaml\n├── app-hpa.yaml\n├── build.sh\n├── cadvisor-daemonset.yml\n├── Dockerfile\n├── httpd.conf\n├── LICENSE\n├── metrics_list.txt\n├── README.md\n└── test.py\n\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveerendra2%2Fflask-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveerendra2%2Fflask-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveerendra2%2Fflask-app/lists"}