{"id":18151042,"url":"https://github.com/anindyadas2001/petcaremanager","last_synced_at":"2025-04-06T23:28:39.581Z","repository":{"id":258269281,"uuid":"860582978","full_name":"anindyadas2001/PetCareManager","owner":"anindyadas2001","description":"My First DevOps Project","archived":false,"fork":false,"pushed_at":"2024-10-16T13:16:49.000Z","size":1923,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T11:08:03.940Z","etag":null,"topics":["ansible","app","aws","beginner-friendly","database","devops","terraform"],"latest_commit_sha":null,"homepage":"","language":null,"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/anindyadas2001.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":"2024-09-20T17:56:53.000Z","updated_at":"2024-10-16T13:16:53.000Z","dependencies_parsed_at":"2024-10-18T08:17:06.693Z","dependency_job_id":null,"html_url":"https://github.com/anindyadas2001/PetCareManager","commit_stats":null,"previous_names":["anindyadas2001/petcaremanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anindyadas2001%2FPetCareManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anindyadas2001%2FPetCareManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anindyadas2001%2FPetCareManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anindyadas2001%2FPetCareManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anindyadas2001","download_url":"https://codeload.github.com/anindyadas2001/PetCareManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247568503,"owners_count":20959749,"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":["ansible","app","aws","beginner-friendly","database","devops","terraform"],"created_at":"2024-11-02T01:06:13.521Z","updated_at":"2025-04-06T23:28:39.559Z","avatar_url":"https://github.com/anindyadas2001.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐾 Spring PetCare Manager ![94.12%](https://progress-bar.xyz/94)\n\n\n\u003c!---\n\n![Java](https://img.shields.io/badge/Java-17-blue.svg)\n![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5.4-brightgreen.svg)\n![Draw.io](https://img.shields.io/badge/Draw.io-Diagramming%20Tool-FF73DB)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-13-blue)\n![Tomcat](https://img.shields.io/badge/Tomcat-9.0-yellowgreen)\n![Github](https://img.shields.io/badge/Github-Source%20Control%20Management-blue.svg)\n![JUnit](https://img.shields.io/badge/JUnit-Testing%20Extension-orange)\n![Jenkins](https://img.shields.io/badge/Jenkins-CI/CD-orange)\n![SonarQube](https://img.shields.io/badge/SonarQube-Code%20Quality-critical)\n![Ansible](https://img.shields.io/badge/Ansible-IaC-red)\n![Terraform](https://img.shields.io/badge/Terraform-IaC%20Tool-red)\n![AWS](https://img.shields.io/badge/AWS-Cloud%20Deployment-ff9900)\n![S3](https://img.shields.io/badge/S3-App%20Rollback%20Storage-yellow)\n---\u003e\n\n\n\u003ctable style=\"border: 5px solid black; padding: 10px;\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n\n![Java](https://img.shields.io/badge/Java-17-blue.svg)\n![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5.4-brightgreen.svg)\n![Draw.io](https://img.shields.io/badge/Draw.io-Diagramming%20Tool-FF73DB)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-13-blue)\n![Tomcat](https://img.shields.io/badge/Tomcat-9.0-yellowgreen)\n![Github](https://img.shields.io/badge/Github-Source%20Control%20Management-blue.svg)\n![JUnit](https://img.shields.io/badge/JUnit-Testing%20Extension-orange)\n![Jenkins](https://img.shields.io/badge/Jenkins-CI/CD-orange)\n![SonarQube](https://img.shields.io/badge/SonarQube-Code%20Quality-critical)\n![Ansible](https://img.shields.io/badge/Ansible-IaC-red)\n![Terraform](https://img.shields.io/badge/Terraform-IaC%20Tool-red)\n![AWS](https://img.shields.io/badge/AWS-Cloud%20Deployment-ff9900)\n![S3](https://img.shields.io/badge/S3-App%20Rollback%20Storage-yellow)\n\n    \n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n\n\n**Spring PetCare Manager** improves the [\u003e\u003eReferance App\u003c\u003c](https://github.com/spring-projects/spring-petclinic) which was a application built with Spring Boot, designed for managing pet care services like appointments, veterinarian schedules, and pet records. It adds a robust DevOps Pipeline to make the app deliverable.\n```\nThe project is in development. You are open to contributing to it.\n```\n\n## ➡️ Further Developments are made in this repository:\n***👉 Here, the app is deployed using a seamlessly automated DevOps pipeline :***\n\u003e - ReDesigned the Project Object Model\n\u003e - Replaced H2 Engine with PostGre SQL database\n\u003e - Made a Jenkins pipeline containing JUnit and SonarQube extensions.\n\u003e - Developed a enterprise with Dev and QA Tomcat enviromnents with a stage gate.\n\n\u003e - Future prospects of implementing IaC with Teraform creating and Ansible for configuring resources/services in the AWS architechure, which was designed with security measures in mind\n\n\n## 🎯 **Features \u0026 Technologies**\n- [x] **Development**: Java App made using Spring Boot (Manage Pet Owners, Pets, Veterinarians, Appointments, and Services).\n- [x] **Database**: PostgreSQL for handling interconnected entities with relational data models.\n- [x] **Source Control Management**: Github\n- [X] **Continuous Integration**: Using Jenkins\n    - [x] JUnit Exteension for Testing\n    - [x] SonarQube for Continuous monitoring, analysis and Report visualisation.\n    - [ ] Storing the generated Report.\n- [x] **Testing and Analysis**: Extensions such as JUnit \u0026 SonarQube.\n- [x] **Continuous Delivery**: Using IaC with AWS Cloud to Deliver the App\n    - [x] Cloud Native: AWS Architecture:\n        - [x] VPC : Single Region\n        - [x] Subnets: \n            - [x] EC2 instances for hosting\n            - [x] RDS for PostgreSQL frequeltly used data\n            - [x] S3 for App Rollback storage\n            - [x] IAM for Policy management\n    - [ ] IaC: Automate provisioning of AWS infrastructure and environment setup\n        - [ ] Ansible\n        - [ ] Teraform\n- [x] **Linux Shell \u0026 Networking**: Basic Linux and networking configurations for server management.\n\n## 🌐 **System Architecture** made using draw.io\n- [x] `CI/CD Pipeline - NON IaC`\n![CI+AWS without IAC](https://github.com/anindyadas2001/PetCareManager/blob/eb5e3104a1ec8278ec3ba815a46fb5a0b6e03696/SDLC/cicdnoiac.png)\n\n\u003c!--\n- [ ] Infrastructure as Code\n--\u003e\n\n## 🚀 **Java App Modification Instructions**\n\n### 1️⃣ **Clone the Refferance Repository**\n```bash\nhttps://github.com/anindyadas2001/PetCareManager.git\ncd PetCareManager\n```\n## Extract the \n```\nextractdir.zip\n```\n\n### 2️⃣ **Database Configuration (PostgreSQL)**\n- Navigate to the `src/main/resources` directory and locate the `application.properties` file.\n- Update it with your PostgreSQL credentials:\n```properties\nspring.datasource.url=jdbc:postgresql://localhost:5432/petclinic\nspring.datasource.username=your_username\nspring.datasource.password=your_password\nspring.datasource.driver-class-name=org.postgresql.Driver\nspring.jpa.hibernate.ddl-auto=update\n```\n\u003e [!Note]\n\u003e Ensure PostgreSQL is installed and running on your local/remote server before proceeding.\n\n\n### 3️⃣ **Build and Run the Application**\n- To build and run the application, execute the following Maven command:\n```bash\n./mvnw package\njava -jar target/*.jar\n```\n\u003e [!Tip]\n\u003e You can access the running application at `http://localhost:8080` after successful execution.\n\n\n### 4️⃣ **Deploy on Tomcat**\n- Package the application into a WAR file and deploy it on Tomcat:\n```bash\n./mvnw clean package\n```\n- Deploy the WAR file on the Apache Tomcat web server:\n    - Place the `war` file inside the `Tomcat/webapps` directory.\n    - Start/restart the Tomcat server.\n\n\u003e [!Important]\n\u003e You can monitor the deployment at `http://\u003cyour-server-ip\u003e:8080/\u003cyour-app-context\u003e`\n- Place the `war` file in the Tomcat `webapps/` directory.\n\n\n### 5️⃣ **CI/CD with Jenkins**\n- Create a new Jenkins pipeline project.\n- Connect your GitHub repository and configure automatic triggers.\n- Define build steps for packaging and deploying the WAR file.\n```groovy\npipeline {\n    agent any\n    stages {\n        stage('Build') {\n            steps {\n                sh './mvnw clean package'\n            }\n        }\n        stage('Test') {\n            steps {\n                sh './mvnw test'\n            }\n        }\n        stage('Deploy') {\n            steps {\n                // Deployment steps (Tomcat, AWS, etc.)\n            }\n        }\n    }\n}\n```\n\u003e [!Note]\n\u003e Use Jenkins to schedule automated builds on every commit.\n\n\u003c!--\n### 6️⃣ **Infrastructure Setup with Ansible**\n- Provision the necessary AWS infrastructure using Ansible:\n    - EC2: To host the web application.\n    - RDS: To manage the PostgreSQL database.\n    - S3: For storing static files or backups.\n- Run the Ansible playbook for infrastructure provisioning:\n```bash\nansible-playbook -i inventory setup.yml\n```\n\u003e [!Note]\n\u003e Ensure your AWS credentials are configured and the necessary IAM roles are in place before running the playbook.\n--\u003e\n\n### 6️⃣ **Monitoring and Code Quality**\n- Use SonarQube to ensure code quality and reduce technical debt.\n- Set up SonarQube by running the following command:\n```bash\nsonar-scanner -Dsonar.projectKey=PetCareManager\n\n```\n\n## **AWS Services Modifications:**\n- IAM Role for S3 Access:\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"s3:PutObject\",\n      \"Resource\": \"arn:aws:s3:::your-bucket-name/*\"\n    }\n  ]\n}\n```\n\n- Create a Backup Script:\n``` bash\n#!/bin/bash\n\n# Variables\nAPP_DIR=\"/path/to/your/java/app\"  # The directory where your Java app is located\nBACKUP_FILE=\"/tmp/java-app-backup-$(date +%Y%m%d%H%M%S).tar.gz\"\nS3_BUCKET=\"your-bucket-name\"\nS3_PATH=\"s3://${S3_BUCKET}/backups/java-app-$(date +%Y%m%d%H%M%S).tar.gz\"\n\n# Create a tar.gz backup of the Java app directory\ntar -czvf $BACKUP_FILE -C $APP_DIR .\n\n# Upload the backup to S3\naws s3 cp $BACKUP_FILE $S3_PATH\n\n# Optionally, remove the local backup file\nrm -f $BACKUP_FILE\n\necho \"Backup complete. File uploaded to $S3_PATH\"\n```\n\u003e Automate the Script Execution:\n    \u003e create a cron job `$ crontab -e`\n    \u003e Add a cron entry to run the script at a specific time ``\n  \n- Connecting Tomcat to EBS:\n    - [Java app to EBS](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.html)\n    - [Elastic Beanstalk \u0026 Tomcat](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-tomcat-platform.html)\n    \n- In Private EC2 instance to recognise the data inside RDS run the following commands:\n```bash\n# To Update all dependencies\nsudo yum update \u0026\u0026 upgrade\n\n# To install PostgreSQL\nsudo yum install postgresql\n\n# To cheak version\npsql --version\n\n#Connect to the RDS database\nsudo su\npsql -h \u003cRDS_endpoint\u003e -U \u003cUSERNAME\u003e -d \u003cDATABASE_NAME\u003e -p 5432 --sslmode=verify-full\n\n#Verify and show data base:\nSELECT * FROM pg_database\n\n```\n\n### 📋 **Project Management**\n- Track progress, database schema, and tasks using Notion Dashboard.\n\n### 🤝 **Contributions**\n`You are welcome contributions! Please feel free to:`\n- Open an issue for any bugs or suggestions.\n- Submit a pull request to improve the application.\n\n### 📝 **Project Highlights**\n- Built a scalable Spring Boot web application and deployed it on Apache Tomcat.\n- Automated build, test, and deployment using a Jenkins CI/CD pipeline and SonarQube for code quality checks.\n- Provisioned and managed AWS infrastructure using Ansible with a focus on Infrastructure as Code (IaC).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanindyadas2001%2Fpetcaremanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanindyadas2001%2Fpetcaremanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanindyadas2001%2Fpetcaremanager/lists"}