# ochenje/removing-manual-steps architecture

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

- Interactive diagram: https://gitdiagram.com/ochenje/removing-manual-steps
- Repository: https://github.com/ochenje/removing-manual-steps

## Overview

This is a layered Java CLI rental application. Users register or log in, then browse paginated listings, manage their own items, rent another user’s available item, and confirm returns as the owner. The CLI delegates workflows to services, which enforce validation and ownership rules before repository persistence. SQLite setup, password hashing, demo seeding, and structured logging support the product. Relationships shown are limited to README statements and indexed imports or references; unsampled implementation details are not inferred.

Main entry points: [`src/main/java/tech/kood/rental/transport/CliHandler.java`](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/transport/CliHandler.java) (Command-line UI), [`src/main/java/tech/kood/rental/service/UserService.java`](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/UserService.java) (Registration and login), [`src/main/java/tech/kood/rental/service/RentalService.java`](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/RentalService.java) (Rent and return), [`src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java`](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI interaction"]
  node_cli["Command-line UI<br/>[CliHandler.java]"]
  node_startup["Application startup<br/>[Main.java]"]
end

subgraph group_workflows["Rental workflows"]
  node_userflow["Registration and login<br/>[UserService.java]"]
  node_itemflow["Listing management<br/>[ItemService.java]"]
  node_rentalflow["Rent and return<br/>[RentalService.java]"]
end

subgraph group_model["Domain and validation"]
  node_entities["Rental entities<br/>[Item.java]"]
  node_itemrules["Item validation<br/>[ItemValidator.java]"]
  node_rentalrules["Rental validation"]
  node_userrules["User validation<br/>[UserValidator.java]"]
  node_validationerror["Validation errors"]
end

subgraph group_persistence["Persistence and infrastructure"]
  node_itemrepo["Item persistence"]
  node_rentalrepo["Rental persistence"]
  node_userrepo["User persistence"]
  node_database[("SQLite database")]
  node_schema["Database schema<br/>[schema.sql]"]
  node_seed["Demo data seeding<br/>[SeedData.java]"]
  node_dberror["Database errors"]
  node_duplicateerror["Duplicate usernames"]
  node_logger["Structured logging"]
end

subgraph group_security["Account security"]
  node_hasher["BCrypt passwords"]
end

node_user(("User"))
node_sqlite[("SQLite file")]

node_user -->|"uses"| node_cli
node_startup -->|"starts"| node_cli
node_startup -->|"configures"| node_userflow
node_startup -->|"configures"| node_itemflow
node_startup -->|"configures"| node_rentalflow
node_cli -->|"invokes"| node_userflow
node_cli -->|"invokes"| node_itemflow
node_cli -->|"invokes"| node_rentalflow
node_userflow -->|"reads and writes"| node_userrepo
node_userflow -->|"hashes and verifies"| node_hasher
node_userflow -->|"validates"| node_userrules
node_itemflow -->|"queries and updates"| node_itemrepo
node_itemflow -->|"validates"| node_itemrules
node_rentalflow -->|"checks item state"| node_itemrepo
node_rentalflow -->|"reads and writes"| node_rentalrepo
node_rentalflow -->|"validates"| node_rentalrules
node_userflow -->|"raises"| node_validationerror
node_itemflow -->|"raises"| node_validationerror
node_rentalflow -->|"raises"| node_validationerror
node_itemrepo -->|"opens connections"| node_database
node_rentalrepo -->|"opens connections"| node_database
node_userrepo -->|"opens connections"| node_database
node_database -->|"persists records"| node_sqlite
node_database -->|"loads schema"| node_schema
node_seed -->|"creates demo data"| node_sqlite
node_startup -->|"initializes"| node_database
node_database -->|"logs failures"| node_logger
node_userflow -->|"logs workflow"| node_logger
node_itemflow -->|"logs workflow"| node_logger
node_rentalflow -->|"logs workflow"| node_logger
node_cli -->|"handles"| node_dberror
node_cli -->|"handles"| node_duplicateerror
node_userrepo -->|"signals duplicate"| node_duplicateerror
node_itemrepo -->|"wraps database failure"| node_dberror
node_rentalrepo -->|"wraps database failure"| node_dberror
node_userrepo -->|"wraps database failure"| node_dberror

click node_cli "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/transport/CliHandler.java"
click node_startup "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/Main.java"
click node_userflow "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/UserService.java"
click node_itemflow "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/ItemService.java"
click node_rentalflow "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/RentalService.java"
click node_entities "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/Item.java"
click node_itemrules "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/ItemValidator.java"
click node_rentalrules "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/RentalValidator.java"
click node_userrules "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/UserValidator.java"
click node_validationerror "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/ValidationException.java"
click node_itemrepo "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/ItemRepository.java"
click node_rentalrepo "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/RentalRepository.java"
click node_userrepo "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/UserRepository.java"
click node_database "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java"
click node_schema "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/resources/schema.sql"
click node_seed "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/SeedData.java"
click node_dberror "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/exception/DatabaseException.java"
click node_duplicateerror "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/exception/DuplicateUsernameException.java"
click node_hasher "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/security/PasswordHasher.java"
click node_logger "https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/StructuredLogger.java"

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_cli,node_startup,node_user toneBlue
class node_userflow,node_itemflow,node_rentalflow,node_sqlite toneAmber
class node_entities,node_itemrules,node_rentalrules,node_userrules,node_validationerror toneMint
class node_itemrepo,node_rentalrepo,node_userrepo,node_database,node_schema,node_seed,node_dberror,node_duplicateerror,node_logger toneRose
class node_hasher toneIndigo
```

## Components

### CLI interaction

- [Command-line UI](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/transport/CliHandler.java): `src/main/java/tech/kood/rental/transport/CliHandler.java`
- [Application startup](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/Main.java): `src/main/java/tech/kood/rental/Main.java`

### Rental workflows

- [Registration and login](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/UserService.java): `src/main/java/tech/kood/rental/service/UserService.java`
- [Listing management](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/ItemService.java): `src/main/java/tech/kood/rental/service/ItemService.java`
- [Rent and return](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/service/RentalService.java): `src/main/java/tech/kood/rental/service/RentalService.java`

### Domain and validation

- [Rental entities](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/Item.java): `src/main/java/tech/kood/rental/domain/Item.java`
- [Item validation](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/ItemValidator.java): `src/main/java/tech/kood/rental/domain/ItemValidator.java`
- [Rental validation](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/RentalValidator.java): `src/main/java/tech/kood/rental/domain/RentalValidator.java`
- [User validation](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/UserValidator.java): `src/main/java/tech/kood/rental/domain/UserValidator.java`
- [Validation errors](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/domain/ValidationException.java): `src/main/java/tech/kood/rental/domain/ValidationException.java`

### Persistence and infrastructure

- [Item persistence](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/ItemRepository.java): `src/main/java/tech/kood/rental/repository/ItemRepository.java`
- [Rental persistence](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/RentalRepository.java): `src/main/java/tech/kood/rental/repository/RentalRepository.java`
- [User persistence](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/UserRepository.java): `src/main/java/tech/kood/rental/repository/UserRepository.java`
- [SQLite database](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java): `src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java`
- [Database schema](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/resources/schema.sql): `src/main/resources/schema.sql`
- [Demo data seeding](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/SeedData.java): `src/main/java/tech/kood/rental/infrastructure/SeedData.java`
- [Database errors](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/exception/DatabaseException.java): `src/main/java/tech/kood/rental/repository/exception/DatabaseException.java`
- [Duplicate usernames](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/repository/exception/DuplicateUsernameException.java): `src/main/java/tech/kood/rental/repository/exception/DuplicateUsernameException.java`
- [Structured logging](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/infrastructure/StructuredLogger.java): `src/main/java/tech/kood/rental/infrastructure/StructuredLogger.java`

### Account security

- [BCrypt passwords](https://github.com/ochenje/removing-manual-steps/blob/main/src/main/java/tech/kood/rental/security/PasswordHasher.java): `src/main/java/tech/kood/rental/security/PasswordHasher.java`

### Other components

- **User**
- **SQLite file**

## Connections

- User → Command-line UI: uses (evidence: `README.md`)
- Application startup → Command-line UI: starts (evidence: `src/main/java/tech/kood/rental/Main.java`)
- Application startup → Registration and login: configures (evidence: `src/main/java/tech/kood/rental/Main.java`)
- Application startup → Listing management: configures (evidence: `src/main/java/tech/kood/rental/Main.java`)
- Application startup → Rent and return: configures (evidence: `src/main/java/tech/kood/rental/Main.java`)
- Command-line UI → Registration and login: invokes (evidence: `src/main/java/tech/kood/rental/transport/CliHandler.java`)
- Command-line UI → Listing management: invokes (evidence: `src/main/java/tech/kood/rental/transport/CliHandler.java`)
- Command-line UI → Rent and return: invokes (evidence: `src/main/java/tech/kood/rental/transport/CliHandler.java`)
- Registration and login → User persistence: reads and writes (evidence: `src/main/java/tech/kood/rental/service/UserService.java`)
- Registration and login → BCrypt passwords: hashes and verifies (evidence: `src/main/java/tech/kood/rental/service/UserService.java`)
- Registration and login → User validation: validates (evidence: `src/main/java/tech/kood/rental/service/UserService.java`)
- Listing management → Item persistence: queries and updates (evidence: `src/main/java/tech/kood/rental/service/ItemService.java`)
- Listing management → Item validation: validates (evidence: `src/main/java/tech/kood/rental/service/ItemService.java`)
- Rent and return → Item persistence: checks item state (evidence: `src/main/java/tech/kood/rental/service/RentalService.java`)
- Rent and return → Rental persistence: reads and writes (evidence: `src/main/java/tech/kood/rental/service/RentalService.java`)
- Rent and return → Rental validation: validates (evidence: `src/main/java/tech/kood/rental/service/RentalService.java`)
- Registration and login → Validation errors: raises (evidence: `src/main/java/tech/kood/rental/service/UserService.java`)
- Listing management → Validation errors: raises (evidence: `src/main/java/tech/kood/rental/service/ItemService.java`)
- Rent and return → Validation errors: raises (evidence: `src/main/java/tech/kood/rental/service/RentalService.java`)
- Item persistence → SQLite database: opens connections (evidence: `src/main/java/tech/kood/rental/repository/ItemRepository.java`)
- Rental persistence → SQLite database: opens connections (evidence: `src/main/java/tech/kood/rental/repository/RentalRepository.java`)
- User persistence → SQLite database: opens connections (evidence: `src/main/java/tech/kood/rental/repository/UserRepository.java`)
- SQLite database → SQLite file: persists records (evidence: `README.md`)
- SQLite database → Database schema: loads schema (evidence: `src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java`)
- Demo data seeding → SQLite file: creates demo data (evidence: `README.md`)
- Application startup → SQLite database: initializes (evidence: `src/main/java/tech/kood/rental/Main.java`)
- SQLite database → Structured logging: logs failures (evidence: `src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java`)
- Registration and login → Structured logging: logs workflow (evidence: `src/main/java/tech/kood/rental/service/UserService.java`)
- Listing management → Structured logging: logs workflow (evidence: `src/main/java/tech/kood/rental/service/ItemService.java`)
- Rent and return → Structured logging: logs workflow (evidence: `src/main/java/tech/kood/rental/service/RentalService.java`)
- Command-line UI → Database errors: handles (evidence: `src/main/java/tech/kood/rental/transport/CliHandler.java`)
- Command-line UI → Duplicate usernames: handles (evidence: `src/main/java/tech/kood/rental/transport/CliHandler.java`)
- User persistence → Duplicate usernames: signals duplicate (evidence: `src/main/java/tech/kood/rental/repository/UserRepository.java`)
- Item persistence → Database errors: wraps database failure (evidence: `src/main/java/tech/kood/rental/repository/ItemRepository.java`)
- Rental persistence → Database errors: wraps database failure (evidence: `src/main/java/tech/kood/rental/repository/RentalRepository.java`)
- User persistence → Database errors: wraps database failure (evidence: `src/main/java/tech/kood/rental/repository/UserRepository.java`)
