# harishanandh/java-proj architecture

> Architecture diagram of the GitHub repository harishanandh/java-proj, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harishanandh/java-proj
- Repository: https://github.com/harishanandh/java-proj

## Overview

SATARK is a disaster-preparedness web application: citizens use its portal and drill console to review safety guidance, complete assessments, and track readiness. The principal runtime flow is browser to servlet API, then to user-data operations and persistence; user endpoints also support registration, login, profiles, and leaderboards. The README documents scramble and visual scenario drills, but the sampled server excerpt shows quiz questions and score updates only. The graph preserves those documented UI capabilities while distinguishing them from sampled backend behavior. Relationships are cited to the README or excerpts; unsampled details are not inferred.

Main entry points: [`webapp/game.html`](https://github.com/harishanandh/java-proj/blob/main/webapp/game.html) (Drill console), [`src/com/satark/dao/UserDAO.java`](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/dao/UserDAO.java) (User data operations), [`webapp/index.html`](https://github.com/harishanandh/java-proj/blob/main/webapp/index.html) (Safety portal), [`src/com/satark/util/HibernateUtil.java`](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/util/HibernateUtil.java) (Hibernate manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Citizen experience"]
  node_portal["Safety portal<br/>[index.html]"]
  node_drill_console["Drill console<br/>[game.html]"]
  node_safety_reference["Safety references<br/>[index.html]"]
end

subgraph group_drills["Preparedness drills"]
  node_quiz["Protocol assessment<br/>[GameServlet.java]"]
  node_scramble["Codes scramble<br/>[game.html]"]
  node_scenario["Scenario challenge<br/>[game.html]"]
end

subgraph group_services["Application services"]
  node_user_api["User operations<br/>[UserServlet.java]"]
  node_game_api["Drill API<br/>[GameServlet.java]"]
  node_user_dao["User data operations<br/>[UserDAO.java]"]
end

subgraph group_persistence["Persistence"]
  node_user_entity["User entity<br/>[User.java]"]
  node_hibernate_manager["Hibernate manager<br/>[HibernateUtil.java]"]
  node_jdbc_fallback["JDBC fallback<br/>[DBUtil.java]"]
  node_hibernate_config["Hibernate configuration<br/>[hibernate.cfg.xml]"]
  node_postgres[("PostgreSQL")]
end

node_citizen(("Citizen"))

node_citizen -->|"opens"| node_portal
node_portal -->|"launches"| node_drill_console
node_portal -->|"presents"| node_safety_reference
node_drill_console -->|"takes assessment"| node_quiz
node_drill_console -->|"offers drill"| node_scramble
node_drill_console -->|"offers challenge"| node_scenario
node_drill_console -->|"requests questions and scores"| node_game_api
node_citizen -->|"submits user actions"| node_user_api
node_user_api -->|"delegates"| node_user_dao
node_game_api -->|"updates scores"| node_user_dao
node_user_dao -->|"uses ORM"| node_hibernate_manager
node_user_dao -->|"falls back to JDBC"| node_jdbc_fallback
node_user_dao -->|"creates and returns"| node_user_entity
node_hibernate_manager -->|"registers entity"| node_user_entity
node_hibernate_manager -->|"loads configuration"| node_hibernate_config
node_hibernate_config -->|"configures connection"| node_postgres
node_jdbc_fallback -->|"opens JDBC connection"| node_postgres

click node_portal "https://github.com/harishanandh/java-proj/blob/main/webapp/index.html"
click node_drill_console "https://github.com/harishanandh/java-proj/blob/main/webapp/game.html"
click node_safety_reference "https://github.com/harishanandh/java-proj/blob/main/webapp/index.html"
click node_quiz "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/servlet/GameServlet.java"
click node_scramble "https://github.com/harishanandh/java-proj/blob/main/webapp/game.html"
click node_scenario "https://github.com/harishanandh/java-proj/blob/main/webapp/game.html"
click node_user_api "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/servlet/UserServlet.java"
click node_game_api "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/servlet/GameServlet.java"
click node_user_dao "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/dao/UserDAO.java"
click node_user_entity "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/model/User.java"
click node_hibernate_manager "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/util/HibernateUtil.java"
click node_jdbc_fallback "https://github.com/harishanandh/java-proj/blob/main/src/com/satark/util/DBUtil.java"
click node_hibernate_config "https://github.com/harishanandh/java-proj/blob/main/src/hibernate.cfg.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_portal,node_drill_console,node_safety_reference toneBlue
class node_quiz,node_scramble,node_scenario toneAmber
class node_user_api,node_game_api,node_user_dao toneMint
class node_user_entity,node_hibernate_manager,node_jdbc_fallback,node_hibernate_config,node_postgres toneRose
class node_citizen toneIndigo
```

## Components

### Citizen experience

- [Safety portal](https://github.com/harishanandh/java-proj/blob/main/webapp/index.html): `webapp/index.html`
- [Drill console](https://github.com/harishanandh/java-proj/blob/main/webapp/game.html): `webapp/game.html`
- [Safety references](https://github.com/harishanandh/java-proj/blob/main/webapp/index.html): `webapp/index.html`

### Preparedness drills

- [Protocol assessment](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/servlet/GameServlet.java): `src/com/satark/servlet/GameServlet.java`
- [Codes scramble](https://github.com/harishanandh/java-proj/blob/main/webapp/game.html): `webapp/game.html`
- [Scenario challenge](https://github.com/harishanandh/java-proj/blob/main/webapp/game.html): `webapp/game.html`

### Application services

- [User operations](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/servlet/UserServlet.java): `src/com/satark/servlet/UserServlet.java`
- [Drill API](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/servlet/GameServlet.java): `src/com/satark/servlet/GameServlet.java`
- [User data operations](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/dao/UserDAO.java): `src/com/satark/dao/UserDAO.java`

### Persistence

- [User entity](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/model/User.java): `src/com/satark/model/User.java`
- [Hibernate manager](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/util/HibernateUtil.java): `src/com/satark/util/HibernateUtil.java`
- [JDBC fallback](https://github.com/harishanandh/java-proj/blob/main/src/com/satark/util/DBUtil.java): `src/com/satark/util/DBUtil.java`
- [Hibernate configuration](https://github.com/harishanandh/java-proj/blob/main/src/hibernate.cfg.xml): `src/hibernate.cfg.xml`
- **PostgreSQL**

### Other components

- **Citizen**

## Connections

- Citizen → Safety portal: opens (evidence: `README.md`)
- Safety portal → Drill console: launches (evidence: `README.md`)
- Safety portal → Safety references: presents (evidence: `README.md`)
- Drill console → Protocol assessment: takes assessment (evidence: `README.md`)
- Drill console → Codes scramble: offers drill (evidence: `README.md`)
- Drill console → Scenario challenge: offers challenge (evidence: `README.md`)
- Drill console → Drill API: requests questions and scores (evidence: `README.md`)
- Citizen → User operations: submits user actions (evidence: `README.md`)
- User operations → User data operations: delegates (evidence: `src/com/satark/servlet/UserServlet.java`)
- Drill API → User data operations: updates scores (evidence: `src/com/satark/servlet/GameServlet.java`)
- User data operations → Hibernate manager: uses ORM (evidence: `src/com/satark/dao/UserDAO.java`)
- User data operations → JDBC fallback: falls back to JDBC (evidence: `src/com/satark/dao/UserDAO.java`)
- User data operations → User entity: creates and returns (evidence: `src/com/satark/dao/UserDAO.java`)
- Hibernate manager → User entity: registers entity (evidence: `src/com/satark/util/HibernateUtil.java`)
- Hibernate manager → Hibernate configuration: loads configuration (evidence: `src/com/satark/util/HibernateUtil.java`)
- Hibernate configuration → PostgreSQL: configures connection (evidence: `README.md`)
- JDBC fallback → PostgreSQL: opens JDBC connection (evidence: `src/com/satark/util/DBUtil.java`)
