How ochenje/removing-manual-steps works
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: CliHandler.java Command-line UI · UserService.java Registration and login · RentalService.java Rent and return · DatabaseConnection.java SQLite database
Components 22
CLI interaction
- Command-line UI
src/main/java/tech/kood/rental/transport/CliHandler.java - Application startup
src/main/java/tech/kood/rental/Main.java
Rental workflows
- Registration and login
src/main/java/tech/kood/rental/service/UserService.java - Listing management
src/main/java/tech/kood/rental/service/ItemService.java - Rent and return
src/main/java/tech/kood/rental/service/RentalService.java
Domain and validation
- Rental entities
src/main/java/tech/kood/rental/domain/Item.java - Item validation
src/main/java/tech/kood/rental/domain/ItemValidator.java - Rental validation
src/main/java/tech/kood/rental/domain/RentalValidator.java - User validation
src/main/java/tech/kood/rental/domain/UserValidator.java - Validation errors
src/main/java/tech/kood/rental/domain/ValidationException.java
Persistence and infrastructure
- Item persistence
src/main/java/tech/kood/rental/repository/ItemRepository.java - Rental persistence
src/main/java/tech/kood/rental/repository/RentalRepository.java - User persistence
src/main/java/tech/kood/rental/repository/UserRepository.java - SQLite database
src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java - Database schema
src/main/resources/schema.sql - Demo data seeding
src/main/java/tech/kood/rental/infrastructure/SeedData.java - Database errors
src/main/java/tech/kood/rental/repository/exception/DatabaseException.java - Duplicate usernames
src/main/java/tech/kood/rental/repository/exception/DuplicateUsernameException.java - Structured logging
src/main/java/tech/kood/rental/infrastructure/StructuredLogger.java
Account security
- BCrypt passwords
src/main/java/tech/kood/rental/security/PasswordHasher.java
Other components
- User
- SQLite file
Connections 36
- User → Command-line UI: uses
README.md - Application startup → Command-line UI: starts
src/main/java/tech/kood/rental/Main.java - Application startup → Registration and login: configures
src/main/java/tech/kood/rental/Main.java - Application startup → Listing management: configures
src/main/java/tech/kood/rental/Main.java - Application startup → Rent and return: configures
src/main/java/tech/kood/rental/Main.java - Command-line UI → Registration and login: invokes
src/main/java/tech/kood/rental/transport/CliHandler.java - Command-line UI → Listing management: invokes
src/main/java/tech/kood/rental/transport/CliHandler.java - Command-line UI → Rent and return: invokes
src/main/java/tech/kood/rental/transport/CliHandler.java - Registration and login → User persistence: reads and writes
src/main/java/tech/kood/rental/service/UserService.java - Registration and login → BCrypt passwords: hashes and verifies
src/main/java/tech/kood/rental/service/UserService.java - Registration and login → User validation: validates
src/main/java/tech/kood/rental/service/UserService.java - Listing management → Item persistence: queries and updates
src/main/java/tech/kood/rental/service/ItemService.java - Listing management → Item validation: validates
src/main/java/tech/kood/rental/service/ItemService.java - Rent and return → Item persistence: checks item state
src/main/java/tech/kood/rental/service/RentalService.java - Rent and return → Rental persistence: reads and writes
src/main/java/tech/kood/rental/service/RentalService.java - Rent and return → Rental validation: validates
src/main/java/tech/kood/rental/service/RentalService.java - Registration and login → Validation errors: raises
src/main/java/tech/kood/rental/service/UserService.java - Listing management → Validation errors: raises
src/main/java/tech/kood/rental/service/ItemService.java - Rent and return → Validation errors: raises
src/main/java/tech/kood/rental/service/RentalService.java - Item persistence → SQLite database: opens connections
src/main/java/tech/kood/rental/repository/ItemRepository.java - Rental persistence → SQLite database: opens connections
src/main/java/tech/kood/rental/repository/RentalRepository.java - User persistence → SQLite database: opens connections
src/main/java/tech/kood/rental/repository/UserRepository.java - SQLite database → SQLite file: persists records
README.md - SQLite database → Database schema: loads schema
src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java - Demo data seeding → SQLite file: creates demo data
README.md - Application startup → SQLite database: initializes
src/main/java/tech/kood/rental/Main.java - SQLite database → Structured logging: logs failures
src/main/java/tech/kood/rental/infrastructure/DatabaseConnection.java - Registration and login → Structured logging: logs workflow
src/main/java/tech/kood/rental/service/UserService.java - Listing management → Structured logging: logs workflow
src/main/java/tech/kood/rental/service/ItemService.java - Rent and return → Structured logging: logs workflow
src/main/java/tech/kood/rental/service/RentalService.java - Command-line UI → Database errors: handles
src/main/java/tech/kood/rental/transport/CliHandler.java - Command-line UI → Duplicate usernames: handles
src/main/java/tech/kood/rental/transport/CliHandler.java - User persistence → Duplicate usernames: signals duplicate
src/main/java/tech/kood/rental/repository/UserRepository.java - Item persistence → Database errors: wraps database failure
src/main/java/tech/kood/rental/repository/ItemRepository.java - Rental persistence → Database errors: wraps database failure
src/main/java/tech/kood/rental/repository/RentalRepository.java - User persistence → Database errors: wraps database failure
src/main/java/tech/kood/rental/repository/UserRepository.java