{"id":26274411,"url":"https://github.com/xanderbilla/aws-devops-to-do-api","last_synced_at":"2025-03-14T09:19:31.189Z","repository":{"id":274267929,"uuid":"920806759","full_name":"xanderbilla/AWS-DevOps-To-Do-API","owner":"xanderbilla","description":"A mobile application (to do list) backend that needs to be deployed in the cloud. ","archived":false,"fork":false,"pushed_at":"2025-02-23T02:33:02.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T03:23:19.596Z","etag":null,"topics":["aws","ci-cd","devops","docker","iac"],"latest_commit_sha":null,"homepage":"","language":"HCL","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/xanderbilla.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":"2025-01-22T20:02:08.000Z","updated_at":"2025-02-23T02:33:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"e20dea83-2e3a-4810-a112-7b5a4a38a59a","html_url":"https://github.com/xanderbilla/AWS-DevOps-To-Do-API","commit_stats":null,"previous_names":["xanderbilla/projectapi"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanderbilla%2FAWS-DevOps-To-Do-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanderbilla%2FAWS-DevOps-To-Do-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanderbilla%2FAWS-DevOps-To-Do-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanderbilla%2FAWS-DevOps-To-Do-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xanderbilla","download_url":"https://codeload.github.com/xanderbilla/AWS-DevOps-To-Do-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551249,"owners_count":20309300,"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":["aws","ci-cd","devops","docker","iac"],"created_at":"2025-03-14T09:19:30.441Z","updated_at":"2025-03-14T09:19:31.167Z","avatar_url":"https://github.com/xanderbilla.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS DevOps To-Do API \n\nA scalable and fully automated API application for managing to-do lists, built with Java Spring Boot and deployed on AWS using DevOps best practices.\n\n## API Reference\n\n**Base URL:** [https://d3iklkly37bv64.cloudfront.net](https://d3iklkly37bv64.cloudfront.net)\n\n| Endpoint                  | Method | Description                  |\n|--------------------------|--------|------------------------------|\n| `/health`                 | GET    | Checks application health    |\n| `/tasks`                  | GET    | Retrieves all tasks          |\n| `/tasks`                  | POST   | Creates a new task           |\n| `/tasks/{id}`             | GET    | Retrieves a task by ID       |\n| `/tasks/{id}`             | PUT    | Updates a task by ID         |\n| `/search?status={status}` | GET    | Searches tasks by status     |\n\n## Environment Variables\n\nEnsure the following environment variable is set before running the application:\n\n- `MONGO_URI`: MongoDB connection string\n\n## Deployment Workflow\n\n### CI/CD Automation\n\n- **GitHub Actions** automates the build, test, and deployment process.\n- **Docker** ensures environment consistency across development and production.\n- **Terraform** provisions the cloud infrastructure.\n\n### AWS Cloud Services\n\n- **ECR**: Stores Docker images securely.\n- **EC2**: Hosts and runs the application.\n- **Secrets Manager**: Manages sensitive credentials.\n- **Systems Manager (SSM)**: Automates container updates when a new image is pushed.\n- **ALB (Application Load Balancer)**: Distributes traffic efficiently and integrates with CloudFront.\n- **CloudFront**: Improves performance through caching and SSL/TLS security.\n- **CloudWatch**: Monitors application logs and infrastructure events.\n\n## Architecture Overview\n\n![workflow](https://xanderbilla.s3.ap-south-1.amazonaws.com/projects/projectapi-flow.png)\n\n### Infrastructure Details\n\n- **VPC** with multiple availability zones and subnets.\n- **EC2 Instances** configured with necessary roles for ECR, SSM, and Secrets Manager access.\n- **CloudWatch Event Rules** trigger updates for new Docker images.\n- **ALB** balances traffic across EC2 instances.\n- **CloudFront** optimizes and secures content delivery.\n- **Terraform** manages infrastructure as code (IaC), storing state in an **S3 bucket** with **DynamoDB** for state locking.\n\n## Setting Up in Your AWS Environment\n\nBefore deployment, update the S3 bucket name in:\n\n- [`infrastructure/main.tf`](https://github.com/xanderbilla/projectapi/blob/main/infrastructure/main.tf)\n- [`deploy.yml`](https://github.com/xanderbilla/projectapi/blob/main/.github/workflows/deploy.yml) (lines 34 and 35)\n\n### Deployment Steps:\n\n1. **Fork the repository**: [Click here](https://github.com/xanderbilla/projectapi/fork)\n2. **Set up GitHub Actions secrets**:\n\n   | Variable Name           | Description                      |\n   |-------------------------|----------------------------------|\n   | `AWS_ACCESS_KEY_ID`     | AWS access key ID               |\n   | `AWS_SECRET_ACCESS_KEY` | AWS secret access key           |\n\n3. **Run the GitHub Actions workflow manually** to set up infrastructure and deploy the application.\n\n\u003e Subsequent changes to the repository will trigger automatic deployment of the updated application.\n\n## Example Usage\n\n```javascript\nimport axios from \"axios\";\n\nconst getTaskById = async (id) =\u003e {\n  try {\n    const response = await axios.get(`/tasks/${id}`);\n    console.log(\"Task:\", response.data);\n  } catch (error) {\n    console.error(\"Error fetching the task:\", error);\n  }\n};\n\n// Example usage\ngetTaskById(1);\n```\n\n## Running Locally with Docker\n\nClone the repository:\n\n```bash\ngit clone https://github.com/xanderbilla/projectapi\n```\n\nNavigate to the project directory:\n\n```bash\ncd projectapi\n```\n\nBuild and run the application in a Docker container:\n\n```bash\ndocker build -t projectapi .\ndocker run -d -p 8080:8080 -e MONGO_URI=\"your-mongodb-uri\" --name projectapi projectapi\n```\n\n## Documentation and References\n\n- [GitHub Actions Docs](https://docs.github.com/actions)\n- [AWS Documentation](https://docs.aws.amazon.com/)\n- [Terraform Documentation](https://developer.hashicorp.com/terraform/docs)\n- [Docker Documentation](https://docs.docker.com)\n\n## Author\n\n[Vikas Singh](https://www.github.com/xanderbilla)\n\n[More About Me](https://xanderbilla.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanderbilla%2Faws-devops-to-do-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanderbilla%2Faws-devops-to-do-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanderbilla%2Faws-devops-to-do-api/lists"}