Skip to content
← all projects
In development2026

Hospital Management System

A Spring Boot backend that models how a hospital runs, built on a 52-table PostgreSQL schema.

  • Java
  • Spring Boot
  • PostgreSQL
  • Data modeling

Overview

A backend that models how a hospital runs: patients, appointments, admissions, pharmacy, lab, billing, insurance and staff. I'm building it to practise production-style backend work, starting from the schema.

The API layer is Spring Boot REST with request validation, cursor-based pagination and centralized exception handling, on PostgreSQL with versioned Flyway migrations.

This is a training project, not a client system, and it is still in development.

Design decisions

01Access control lives in data
Roles, permissions and their links are tables, and every staff role assignment carries ValidFrom, ValidTo and AssignedBy, so access can expire and be traced to who granted it.
02Statuses are lookup tables
Appointment, bed, ward and prescription states are keyed rows, not free text, so the database rejects states that don't exist.
03Stock is tracked by batch
Each drug stock row holds a batch number, expiry date, quantity and received date, so expiring stock can be found and rotated.
04Billing traces back to its source
An invoice item points at the service, drug or lab test it charges for, and an insurance claim points at both the invoice and the patient's policy.
05Changes can be audited
An audit log records the action, table, record, old and new values, and the staff member responsible.
06Scheduling is guarded against double-booking
Booking uses explicit concurrency control so two simultaneous requests can't claim the same slot.