Skip to content

TheComputationalCore/patient-system

Patient Management System

πŸš‘ Patient Management System

License Issues Java Spring Boot

A modern, secure Patient Management System built with Spring Boot, Spring Security, Thymeleaf, and Spring Data JPA.
Designed for clinics and medical teams to manage patients, appointments, medications, user accounts, and database operations efficiently.


✨ Features

πŸ” Authentication & Security

  • Secure login & registration
  • BCrypt password hashing
  • Spring Security authentication flow

πŸ₯ Patient Management

  • Add, edit, update, delete patients
  • View complete patient profiles
  • Medical information & history tracking

πŸ“… Appointment System

  • Book appointments
  • Appointment confirmation screen
  • List all appointments
  • Postman-tested REST endpoints

πŸ’Š Medication Tracking

  • Add medications
  • Medication list page
  • Medication linked with patient

πŸ–₯ UI & Frontend

  • Thymeleaf server-rendered UI
  • Bootstrap 5 responsive layout
  • Clean, simple navigation
  • User profile dashboard

πŸ›’ Database Support

Supports multiple databases out of the box:

  • H2 (memory mode)
  • MySQL
  • PostgreSQL

🐳 Docker Support

  • Pre-built Dockerfile
  • Environment variable support
  • Optional Docker Compose (included below)

πŸ“Έ Screenshots

All screenshots are stored under /screenshots/.

🏠 UI Screens

Dashboard

Dashboard

Homepage

Homepage

User Registration

Registration

Logout

Logout


🧩 Architecture Overview

Patient System (Spring Boot App)
β”‚
β”œβ”€β”€ Authentication Layer
β”‚     └── Spring Security, BCrypt
β”‚
β”œβ”€β”€ MVC Layer
β”‚     β”œβ”€β”€ Controllers (Handle requests)
β”‚     β”œβ”€β”€ Services    (Business logic)
β”‚     β”œβ”€β”€ Repositories (Database access)
β”‚     └── Models (Entities)
β”‚
β”œβ”€β”€ Thymeleaf UI Layer
β”‚     └── HTML templates + Bootstrap 5
β”‚
└── Database Layer
      └── H2 / MySQL / PostgreSQL

πŸ›  Project Structure

patient-system/
β”œβ”€β”€ src/main/java/.../controller
β”œβ”€β”€ src/main/java/.../service
β”œβ”€β”€ src/main/java/.../repository
β”œβ”€β”€ src/main/java/.../model
β”œβ”€β”€ src/main/resources/
β”‚   β”œβ”€β”€ templates/
β”‚   └── static/
β”œβ”€β”€ screenshots/
β”œβ”€β”€ Dockerfile
└── README.md

πŸš€ Quick Start (Local Development)

1️⃣ Clone the Repo

git clone https://github.com/TheComputationalCore/patient-system.git
cd patient-system

2️⃣ Build

./mvnw clean package

3️⃣ Run with H2 (recommended for dev)

Update application.properties:

server.port=8085
spring.datasource.url=jdbc:h2:mem:patient_system
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=update
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.thymeleaf.cache=false

Run:

./mvnw spring-boot:run

Open in browser:


πŸ—„ Database Configuration

🐬 MySQL

spring.datasource.url=jdbc:mysql://localhost:3306/patient_system
spring.datasource.username=root
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update

🐘 PostgreSQL

spring.datasource.url=jdbc:postgresql://localhost:5432/patient_system
spring.datasource.username=postgres
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update

🐳 Docker Setup

Build Docker Image

docker build -t patient-system:latest .

Run Container

docker run -p 8085:8085 --env-file .env patient-system:latest

Example .env file:

DB_URL=jdbc:mysql://localhost:3306/patient_system
DB_USERNAME=yourusername
DB_PASSWORD=yourpassword

🐳 Docker Compose (Optional)

version: "3.9"
services:
  db:
    image: mysql:8
    container_name: patient_db
    environment:
      MYSQL_ROOT_PASSWORD: yourpassword
      MYSQL_DATABASE: patient_system
    ports:
      - "3306:3306"

  app:
    build: .
    container_name: patient_app
    depends_on:
      - db
    ports:
      - "8085:8085"
    environment:
      DB_URL: jdbc:mysql://db:3306/patient_system
      DB_USERNAME: yourusername
      DB_PASSWORD: yourpassword

Run:

docker compose up --build

πŸ“˜ API Documentation (Basic)

Method Endpoint Description
GET / Home
GET /register Registration page
POST /register Register new user
POST /login Login user
POST /logout Logout user
GET /appointments Get all appointments
POST /appointments/book Book appointment

πŸ§ͺ Running Tests

./mvnw test

🀝 Contributing

See: CONTRIBUTING.md


πŸ” Security Policy

See: SECURITY.md


πŸ“œ License

This project is licensed under the MIT License.


πŸ‘€ Author

Dinesh Chandra β€” TheComputationalCore
GitHub: https://github.com/TheComputationalCore
YouTube: https://www.youtube.com/@TheComputationalCore

Releases

No releases published

Packages

 
 
 

Contributors