# haranlakha/user-management architecture

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

- Interactive diagram: https://gitdiagram.com/haranlakha/user-management
- Repository: https://github.com/haranlakha/user-management

## Overview

User Management is a React interface backed by a Java/Hibernate user service and PostgreSQL, with a local-storage demo fallback. The user workflow is to browse, search, and summarize users, then create, edit, or delete records; the App coordinates those actions through the user service. The backend source files are present in the tree but were not excerpted, so backend call relationships are shown as unverified rather than inferred. The README documents Hibernate and PostgreSQL; frontend excerpts document the API route and encryption-related UI.

Main entry points: [`frontend/src/App.jsx`](https://github.com/haranlakha/user-management/blob/master/frontend/src/App.jsx) (App coordinator), [`src/main/resources/hibernate.cfg.xml`](https://github.com/haranlakha/user-management/blob/master/src/main/resources/hibernate.cfg.xml) (Hibernate configuration), [`src/main/java/org/example/entity/User.java`](https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/entity/User.java) (User entity), [`frontend/src/services/userService.js`](https://github.com/haranlakha/user-management/blob/master/frontend/src/services/userService.js) (User API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app["App coordinator<br/>[App.jsx]"]
  node_stats["User statistics<br/>[StatsCards.jsx]"]
  node_table["Search and table<br/>[UserTable.jsx]"]
  node_editmodal["User form<br/>[UserModal.jsx]"]
  node_deletemodal["Delete confirmation"]
  node_userservice["User API client<br/>[userService.js]"]
end

subgraph group_backend["User service"]
  node_api["Users API"]
end

subgraph group_persistence["Persistence and encryption"]
  node_userentity["User entity<br/>[User.java]"]
  node_converter["Encryption converter"]
  node_hibernate["Hibernate configuration<br/>[hibernate.cfg.xml]"]
  node_keyconfig["Encryption key config<br/>[postgresql.conf]"]
end

subgraph group_external["External systems"]
  node_postgres[("PostgreSQL")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_stats
node_app -->|"renders"| node_table
node_app -->|"renders"| node_editmodal
node_app -->|"renders"| node_deletemodal
node_app -->|"loads and mutates"| node_userservice
node_userservice -->|"requests /api/users"| node_api
node_api -.->|"handles records"| node_userentity
node_userentity -.->|"encrypts fields"| node_converter
node_hibernate -.->|"connects to"| node_postgres
node_hibernate -.->|"maps entity"| node_userentity
node_converter -.->|"uses key"| node_keyconfig
node_hibernate -.->|"persists through"| node_postgres

click node_app "https://github.com/haranlakha/user-management/blob/master/frontend/src/App.jsx"
click node_stats "https://github.com/haranlakha/user-management/blob/master/frontend/src/components/StatsCards.jsx"
click node_table "https://github.com/haranlakha/user-management/blob/master/frontend/src/components/UserTable.jsx"
click node_editmodal "https://github.com/haranlakha/user-management/blob/master/frontend/src/components/UserModal.jsx"
click node_deletemodal "https://github.com/haranlakha/user-management/blob/master/frontend/src/components/DeleteConfirmModal.jsx"
click node_userservice "https://github.com/haranlakha/user-management/blob/master/frontend/src/services/userService.js"
click node_api "https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/controller/UserController.java"
click node_userentity "https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/entity/User.java"
click node_converter "https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/encryption/EncryptionConverter.java"
click node_hibernate "https://github.com/haranlakha/user-management/blob/master/src/main/resources/hibernate.cfg.xml"
click node_keyconfig "https://github.com/haranlakha/user-management/blob/master/src/main/resources/postgresql.conf"

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_app,node_stats,node_table,node_editmodal,node_deletemodal,node_userservice,node_user toneBlue
class node_api toneAmber
class node_userentity,node_converter,node_hibernate,node_keyconfig toneMint
class node_postgres toneRose
```

## Components

### User interface

- [App coordinator](https://github.com/haranlakha/user-management/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [User statistics](https://github.com/haranlakha/user-management/blob/master/frontend/src/components/StatsCards.jsx): `frontend/src/components/StatsCards.jsx`
- [Search and table](https://github.com/haranlakha/user-management/blob/master/frontend/src/components/UserTable.jsx): `frontend/src/components/UserTable.jsx`
- [User form](https://github.com/haranlakha/user-management/blob/master/frontend/src/components/UserModal.jsx): `frontend/src/components/UserModal.jsx`
- [Delete confirmation](https://github.com/haranlakha/user-management/blob/master/frontend/src/components/DeleteConfirmModal.jsx): `frontend/src/components/DeleteConfirmModal.jsx`
- [User API client](https://github.com/haranlakha/user-management/blob/master/frontend/src/services/userService.js): `frontend/src/services/userService.js`

### User service

- [Users API](https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/controller/UserController.java): `src/main/java/org/example/controller/UserController.java`

### Persistence and encryption

- [User entity](https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/entity/User.java): `src/main/java/org/example/entity/User.java`
- [Encryption converter](https://github.com/haranlakha/user-management/blob/master/src/main/java/org/example/encryption/EncryptionConverter.java): `src/main/java/org/example/encryption/EncryptionConverter.java`
- [Hibernate configuration](https://github.com/haranlakha/user-management/blob/master/src/main/resources/hibernate.cfg.xml): `src/main/resources/hibernate.cfg.xml`
- [Encryption key config](https://github.com/haranlakha/user-management/blob/master/src/main/resources/postgresql.conf): `src/main/resources/postgresql.conf`

### External systems

- **PostgreSQL**

### Other components

- **User**

## Connections

- User → App coordinator: uses
- App coordinator → User statistics: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → Search and table: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → User form: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → Delete confirmation: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → User API client: loads and mutates (evidence: `frontend/src/App.jsx`)
- User API client → Users API: requests /api/users (evidence: `frontend/src/services/userService.js`)
- Users API → User entity: handles records
- User entity → Encryption converter: encrypts fields
- Hibernate configuration → PostgreSQL: connects to (evidence: `README.md`)
- Hibernate configuration → User entity: maps entity (evidence: `README.md`)
- Encryption converter → Encryption key config: uses key
- Hibernate configuration → PostgreSQL: persists through (evidence: `README.md`)
