{"id":31622843,"url":"https://github.com/pratham2402/patient-mgmt-microservices","last_synced_at":"2026-05-06T03:34:00.487Z","repository":{"id":315017404,"uuid":"1057744490","full_name":"pratham2402/patient-mgmt-microservices","owner":"pratham2402","description":"Production-ready Patient Management System built with Java Spring Boot microservices, PostgreSQL, Kafka, REST \u0026 gRPC. Features secure authentication, load balancing, API gateways, integration tests, and AWS deployment using LocalStack and Infrastructure as Code.","archived":false,"fork":false,"pushed_at":"2025-09-16T13:44:27.000Z","size":246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T17:49:21.605Z","etag":null,"topics":["api-gateway","authentication","docker","grpc","hacktoberfest","integration-testing","java","kafka","microservices","spring-boot"],"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/pratham2402.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T06:40:42.000Z","updated_at":"2025-09-16T13:44:48.000Z","dependencies_parsed_at":"2025-09-16T08:37:13.593Z","dependency_job_id":"4915496b-f2bc-4abf-add7-5d78e8d5f2d8","html_url":"https://github.com/pratham2402/patient-mgmt-microservices","commit_stats":null,"previous_names":["pratham2402/patient-mgmt-microservices"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pratham2402/patient-mgmt-microservices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratham2402%2Fpatient-mgmt-microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratham2402%2Fpatient-mgmt-microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratham2402%2Fpatient-mgmt-microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratham2402%2Fpatient-mgmt-microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratham2402","download_url":"https://codeload.github.com/pratham2402/patient-mgmt-microservices/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratham2402%2Fpatient-mgmt-microservices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api-gateway","authentication","docker","grpc","hacktoberfest","integration-testing","java","kafka","microservices","spring-boot"],"created_at":"2025-10-06T17:36:01.017Z","updated_at":"2026-05-06T03:34:00.480Z","avatar_url":"https://github.com/pratham2402.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Project Banner](docs/Banner.png)\n[![forthebadge](https://forthebadge.com/images/badges/made-with-java.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/docker-container.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/build-with-spring-boot.svg)](https://forthebadge.com)\n[![forthebadge](https://forthebadge.com/images/badges/60-percent-of-the-time-works-every-time.svg)](https://forthebadge.com)\n# Patient Management System – Microservices Architecture\n\nA production-ready, cloud-native Patient Management System built with Java, Spring Boot, Docker, and AWS. This project demonstrates a robust microservices architecture with secure authentication, real-time and event-driven communication, and infrastructure as code for seamless deployment.\n\n---\n\n## Table of Contents\n- [Architecture Overview](#architecture-overview)\n- [Tech Stack](#tech-stack)\n- [Microservices](#microservices)\n- [API Gateway \u0026 Load Balancing](#api-gateway--load-balancing)\n- [Event-Driven \u0026 Real-Time Communication](#event-driven--real-time-communication)\n- [Authentication \u0026 Security](#authentication--security)\n- [Local Development \u0026 Setup](#local-development--setup)\n- [Testing](#testing)\n- [Deployment (AWS \u0026 LocalStack)](#deployment-aws--localstack)\n- [Sample API Usage](#sample-api-usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Architecture Overview\n\n![Spring Boot Microservices Architecture](docs/SpringBootArchitecture.png)\n\n- **Microservices**: Each domain (auth, patient, billing, analytics) is a separate Spring Boot service, containerized with Docker.\n- **API Gateway**: Central entry point for all client requests, with load balancing and routing.\n- **Databases**: Each service uses its own Postgres database for data isolation and scalability.\n- **Event-Driven**: Kafka is used for asynchronous communication and event propagation between services.\n- **Real-Time**: REST and gRPC are used for synchronous and high-performance inter-service communication.\n- **Security**: JWT Bearer tokens secure APIs and user authentication.\n- **Infrastructure as Code**: AWS resources are provisioned using CDK and tested locally with LocalStack.\n\n---\n\n## Tech Stack\n- **Languages**: Java 17+\n- **Frameworks**: Spring Boot, Spring Security, Spring Data JPA\n- **Databases**: PostgreSQL\n- **Messaging**: Apache Kafka\n- **API**: REST (Spring MVC), gRPC (protobuf)\n- **Containerization**: Docker\n- **API Gateway**: Spring Cloud Gateway\n- **Testing**: JUnit, Integration Tests\n- **Infrastructure**: AWS CDK, LocalStack\n\n---\n\n## Microservices\n\n- **auth-service**: Handles user registration, login, JWT issuance, and validation.\n- **patient-service**: Manages patient records (CRUD), emits events on changes.\n- **billing-service**: Manages billing accounts, listens to patient events, and processes billing.\n- **analytics-service**: Consumes events for analytics and reporting.\n- **api-gateway**: Routes and secures all external API traffic.\n\nEach service has its own Dockerfile and can be built and run independently.\n\n---\n\n## API Gateway \u0026 Load Balancing\n- All client requests go through the API Gateway.\n- The gateway handles routing, load balancing, and authentication (JWT validation).\n- Configuration is in `api-gateway/src/main/resources/application.yml`.\n\n---\n\n## Event-Driven \u0026 Real-Time Communication\n\n![gRPC Architecture](docs/gRPC_Architecture.png)\n\n- **Kafka**: Used for publishing and subscribing to domain events (e.g., patient created/updated).\n- **gRPC**: Used for high-performance, real-time service-to-service calls (see proto files in each service).\n- **REST**: Standard synchronous communication for most APIs.\n\n---\n\n## Authentication \u0026 Security\n- **JWT Bearer Tokens**: Secure all APIs. Obtain a token via the auth-service and include it in the `Authorization: Bearer \u003ctoken\u003e` header.\n- **Spring Security**: Used in all services to enforce authentication and authorization.\n\n---\n\n## Local Development \u0026 Setup\n\n### Prerequisites\n- Java 17+\n- Docker \u0026 Docker Compose\n- Maven\n\n### Build \u0026 Run All Services\n```sh\n# Build all services\nmvn clean package -DskipTests\n\n# Build Docker images for each service\ncd auth-service \u0026\u0026 docker build -t auth-service .\ncd ../patient-service \u0026\u0026 docker build -t patient-service .\ncd ../billing-service \u0026\u0026 docker build -t billing-service .\ncd ../analytics-service \u0026\u0026 docker build -t analytics-service .\ncd ../api-gateway \u0026\u0026 docker build -t api-gateway .\n\n# (Optional) Use docker-compose.yml if provided\n# docker-compose up --build\n```\n\n### Running Infrastructure Locally\n- Use [LocalStack](https://github.com/localstack/localstack) to emulate AWS services locally.\n- Deploy infrastructure with:\n```sh\ncd infrastructure\n./localstack-deploy.sh\n```\n\n---\n\n## Testing\n- **Unit \u0026 Integration Tests**: Run with Maven:\n```sh\nmvn test\n```\n- **Integration tests** are in the `integration-tests/` module.\n- **Sample HTTP/gRPC requests**: See `api-requests/` and `grpc-requests/` folders for ready-to-use request samples.\n\n---\n\n## Deployment (AWS \u0026 LocalStack)\n- Infrastructure as code is managed in the `infrastructure/` directory using AWS CDK.\n- To deploy to AWS, configure your AWS credentials and run the CDK deployment scripts.\n- For local testing, use LocalStack as described above.\n\n---\n\n## Sample API Usage\n\n### Authenticate \u0026 Get JWT\n```http\nPOST /auth/login HTTP/1.1\nContent-Type: application/json\n{\n  \"username\": \"user\",\n  \"password\": \"pass\"\n}\n```\n\n### Create Patient (with JWT)\n```http\nPOST /patients HTTP/1.1\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n{\n  \"name\": \"John Doe\",\n  \"dob\": \"1990-01-01\",\n  ...\n}\n```\n\n### gRPC Example\n- See proto files in each service's `src/main/proto/` directory.\n- Use the provided `.proto` files and `grpc-requests/` samples.\n\n---\n\n## Contributing\nPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n---\n\n## License\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratham2402%2Fpatient-mgmt-microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratham2402%2Fpatient-mgmt-microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratham2402%2Fpatient-mgmt-microservices/lists"}