{"id":17780712,"url":"https://github.com/arivan-amin/Clean-Architecture-Microservices","last_synced_at":"2025-03-15T22:31:19.935Z","repository":{"id":252359389,"uuid":"839505049","full_name":"arivan-amin/Clean-Architecture-Microservices","owner":"arivan-amin","description":"Modern Microservices Back-End application using Java and Spring Boot,  serves as a template to demonstrate the implementation of microservices using modern and best practices in development.","archived":false,"fork":false,"pushed_at":"2025-03-10T20:10:09.000Z","size":4413,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T20:33:30.853Z","etag":null,"topics":["api","api-gateway","eureka","grafana","healthcare","java","junit","kafka","keycloak","liquibase","loki","lombok","microservices","mockito","mongodb","mysql","prometheus","spring-cloud","swagger-ui","tempo"],"latest_commit_sha":null,"homepage":"","language":"Java","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/arivan-amin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":"Audit-Service/pom.xml","citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-07T18:41:18.000Z","updated_at":"2025-03-10T20:09:02.000Z","dependencies_parsed_at":"2024-09-12T15:36:27.777Z","dependency_job_id":"a2b97e4e-d03d-4f4f-b9f2-35a09ca4bdff","html_url":"https://github.com/arivan-amin/Clean-Architecture-Microservices","commit_stats":{"total_commits":165,"total_committers":2,"mean_commits":82.5,"dds":0.0060606060606061,"last_synced_commit":"e4f4dcfa6bb658c6ddd73dcf6ffcc260c68af6b1"},"previous_names":["arivan-amin/healthcare-management-microservices","arivan-amin/healthcare-clean-microservices","arivan-amin/clean-architecture-microservices"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arivan-amin%2FClean-Architecture-Microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arivan-amin%2FClean-Architecture-Microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arivan-amin%2FClean-Architecture-Microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arivan-amin%2FClean-Architecture-Microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arivan-amin","download_url":"https://codeload.github.com/arivan-amin/Clean-Architecture-Microservices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801600,"owners_count":20350105,"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","api-gateway","eureka","grafana","healthcare","java","junit","kafka","keycloak","liquibase","loki","lombok","microservices","mockito","mongodb","mysql","prometheus","spring-cloud","swagger-ui","tempo"],"created_at":"2024-10-27T03:03:37.965Z","updated_at":"2025-03-15T22:31:14.927Z","avatar_url":"https://github.com/arivan-amin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Healthcare Management System\n\n## Overview\n\nThis project is a **Healthcare Management System** developed as a **Microservices Architecture**\nusing **Java**.\nThe system is designed to manage various healthcare-related operations such as patient registration,\nappointment scheduling, medical records management, billing, and more. It serves as a practice\nproject to demonstrate the implementation of microservices using modern **Java** technologies.\n\n## Technologies Used\n\n- **Java 21**: Core programming language.\n- **Spring Boot**: Framework for building microservices.\n- **Spring Cloud**: For managing microservices, service discovery, and load balancing.\n- **Eureka**: Service registry for microservices.\n- **Feign Client**: For inter-service communication.\n- **MySQL**: Relational database for persistent storage.\n- **MongoDB**: NoSQL database for storing data.\n- **Docker**: Containerization of microservices.\n- **Kafka**: Message broker for event-driven communication between services.\n- **Swagger/OpenAPI**: API documentation and testing.\n- **JUnit \u0026 Mockito**: Testing frameworks for unit and integration testing.\n- **Flyway**: Database migration tools.\n- **Lombok**: Reducing boilerplate code.\n- **Keycloak**: For authentication and authorization management.\n- **Grafana**: For observability and monitoring services through dashboards.\n- **loki**: For centralized logging.\n- **tempo**: For distributed tracing.\n\n## Grafana Monitoring Screenshots\n\n### Services monitoring dashboard main section\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-1.png)\n\n### Graphs for total requests response time and response time per endpoint\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-2.png)\n\n### Graphs for total calls made to Jpa repository\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-4.png)\n\n### Graphs for percentage of HTTP request status codes, 2xx, 3xx, 4xx, and 5xx\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-6.png)\n\n### Graphs for graph on .95 and .99 percentile histogram to identify bottlenecks\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-7.png)\n\n### Graphs for JVM performance, threads, GC, logs and IO\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-8.png)\n\n### Graphs for JVM memory usage, heap, non heap, and more\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-9.png)\n\n### Graphs for Hikari connection pool performance\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-10.png)\n\n### Graphs for Tomcat sessions, send and receive and threads\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-11.png)\n\n### Graphs for log events and their volume per minute\n\n![image](https://raw.githubusercontent.com/arivan-amin/Healthcare-Management-Microservices/master/Docs/Grafana/Grafana-Dashboard-12.png)\n\n## Installation\n\n### Prerequisites\n\n- **Java 21**\n- **Maven**\n- **Docker**\n- **Docker Compose**\n\n### Steps to Run the Project\n\n1. ### Clone the repository:\n\n    ```bash\n    git clone https://github.com/arivan-amin/Healthcare-Management-Microservices.git\n    cd Healthcare-Management-Microservices\n    ```\n\n2. ### Build and install the Core Module because all modules depend on it:\n\n    ```bash\n    cd Core\n    mvn clean install\n    cd ..\n    ```\n3. ### Build the project, and it will load the images to your local docker repository using JIB:\n\n    ```bash\n    mvn clean package\n    ```\n\n4. ### Set Eureka username and password environment variables and docker host ip:\n    - on **Linux**: add the below variables to your **.bashrc** file and reload or reboot\n    ```bash\n    export EUREKA_USER=admin\n    export EUREKA_PASSWORD=admin\n    ```\n    - on **Windows**: run the below commands\n    ```bash\n    set EUREKA_USER=admin\n    set EUREKA_PASSWORD=admin\n    ```\n5. ### Run the services using Docker Compose:\n    ```bash\n    docker compose up -d\n    ```\n\n6. ### Access the services:\n    - **API Gateway:** `http://localhost:8080`\n    - **Eureka Dashboard:** `http://localhost:8080/eureka/web`\n    - **Swagger UI:** `http://localhost:8080/swagger-ui.html`\n    - **Grafana:** `http://localhost:3000/dashboards`\n\n7. ### Accessing the Grafana Dashboards for monitoring Spring Boot and MySQL\n    - Open your browser and navigate to **Grafana** at: http://localhost:3000/dashboards\n    - In the **Grafana** dashboards page, click on the **New** icon on the top right side and select\n      **Import**.\n    - Choose both json file located at: **project-root/docker/grafana/**\n    - Complete the import process for both files.\n    - Now you should have 2 dashboards to monitor Spring Boot, MySQL.\n\n## Testing\n- Unit and integration tests are available for each microservice.\n- Run the tests using Maven:\n\n    ```bash\n    mvn test\n    ```\n\n## Microservices\nThe system is divided into several microservices, each responsible for a specific domain:\n\n- **API Gateway**: Serves as the single entry point for all client requests, routing them to the\n  appropriate microservices. It handles request aggregation, load balancing, and provides a\n  centralized point for managing cross-cutting concerns such as authentication and logging.\n- **Appointment Service**: Manages scheduling and rescheduling of patient appointments. It interacts\n  with the Doctor and Patient services to ensure availability and updates the system with the latest\n  appointment data.\n- **Audit Service**: Provides centralized logging and auditing for all actions within the system. It\n  records critical events, such as user activities and service interactions, to ensure transparency\n  and compliance.\n- **Core Service**: Provides foundational services and shared functionality used across other\n  microservices. This could include utility functions, common data access layers, or basic service\n  management features.\n- **Discovery Service**: Implements service discovery mechanisms, allowing microservices to find and\n  communicate with each other dynamically. It maintains a registry of available services and their\n  locations.\n- **Doctor Service**: Manages information related to doctors, including their profiles, specialties,\n  schedules, and availability. It supports operations related to doctor management and integrates\n  with other services for scheduling and patient care.\n- **Notification Service**: Sends notifications and alerts to users, such as appointment reminders,\n  billing notifications, or system updates. It handles different communication channels like email,\n  SMS, or in-app notifications.\n- **Patient Service**: Manages patient information, including personal details, medical history, and\n  contact information. It supports patient registration, updates, and interactions with other\n  services such as appointments and billing.\n- **Security Service**: Ensures the security of the system by managing authentication,\n  authorization, and encryption. It handles user access controls, secure communication, and\n  protection of sensitive data.\n\n## Contributing\n**Contributions are welcome!** Please fork the repository and submit a pull request for any\nimprovements\nor bug fixes.\n\n## License\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for more\ndetails.\n\n## Contact\nFor any questions or inquiries, please contact:\n- **Name: Arivan Amin**\n- **Email: arivanamin@gmail.com**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farivan-amin%2FClean-Architecture-Microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farivan-amin%2FClean-Architecture-Microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farivan-amin%2FClean-Architecture-Microservices/lists"}