{"id":30269892,"url":"https://github.com/koachcode/cd0157","last_synced_at":"2025-09-01T21:45:07.738Z","repository":{"id":111013655,"uuid":"547819160","full_name":"koachcode/cd0157","owner":"koachcode","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-09T17:14:43.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T02:36:50.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/koachcode.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-08T10:59:36.000Z","updated_at":"2022-10-08T11:01:26.000Z","dependencies_parsed_at":"2023-04-19T14:31:14.946Z","dependency_job_id":null,"html_url":"https://github.com/koachcode/cd0157","commit_stats":null,"previous_names":["codewithmike01/cd0157","koachcode/cd0157"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koachcode/cd0157","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koachcode%2Fcd0157","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koachcode%2Fcd0157/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koachcode%2Fcd0157/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koachcode%2Fcd0157/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koachcode","download_url":"https://codeload.github.com/koachcode/cd0157/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koachcode%2Fcd0157/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273197146,"owners_count":25062230,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-16T02:19:34.484Z","updated_at":"2025-09-01T21:45:07.719Z","avatar_url":"https://github.com/koachcode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploying a Flask API\n\nThis is the project starter repo for the course Server Deployment, Containerization, and Testing.\n\nIn this project you will containerize and deploy a Flask API to a Kubernetes cluster using Docker, AWS EKS, CodePipeline, and CodeBuild.\n\nThe Flask app that will be used for this project consists of a simple API with three endpoints:\n\n- `GET '/'`: This is a simple health check, which returns the response 'Healthy'. \n- `POST '/auth'`: This takes a email and password as json arguments and returns a JWT based on a custom secret.\n- `GET '/contents'`: This requires a valid JWT, and returns the un-encrpyted contents of that token. \n\nThe app relies on a secret set as the environment variable `JWT_SECRET` to produce a JWT. The built-in Flask server is adequate for local development, but not production, so you will be using the production-ready [Gunicorn](https://gunicorn.org/) server when deploying the app.\n\n\n\n## Prerequisites\n\n* Docker Desktop - Installation instructions for all OSes can be found \u003ca href=\"https://docs.docker.com/install/\" target=\"_blank\"\u003ehere\u003c/a\u003e.\n* Git: \u003ca href=\"https://git-scm.com/downloads\" target=\"_blank\"\u003eDownload and install Git\u003c/a\u003e for your system. \n* Code editor: You can \u003ca href=\"https://code.visualstudio.com/download\" target=\"_blank\"\u003edownload and install VS code\u003c/a\u003e here.\n* AWS Account\n* Python version between 3.7 and 3.9. Check the current version using:\n```bash\n#  Mac/Linux/Windows \npython --version\n```\nYou can download a specific release version from \u003ca href=\"https://www.python.org/downloads/\" target=\"_blank\"\u003ehere\u003c/a\u003e.\n\n* Python package manager - PIP 19.x or higher. PIP is already installed in Python 3 \u003e=3.4 downloaded from python.org . However, you can upgrade to a specific version, say 20.2.3, using the command:\n```bash\n#  Mac/Linux/Windows Check the current version\npip --version\n# Mac/Linux\npip install --upgrade pip==20.2.3\n# Windows\npython -m pip install --upgrade pip==20.2.3\n```\n* Terminal\n   * Mac/Linux users can use the default terminal.\n   * Windows users can use either the GitBash terminal or WSL. \n* Command line utilities:\n  * AWS CLI installed and configured using the `aws configure` command. Another important configuration is the region. Do not use the us-east-1 because the cluster creation may fails mostly in us-east-1. Let's change the default region to:\n  ```bash\n  aws configure set region us-east-2  \n  ```\n  Ensure to create all your resources in a single region. \n  * EKSCTL installed in your system. Follow the instructions [available here](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html#installing-eksctl) or \u003ca href=\"https://eksctl.io/introduction/#installation\" target=\"_blank\"\u003ehere\u003c/a\u003e to download and install `eksctl` utility. \n  * The KUBECTL installed in your system. Installation instructions for kubectl can be found \u003ca href=\"https://kubernetes.io/docs/tasks/tools/install-kubectl/\" target=\"_blank\"\u003ehere\u003c/a\u003e. \n\n\n## Initial setup\n\n1. Fork the \u003ca href=\"https://github.com/udacity/cd0157-Server-Deployment-and-Containerization\" target=\"_blank\"\u003eServer and Deployment Containerization Github repo\u003c/a\u003e to your Github account.\n1. Locally clone your forked version to begin working on the project.\n```bash\ngit clone https://github.com/SudKul/cd0157-Server-Deployment-and-Containerization.git\ncd cd0157-Server-Deployment-and-Containerization/\n```\n1. These are the files relevant for the current project:\n```bash\n.\n├── Dockerfile \n├── README.md\n├── aws-auth-patch.yml #ToDo\n├── buildspec.yml      #ToDo\n├── ci-cd-codepipeline.cfn.yml #ToDo\n├── iam-role-policy.json  #ToDo\n├── main.py\n├── requirements.txt\n├── simple_jwt_api.yml\n├── test_main.py  #ToDo\n└── trust.json     #ToDo \n```\n\n     \n## Project Steps\n\nCompleting the project involves several steps:\n\n1. Write a Dockerfile for a simple Flask API\n2. Build and test the container locally\n3. Create an EKS cluster\n4. Store a secret using AWS Parameter Store\n5. Create a CodePipeline pipeline triggered by GitHub checkins\n6. Create a CodeBuild stage which will build, test, and deploy your code\n\nFor more detail about each of these steps, see the project lesson.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoachcode%2Fcd0157","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoachcode%2Fcd0157","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoachcode%2Fcd0157/lists"}