{"id":19143305,"url":"https://github.com/devenes/cloudformation-containerization-bookstore-api","last_synced_at":"2026-04-11T18:02:34.583Z","repository":{"id":107130750,"uuid":"484842833","full_name":"devenes/cloudformation-containerization-bookstore-api","owner":"devenes","description":"Bookstore Web API Application aims to create a bookstore web service using Docker to have the understanding to dockerization of an application. The application code is to be deployed as a RESTful web service with Flask using Dockerfile and Docker Compose on AWS Elastic Compute Cloud (EC2) Instance using AWS CloudFormation Service.","archived":false,"fork":false,"pushed_at":"2022-04-25T21:38:12.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T19:26:59.519Z","etag":null,"topics":["api","aws","aws-elastic-compute-cloud","cloudformation","docker","docker-compose","dockerization","ec2","flask","mysql","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/devenes.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":"2022-04-23T19:51:18.000Z","updated_at":"2024-03-17T18:45:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"d07ed018-96f5-4ca0-8ceb-ed9101141b29","html_url":"https://github.com/devenes/cloudformation-containerization-bookstore-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devenes/cloudformation-containerization-bookstore-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devenes%2Fcloudformation-containerization-bookstore-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devenes%2Fcloudformation-containerization-bookstore-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devenes%2Fcloudformation-containerization-bookstore-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devenes%2Fcloudformation-containerization-bookstore-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devenes","download_url":"https://codeload.github.com/devenes/cloudformation-containerization-bookstore-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devenes%2Fcloudformation-containerization-bookstore-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260447652,"owners_count":23010543,"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":["api","aws","aws-elastic-compute-cloud","cloudformation","docker","docker-compose","dockerization","ec2","flask","mysql","python"],"created_at":"2024-11-09T07:30:25.087Z","updated_at":"2026-04-11T18:02:34.515Z","avatar_url":"https://github.com/devenes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerization of Bookstore Web API Python Flask with MySQL using Docker Compose and CloudFormation\n\n## Description\n\nBookstore Web API Application aims to create a bookstore web service using Docker to have the understanding to dockerization of an application. The application code is to be deployed as a RESTful web service with Flask using Dockerfile and Docker Compose on AWS Elastic Compute Cloud (EC2) Instance using AWS CloudFormation Service.\n\n## Problem Statement\n\n![Project](bookstore-api.png)\n\n- Your team has started working on a project to create a `Bookstore` Application as Web Service.\n\n- Software Developers in your team have already developed first version of `Bookstore` application. They have designed a database to keep book records with following fields.\n\n  - book_id: unique identifier for books, type is numeric.\n\n  - title: title of the book, type is string.\n\n  - author: author of the book. type is string.\n\n  - is_sold: book availability status, type is boolean.\n\n- Your teammates also created the RESTful web service as given in [Bookstore API](./bookstore-api.py) using Python Flask Framework. Below table shows how the HTTP methods are designed to affect the given resources identified by URIs.\n\n| HTTP Method | Action                              | Example                                                                                             |\n| ----------- | ----------------------------------- | --------------------------------------------------------------------------------------------------- |\n| `GET`       | Obtain information about a resource | http://[ec2-hostname]/books (retrieves list of all books)                                           |\n| `GET`       | Obtain information about a resource | http://[ec2-hostname]/books/123 (retrieves book with id=123)                                        |\n| `POST`      | Create a new resource               | http://[ec2-hostname]/books (creates a new book, from data provided with the request)               |\n| `PUT`       | Update a resource                   | http://[ec2-hostname]/books/123 (updates the book with id=123, from data provided with the request) |\n| `DELETE`    | Delete a resource                   | http://[ec2-hostname]/books/123 (delete the book with id=123)                                       |\n\n- You are, as a cloud engineer, requested to deploy the app in the development environment on a Docker Machine on AWS EC2 Instance using AWS CloudFormation Service to showcase your project. To do that you need to;\n\n  - Get the app code from GitHub repo of your team.\n\n  - Create docker image using the `Dockerfile`.\n\n  - Deploy the app using `docker compose`. To do so;\n\n    - Create a database service using MySQL.\n\n    - Configure the app service to run on `port 80`.\n\n    - Use a custom network for the services.\n\n- In the development environment, you can configure your CloudFormation template using the followings,\n\n  - The application stack should be created with new AWS resources.\n\n  - The application should run on Amazon Linux 2 EC2 Instance\n\n  - EC2 Instance type can be configured as `t2.micro`.\n\n  - Instance launched by CloudFormation should be tagged `Web Server of StackName`\n\n  - The Web Application should be accessible via web browser from anywhere.\n\n  - The Application files should be downloaded from Github repo and deployed on EC2 Instance using user data script within CloudFormation template.\n\n  - Bookstore Web API URL should be given as output by CloudFormation Service, after the stack created.\n\n## Expected Outcome\n\n### At the end of the project, following topics are to be covered;\n\n- MySQL Database Configuration\n\n- Bash scripting\n\n- Docker Images\n\n- Docker Compose\n\n- AWS EC2 Service\n\n- AWS Security Group Configuration\n\n- AWS CloudFormation Service\n\n- AWS CloudFormation Template Design\n\n- Git \u0026 Github for Version Control System\n\n### At the end of the project, you will be able to;\n\n- configure connection to the `MySQL` database.\n\n- build a Docker images.\n\n- configure Docker Compose to run Python Flask app.\n\n- improve bash scripting skills using `user data` section in CloudFormation to install and setup web application on EC2 Instance\n\n- configure AWS EC2 Instance and Security Groups.\n\n- configure CloudFormation template to use AWS Resources.\n\n- use AWS CloudFormation Service to launch stacks.\n\n- use git commands (push, pull, commit, add etc.) and Github as Version Control System.\n\n- run the web application on AWS EC2 instance using the GitHub repo as codebase.\n\n## Notes\n\n- To showcase your projects REST functions, use `curl` command for each HTTP methods namely, `GET`, `POST`, `PUT`, `DELETE`.\n\n## Resources\n\n- [Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer)\n\n- [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevenes%2Fcloudformation-containerization-bookstore-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevenes%2Fcloudformation-containerization-bookstore-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevenes%2Fcloudformation-containerization-bookstore-api/lists"}