Skip to content

KarnamShyam1947/springboot-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot REST API – Meditech Backend

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.


Project Structure


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


Features

  • Authentication & Authorization

    • JWT-based authentication
    • Role-based access via SecurityConfig.java and 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
  • 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
  • Error Handling

    • Centralized exception handling through GlobalExceptionHandler.java

Quick Start

  1. Clone the repository

    git clone https://github.com/KarnamShyam1947/springboot-rest-api.git
    cd springboot-rest-api```
    
  2. Database setup Import meditech.session.sql into your local (e.g., MySQL) database.

  3. 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
  4. Build & Run

    mvn clean install
    mvn spring-boot:run
  5. Access the API

    • App runs at: http://localhost:8080
    • Swagger UI: http://localhost:8080/swagger-ui.html (if enabled)

API Endpoints

  • Auth

    • POST /api/auth/signup – Register new user
    • POST /api/auth/login – Authenticate & issue token
    • POST /api/auth/refresh-token – Get a new JWT
    • POST /api/auth/reset-password – Initiate password reset
  • Users

    • GET /api/users/me – Get user details
    • PUT /api/users/password – Change user password
  • Appointments

    • GET /api/appointments – List appointments
    • POST /api/appointments – Book appointment
    • Other user/admin variants per roles
  • Medicines & Orders

    • CRUD: /api/medicines, /api/orders
    • Order flow: placement, updates, tracking status
  • Departments & Doctors

    • CRUD: /api/departments, /api/doctors
  • Prediction

    • POST /api/predict – Submit data, get prediction

Technologies & Frameworks

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages