# padalakiran/hospital_management_system architecture

> Architecture diagram of the GitHub repository padalakiran/hospital_management_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/padalakiran/hospital_management_system
- Repository: https://github.com/padalakiran/hospital_management_system

## Overview

##### Project Type & Purpose
- This project is a Java-based desktop (or standalone) management application focused on handling hospital-related operations. Its main functionalities include patient login and signup, admin and doctor login, registering doctors, booking appointments, and persisting all relevant data in a MySQL database.
- The README clearly identifies the use of Java (with its JDBC packages) and MySQL. The functionality is split into different responsibilities (authentication, appointment booking, registration) all implemented as Java classes under the package “Health”.

##### Analyzing the File Structure
- The main source code is located under Hospital_Management_System/src/Health, which contains Java files such as Admin_login.java, BookAppointment.java, Doctor_login.java, Home_page.java, Patient_Signup.java, and Patient_login.java.
- There are separate directories for Eclipse metadata and build outputs (bin/), which indicates this is an Eclipse-managed Java project.

a. Main Components:
- User Interface (Presentation Layer): This will include all UI classes such as Home_page, Admin_login, Patient_login, Patient_Signup, Doctor_login, and BookAppointment. Think of these as the entry points for users (patients, admin, and doctors).
- Business Logic / Controller Layer: Although not separated into distinct packages in the file structure (everything is under the Health package), conceptually these Java classes implement the application’s business rules – processing logins, validating data, and managing appointments.
- Database Access Layer: Represent the JDBC and SQL connection functionality which is behind the scenes in each class. Here, components like java.sql.Connection, DriverManager, PreparedStatement, and ResultSet play a role in connecting and interacting with the MySQL database.
- Database (MySQL): This external component stores all data in structured tables for Admin, Patients, Appointments, and Doctors. The schema details provided in the README (columns for each table) should be noted.

b. Relationships & Interactions:

c. Architectural Patterns & Design Principles:
- Use of JDBC as the key integration technology for the Data Access Layer; this is represented by the use of java.sql packages.

d. Technologies & Frameworks:
- Java (with emphasis on core libraries such as java.sql and java.util.Scanner)
- MySQL database (schema details as given)
- Eclipse IDE (indirectly indicated by the metadata and project files)

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "User Interface (Presentation Layer)"
        UI1("Admin Login"):::ui
        UI2("Patient Login"):::ui
        UI3("Patient Signup"):::ui
        UI4("Doctor Login"):::ui
        UI5("Book Appointment"):::ui
        UI6("Home Page"):::ui
    end

    subgraph "Business Logic / Controller Layer"
        BL("Business Logic / Controller"):::bl
    end

    subgraph "Database Access (JDBC Layer)"
        DBA("Database Access (JDBC)"):::db
    end

    DB("MySQL Database"):::external

    %% User actions flow to Business Logic
    UI1 -->|"userAction"| BL
    UI2 -->|"userAction"| BL
    UI3 -->|"userAction"| BL
    UI4 -->|"userAction"| BL
    UI5 -->|"userAction"| BL
    UI6 -->|"userAction"| BL

    %% Business Logic makes database requests
    BL -->|"dataRequest"| DBA
    DBA -->|"queryResponse"| BL

    %% Data persistence with external MySQL
    DBA -->|"dataPersistence"| DB

    %% Representative feedback from Business Logic back to UI
    BL -->|"response"| UI1

    %% Click Events for components (paths are for click events only)
    click UI1 "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click UI2 "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click UI3 "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click UI4 "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click UI5 "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click UI6 "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click BL "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"
    click DBA "https://github.com/padalakiran/hospital_management_system/tree/main/HealthCare/Hospital_Management_System/src/Health"

    %% Styles for color coding
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef bl fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef db fill:#FFA07A,stroke:#000,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
