How shariarratul/java-password-manager works
1. Project type and runtime
- This is a small Java console application with a single-process, local-only architecture.
- There is no web server, database, or external API; the entire app runs from Main.java and uses the local filesystem for persistence.
2. Entry point / orchestration
- Main.java is the top-level controller.
- It presents the menu-driven CLI, collects user input, and coordinates the two main actions:
1. generate a password and save a credential record
2. read and display previously saved credentials
3. Password generation subsystem
- PassGenerator.java is responsible for creating random passwords.
- The README indicates the user supplies a password length, and the generator returns a strong random string.
- This is a pure utility-style component: it does not own storage or UI; it just produces password values for the rest of the app.
4. Credential record model
- SinglePass.java appears to represent one saved credential entry.
- The logical fields are the ones shown in the README: website, email, and password.
- This class is the in-memory data boundary between UI/generation and persistence.
5. Persistence subsystem
- StoredPasswords.java handles reading and writing the saved credentials.
- The persistence format is plain text in savedpass.txt, with one record per line in comma-separated form, such as example.com,user@example.com,pFQi2R_c7zs8.
- The storage location is the user’s AppData/Local folder, which is a local OS-specific boundary rather than an application-managed database.
6. Data flow when saving a new password
- User input enters through Main.java.
- Main sends the requested length to PassGenerator.
- The generated password is combined with website and email into a SinglePass record.
- StoredPasswords writes that record to savedpass.txt in AppData.
7. Data flow when viewing saved passwords
- User selects the “see saved passwords” path from the CLI.
- Main.java delegates to StoredPasswords.
- StoredPasswords reads the text file, reconstructs records, and returns them for display in the console.
8. Boundary between transient and durable data
- In-memory data is represented by SinglePass.
- Durable state lives only in the text file under AppData.
- There is no encryption, synchronization, or server-side storage, so the filesystem is the main persistence boundary.
9. Security posture
- The README explicitly states that data is stored in plain text.
- From an architecture standpoint, this means the app prioritizes simplicity over confidentiality and should be diagrammed as a local, unsecured credential store.
10. Technology and packaging implications
- The repository appears to use the default package layout with separate .java source files rather than a layered package structure.
- That suggests a lightweight, educational codebase with direct class-to-class calls instead of dependency injection or modular subsystems.
11. What to show in an architecture diagram
- Draw one user-facing CLI boundary around Main.java.
- Show PassGenerator.java as a utility called by Main.
- Show SinglePass.java as the data object passed between components.
- Show StoredPasswords.java connected to the local filesystem (savedpass.txt in AppData).
- The key external dependency is the local OS file system, not any network service.
12. Overall architecture summary
- This repository is a small, three-layer logical design:
- UI/orchestration: Main
- domain/utilities: PassGenerator and SinglePass
- persistence: StoredPasswords
- The main end-to-end flow is: console input → password generation → record creation → file write/read → console output.
Main entry points: Main.java Main · StoredPasswords.java Storage · SinglePass.java Credential · PassGenerator.java PassGen
Components 5
CLI
Console entry point and user interaction
- Main · Menu-driven entry point that collects input and coordinates app actions
Main.java
Core
Password generation and record model
- PassGen · Generates random passwords of requested length
PassGenerator.java - Credential · In-memory credential entry with website, email, and password
SinglePass.java
Storage
Local file persistence
- Storage · Reads and writes saved credentials as plain-text records
StoredPasswords.java - AppData file · OS-local durable storage boundary for saved credentials
Connections 7
- Main → PassGen: generate · Requests a password of the chosen length
- Main → Credential: build · Combines user input and generated password into a credential record
- Main → Storage: save/read · Delegates persistence and retrieval operations
- PassGen → Credential: value · Supplies generated password data used in the record
- Storage → Credential: serialize · Converts records to and from text lines
- Storage → AppData file: write/read · Persists plain-text credentials under the local AppData folder
- Main → AppData file: display · Shows persisted credentials after retrieval