This project is a Health Service API built with Spring Boot. It allows managing doctors and patients, and provides an endpoint to suggest doctors based on a patient's symptoms and location.
The project is organized into the following packages:
com.assignment.Lattice.Controller
: Contains the REST controllers for handling API requests.com.assignment.Lattice.Model
: Contains the entity classes for Doctor and Patient.com.assignment.Lattice.Repository
: Contains the JPA repository interfaces for Doctor and Patient.com.assignment.Lattice.Service
: Contains the service interfaces and their implementations.com.assignment.Lattice.config
: Contains the Swagger configuration class.
- Java 11
- Spring Boot
- Spring Data JPA
- Hibernate
- H2 Database (for testing purposes)
- Springdoc OpenAPI (for Swagger documentation)
- Clone the repository:
git clone <repository-url> cd health-service-api
Start your MySQL server. Create a database named demo
CREATE DATABASE demo;
Update the MySQL credentials in the src/main/resources/application.properties file.
spring.datasource.url=jdbc:mysql://localhost:3306/demo
spring.datasource.username=root
spring.datasource.password=yourpassword
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
Replace yourpassword with your MySQL root password.
mvn clean install
mvn spring-boot:run
The application will start running at http://localhost:8080.
Swagger UI: http://localhost:8080/swagger-ui.html or http://localhost:8080/swagger-ui/