Link youtube:
- How to run Postgre Admin with Docker: https://www.youtube.com/watch?v=qECVC6t_2mU
- How to run grpc with Java: https://youtu.be/cMzernb2Q3k?si=e1OorvQBZKmeiK_Y&t=953
mvn clean compile
Go to common-proto/target/generated-sources/protobuf/grpc-java and common-proto/target/generated-sources/protobuf/java => Mark directory as Generated Sources Root.
Run docker-compose file, or use Postgre Admin in your local machine.
docker compose up
brew install grpcurl
brew install grpcui
grpcurl -plaintext localhost:9090 list
grpcui -plaintext localhost:9090
grpcurl -plaintext -d '{
"first_name": "John",
"last_name": "Thomas",
"email": "john.thomas@example.com",
"phone": "123-456-7890",
"address": "123 Main St"
}' localhost:9090 com.codewiz.patient.PatientService/RegisterPatient
grpcurl -plaintext -d '{
"patient_id": 1
}' localhost:9090 com.codewiz.patient.PatientService/GetPatientDetails
grpcurl -plaintext localhost:9091 list
grpcurl -d '{
"first_name": "Tim",
"last_name": "Jacob",
"email": "tim.jacob@example.com",
"phone": "123-456-7890",
"specialty": "Cardiology",
"centre_name": "Health Centre",
"location": "New York"
}' -plaintext localhost:9091 com.codewiz.doctor.DoctorService/RegisterDoctor
grpcurl -plaintext -d '{
"doctor_id": 1
}' localhost:9091 com.codewiz.doctor.DoctorService/GetDoctorDetails
grpcurl -plaintext localhost:9092 list
grpcurl -plaintext -d '{
"doctor_id": 1
}' localhost:9092 com.codewiz.appointment.AppointmentService/GetAppointmentAvailability
grpcurl -plaintext -d '{
"doctor_id": 1,
"patient_id": 1,
"appointment_date": "2025-02-15",
"appointment_time": "10:00",
"reason": "Routine check-up"
}' localhost:9092 com.codewiz.appointment.AppointmentService/BookAppointment
grpcurl -d @ -plaintext localhost:9090 com.codewiz.patient.PatientService/StreamPatients <<EOM
{
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"phone": "1234567890",
"address": "123 Main St"
}
{
"first_name": "Jane",
"last_name": "Smith",
"email": "jane.smith@example.com",
"phone": "0987654321",
"address": "456 Elm St"
}
EOM
grpcurl -d @ -plaintext localhost:9091 com.codewiz.doctor.DoctorService/Chat <<EOM
{
"message": "Hello, Doctor!",
"from": "Patient",
"to": "Doctor",
"timestamp": "2023-10-01T12:00:00Z"
}
{
"message": "How are you?",
"from": "Patient",
"to": "Doctor",
"timestamp": "2023-10-01T12:01:00Z"
}
EOM