# harish456849/doctor-patient-portal architecture

> Architecture diagram of the GitHub repository harish456849/doctor-patient-portal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harish456849/doctor-patient-portal
- Repository: https://github.com/harish456849/doctor-patient-portal

## Overview

This is a small doctor-and-patient registration and login web application. Users submit registration or login forms; servlet handlers write account details to MySQL or query credentials and return a success or failure response. Browser-side validation supports the forms, while the database connection helper centralizes JDBC setup. The tree also includes informational pages and a small calculator on the validation script; their wider wiring and the schema are not shown, so the graph focuses on evidenced behavior.

Main entry points: [`WebContent`](https://github.com/harish456849/doctor-patient-portal/tree/main/WebContent) (Login and registration forms), [`src/DBConnection.java`](https://github.com/harish456849/doctor-patient-portal/blob/main/src/DBConnection.java) (JDBC connection), [`database.sql`](https://github.com/harish456849/doctor-patient-portal/blob/main/database.sql) (MySQL database), [`src/DoctorRegisterServlet.java`](https://github.com/harish456849/doctor-patient-portal/blob/main/src/DoctorRegisterServlet.java) (Doctor registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser experience"]
  node_forms["Login and registration forms"]
  node_validation["Form validation and calculators<br/>[validation.js]"]
  node_info_pages["Informational pages"]
end

subgraph group_handlers["Account handlers"]
  node_doctor_register["Doctor registration"]
  node_patient_register["Patient registration"]
  node_doctor_login["Doctor login"]
  node_patient_login["Patient login"]
  node_web_config["Servlet configuration<br/>[web.xml]"]
end

subgraph group_persistence["Persistence"]
  node_db_connection["JDBC connection<br/>[DBConnection.java]"]
  node_mysql[("MySQL database<br/>[database.sql]")]
end

node_user(("User"))

node_user -->|"submits forms"| node_forms
node_forms -.->|"validates input"| node_validation
node_forms -.->|"registers doctor"| node_doctor_register
node_forms -.->|"registers patient"| node_patient_register
node_forms -.->|"logs in"| node_doctor_login
node_forms -.->|"logs in"| node_patient_login
node_doctor_register -->|"opens connection"| node_db_connection
node_patient_register -->|"opens connection"| node_db_connection
node_doctor_login -->|"opens connection"| node_db_connection
node_patient_login -->|"opens connection"| node_db_connection
node_db_connection -->|"connects to"| node_mysql
node_doctor_register -->|"inserts doctor"| node_mysql
node_patient_register -->|"inserts patient"| node_mysql
node_doctor_login -->|"queries doctors"| node_mysql
node_patient_login -->|"queries patients"| node_mysql
node_doctor_register -->|"returns status"| node_user
node_patient_register -->|"returns status"| node_user
node_doctor_login -->|"returns result"| node_user
node_patient_login -->|"returns result"| node_user

click node_forms "https://github.com/harish456849/doctor-patient-portal/tree/main/WebContent"
click node_validation "https://github.com/harish456849/doctor-patient-portal/blob/main/WebContent/validation.js"
click node_doctor_register "https://github.com/harish456849/doctor-patient-portal/blob/main/src/DoctorRegisterServlet.java"
click node_patient_register "https://github.com/harish456849/doctor-patient-portal/blob/main/src/PatientRegisterServlet.java"
click node_doctor_login "https://github.com/harish456849/doctor-patient-portal/blob/main/src/DoctorLoginServlet.java"
click node_patient_login "https://github.com/harish456849/doctor-patient-portal/blob/main/src/PatientLoginServlet.java"
click node_db_connection "https://github.com/harish456849/doctor-patient-portal/blob/main/src/DBConnection.java"
click node_mysql "https://github.com/harish456849/doctor-patient-portal/blob/main/database.sql"
click node_info_pages "https://github.com/harish456849/doctor-patient-portal/tree/main/WebContent"
click node_web_config "https://github.com/harish456849/doctor-patient-portal/blob/main/WebContent/WEB-INF/web.xml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_forms,node_validation,node_info_pages,node_user toneBlue
class node_doctor_register,node_patient_register,node_doctor_login,node_patient_login,node_web_config toneAmber
class node_db_connection,node_mysql toneMint
```

## Components

### Browser experience

- [Login and registration forms](https://github.com/harish456849/doctor-patient-portal/tree/main/WebContent): `WebContent`
- [Form validation and calculators](https://github.com/harish456849/doctor-patient-portal/blob/main/WebContent/validation.js): `WebContent/validation.js`
- [Informational pages](https://github.com/harish456849/doctor-patient-portal/tree/main/WebContent): `WebContent`

### Account handlers

- [Doctor registration](https://github.com/harish456849/doctor-patient-portal/blob/main/src/DoctorRegisterServlet.java): `src/DoctorRegisterServlet.java`
- [Patient registration](https://github.com/harish456849/doctor-patient-portal/blob/main/src/PatientRegisterServlet.java): `src/PatientRegisterServlet.java`
- [Doctor login](https://github.com/harish456849/doctor-patient-portal/blob/main/src/DoctorLoginServlet.java): `src/DoctorLoginServlet.java`
- [Patient login](https://github.com/harish456849/doctor-patient-portal/blob/main/src/PatientLoginServlet.java): `src/PatientLoginServlet.java`
- [Servlet configuration](https://github.com/harish456849/doctor-patient-portal/blob/main/WebContent/WEB-INF/web.xml): `WebContent/WEB-INF/web.xml`

### Persistence

- [JDBC connection](https://github.com/harish456849/doctor-patient-portal/blob/main/src/DBConnection.java): `src/DBConnection.java`
- [MySQL database](https://github.com/harish456849/doctor-patient-portal/blob/main/database.sql): `database.sql`

### Other components

- **User**

## Connections

- User → Login and registration forms: submits forms
- Login and registration forms → Form validation and calculators: validates input
- Login and registration forms → Doctor registration: registers doctor
- Login and registration forms → Patient registration: registers patient
- Login and registration forms → Doctor login: logs in
- Login and registration forms → Patient login: logs in
- Doctor registration → JDBC connection: opens connection (evidence: `src/DoctorRegisterServlet.java`)
- Patient registration → JDBC connection: opens connection (evidence: `src/PatientRegisterServlet.java`)
- Doctor login → JDBC connection: opens connection (evidence: `src/DoctorLoginServlet.java`)
- Patient login → JDBC connection: opens connection (evidence: `src/PatientLoginServlet.java`)
- JDBC connection → MySQL database: connects to (evidence: `src/DBConnection.java`)
- Doctor registration → MySQL database: inserts doctor (evidence: `src/DoctorRegisterServlet.java`)
- Patient registration → MySQL database: inserts patient (evidence: `src/PatientRegisterServlet.java`)
- Doctor login → MySQL database: queries doctors (evidence: `src/DoctorLoginServlet.java`)
- Patient login → MySQL database: queries patients (evidence: `src/PatientLoginServlet.java`)
- Doctor registration → User: returns status (evidence: `src/DoctorRegisterServlet.java`)
- Patient registration → User: returns status (evidence: `src/PatientRegisterServlet.java`)
- Doctor login → User: returns result (evidence: `src/DoctorLoginServlet.java`)
- Patient login → User: returns result (evidence: `src/PatientLoginServlet.java`)
