A comprehensive Spring Boot-based RESTful backend for a medical platform. It supports user authentication, appointment booking, medicine orders, department and doctor management, predictions, and email notifications.
karnamshyam1947-springboot-rest-api/
├── meditech.session.sql # DB schema or sample data
├── pom.xml # Maven build configuration
└── src/
└── main/
├── java/com/shyam/
│ ├── Main.java
│ ├── config/ # App configuration (Beans, Security, OpenAPI, Cloudinary)
│ ├── controllers/ # REST endpoints
│ ├── dto/ # Request and response objects
│ ├── entities/ # JPA entity definitions
│ ├── enums/ # Enumerations like diseases, roles, order status
│ ├── exceptions/ # Custom exception types
│ ├── filters/ # JWT authentication filter
│ ├── repositories/ # Data access interfaces
│ ├── services/ # Business logic
│ └── validators/ # Custom validation annotations
└── resources/
├── application.properties # App configs
├── cloudinary.properties # Cloudinary credentials
└── templates/
├── index.html
└── email/set-password-email.ftl
-
Authentication & Authorization
- JWT-based authentication
- Role-based access via
SecurityConfig.javaand handlers
-
User Management
- User registration, login, password reset, and refresh tokens
-
Appointment Booking
- Doctor and patient endpoints for scheduling and managing appointments
-
Medicine & Orders
- CRUD operations for medicines
- Order placement, status tracking, and administrative approval
-
Department & Doctor Management
- Add, update, and list departments and doctor profiles
-
Prediction Module
- Healthcare-related prediction feature via
PredictController
- Healthcare-related prediction feature via
-
Cloud Storage
- Integration with Cloudinary for file uploads (e.g. profile images)
-
Email Notifications
- Supports templated email (FreeMarker) for password setups and alerts
-
API Documentation
- OpenAPI/Swagger available via
OpenAPIConfig.java
- OpenAPI/Swagger available via
-
Error Handling
- Centralized exception handling through
GlobalExceptionHandler.java
- Centralized exception handling through
-
Clone the repository
git clone https://github.com/KarnamShyam1947/springboot-rest-api.git cd springboot-rest-api```
-
Database setup Import
meditech.session.sqlinto your local (e.g., MySQL) database. -
Configure application
- Update
application.properties(database URL, credentials, JWT secrets, etc.) - Configure Cloudinary settings in
cloudinary.properties - Add email SMTP settings if using email features
- Update
-
Build & Run
mvn clean install mvn spring-boot:run
-
Access the API
- App runs at:
http://localhost:8080 - Swagger UI:
http://localhost:8080/swagger-ui.html(if enabled)
- App runs at:
-
Auth
POST /api/auth/signup– Register new userPOST /api/auth/login– Authenticate & issue tokenPOST /api/auth/refresh-token– Get a new JWTPOST /api/auth/reset-password– Initiate password reset
-
Users
GET /api/users/me– Get user detailsPUT /api/users/password– Change user password
-
Appointments
GET /api/appointments– List appointmentsPOST /api/appointments– Book appointment- Other user/admin variants per roles
-
Medicines & Orders
- CRUD:
/api/medicines,/api/orders - Order flow: placement, updates, tracking status
- CRUD:
-
Departments & Doctors
- CRUD:
/api/departments,/api/doctors
- CRUD:
-
Prediction
POST /api/predict– Submit data, get prediction
- Java & Spring Boot – Core application
- Spring Security & JWT – Security stack
- Spring Data JPA – ORM with Hibernate
- Cloudinary – Media storage
- OpenAPI (Swagger) – API documentation
- FreeMarker – Email templates
- Maven – Dependency management & build