https://github.com/avinashdogiparthi/patientmanagementsystem
This comprehensive Patient Management System is a production-grade, microservices-based application demonstrating real-world implementation of modern backend engineering concepts. The system is modular, scalable, and cloud-deployable, covering the complete development lifecycle from local setup to deployment on AWS using Infrastructure as Code.
https://github.com/avinashdogiparthi/patientmanagementsystem
api apigateway authentication-authorization aws database devops dockerization grpc integration-testing kafka restful-api spring-boot
Last synced: 3 months ago
JSON representation
This comprehensive Patient Management System is a production-grade, microservices-based application demonstrating real-world implementation of modern backend engineering concepts. The system is modular, scalable, and cloud-deployable, covering the complete development lifecycle from local setup to deployment on AWS using Infrastructure as Code.
- Host: GitHub
- URL: https://github.com/avinashdogiparthi/patientmanagementsystem
- Owner: AvinashDogiparthi
- Created: 2025-05-24T17:18:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-30T01:33:56.000Z (about 1 year ago)
- Last Synced: 2025-05-30T02:34:05.619Z (about 1 year ago)
- Topics: api, apigateway, authentication-authorization, aws, database, devops, dockerization, grpc, integration-testing, kafka, restful-api, spring-boot
- Language: Java
- Homepage:
- Size: 164 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Patient Service
---
## Environment Variables
```
JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005;
SPRING_DATASOURCE_PASSWORD=password;
SPRING_DATASOURCE_URL=jdbc:postgresql://patient-service-db:5432/db;
SPRING_DATASOURCE_USERNAME=admin_user;
SPRING_JPA_HIBERNATE_DDL_AUTO=update;
SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka:9092;
SPRING_SQL_INIT_MODE=always
```
# Billing Service
---
## gRPC Setup
Add the following to the `` section
```
io.grpc
grpc-netty-shaded
1.69.0
io.grpc
grpc-protobuf
1.69.0
io.grpc
grpc-stub
1.69.0
org.apache.tomcat
annotations-api
6.0.53
provided
net.devh
grpc-spring-boot-starter
3.1.0.RELEASE
com.google.protobuf
protobuf-java
4.29.1
```
Replace the `` section with the following
```
kr.motd.maven
os-maven-plugin
1.7.0
org.springframework.boot
spring-boot-maven-plugin
org.xolstice.maven.plugins
protobuf-maven-plugin
0.6.1
com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}
grpc-java
io.grpc:protoc-gen-grpc-java:1.68.1:exe:${os.detected.classifier}
compile
compile-custom
```
# Patient Service
---
## Environment Variables (complete list)
```bash
BILLING_SERVICE_ADDRESS=billing-service;
BILLING_SERVICE_GRPC_PORT=9005;
JAVA_TOOL_OPTIONS=-agentlib:jdwp\=transport\=dt_socket,server\=y,suspend\=n,address\=*:5005;
SPRING_DATASOURCE_PASSWORD=password;
SPRING_DATASOURCE_URL=jdbc:postgresql://patient-service-db:5432/db;
SPRING_DATASOURCE_USERNAME=admin_user;
SPRING_JPA_HIBERNATE_DDL_AUTO=update;
SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka:9092;
SPRING_SQL_INIT_MODE=always
```
## gRPC Setup
Add the following to the `` section
```
io.grpc
grpc-netty-shaded
1.69.0
io.grpc
grpc-protobuf
1.69.0
io.grpc
grpc-stub
1.69.0
org.apache.tomcat
annotations-api
6.0.53
provided
net.devh
grpc-spring-boot-starter
3.1.0.RELEASE
com.google.protobuf
protobuf-java
4.29.1
```
Replace the `` section with the following
```
kr.motd.maven
os-maven-plugin
1.7.0
org.springframework.boot
spring-boot-maven-plugin
org.xolstice.maven.plugins
protobuf-maven-plugin
0.6.1
com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}
grpc-java
io.grpc:protoc-gen-grpc-java:1.68.1:exe:${os.detected.classifier}
compile
compile-custom
```
## Kafka Container
Copy/paste this line into the environment variables when running the container in intellij
```
KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094;KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER;KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093;KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT;KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094;KAFKA_CFG_NODE_ID=0;KAFKA_CFG_PROCESS_ROLES=controller,broker
```
## Kafka Producer Setup (Patient Service)
Add the following to `application.properties`
```
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
```
# Notification Service
---
## Environment Vars
```
SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka:9092
```
## Protobuf/Kafka
Dependencies (add in addition to whats there)
```
org.springframework.kafka
spring-kafka
3.3.0
com.google.protobuf
protobuf-java
4.29.1
```
Update the build section in pom.xml with the following
```
kr.motd.maven
os-maven-plugin
1.7.0
org.springframework.boot
spring-boot-maven-plugin
org.xolstice.maven.plugins
protobuf-maven-plugin
0.6.1
com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}
grpc-java
io.grpc:protoc-gen-grpc-java:1.68.1:exe:${os.detected.classifier}
compile
compile-custom
```
# Auth service
Dependencies (add in addition to whats there)
```
org.springframework.boot
spring-boot-starter-security
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
org.springframework.security
spring-security-test
test
io.jsonwebtoken
jjwt-api
0.12.6
io.jsonwebtoken
jjwt-impl
0.12.6
runtime
io.jsonwebtoken
jjwt-jackson
0.12.6
runtime
org.postgresql
postgresql
runtime
org.springdoc
springdoc-openapi-starter-webmvc-ui
2.6.0
com.h2database
h2
```
## Environment Variables
```
SPRING_DATASOURCE_PASSWORD=password
SPRING_DATASOURCE_URL=jdbc:postgresql://auth-service-db:5432/db
SPRING_DATASOURCE_USERNAME=admin_user
SPRING_JPA_HIBERNATE_DDL_AUTO=update
SPRING_SQL_INIT_MODE=always
```
## Data.sql
```sql
-- Ensure the 'users' table exists
CREATE TABLE IF NOT EXISTS "users" (
id UUID PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
role VARCHAR(50) NOT NULL
);
-- Insert the user if no existing user with the same id or email exists
INSERT INTO "users" (id, email, password, role)
SELECT '223e4567-e89b-12d3-a456-426614174006', 'testuser@test.com',
'$2b$12$7hoRZfJrRKD2nIm2vHLs7OBETy.LWenXXMLKf99W8M4PUwO6KB7fu', 'ADMIN'
WHERE NOT EXISTS (
SELECT 1
FROM "users"
WHERE id = '223e4567-e89b-12d3-a456-426614174006'
OR email = 'testuser@test.com'
);
```
# Auth Service DB
## Environment Variables
```
POSTGRES_DB=db;POSTGRES_PASSWORD=password;POSTGRES_USER=admin_user
```
# API Documentation
You can verify the available API specifications using **Swagger UI** at the following link:
๐ [http://localhost:4000/v3/api-docs](http://localhost:4000/v3/api-docs)
---
### How to view API specifications in Swagger format
1. Open the above link in your browser.
2. Copy the entire JSON content displayed in the console.
3. Go to [https://editor.swagger.io/](https://editor.swagger.io/).
4. Paste the copied JSON content into the editor.
5. You will see each API specification rendered beautifully in Swagger format, making it easier to read, explore, and interact with the APIs.
---
## ๐ JWT Token Decoder
To inspect or debug a **JWT (JSON Web Token)**, you can use the official JWT decoding tool provided at [jwt.io](https://jwt.io/).
### ๐งช How to Decode a JWT Token
1. Go to [https://jwt.io/](https://jwt.io/)
2. Paste your **JWT token** in the left-hand "Encoded" section.
3. The decoded **header**, **payload**, and **signature** will be shown on the right-hand side.
4. Optionally, verify the signature by providing the secret or public key in the "Verify Signature" section.
### ๐งพ JWT Structure
A JWT typically has three parts, separated by dots (`.`):