How ayushd64/my_address_book works
1. Project type and runtime
- This is a Java desktop application built with Swing and run as a standalone JVM app.
- There is no server tier or web frontend; the UI, control flow, and database access live in the same client application.
2. Repository layout
- The real application source is under address_book/src/address_book.
- bin/address_book contains compiled output.
- The repo also includes IDE/workspace metadata (.metadata) and bundled libraries/images, which affect local development and runtime packaging but not the core domain model.
3. Entry point and startup flow
- BBB.java is the main entry class.
- It appears to show a splash screen first, then transitions into the login screen.
- The app’s startup sequence is therefore: launch JVM → splash screen → login window → main application window on successful authentication.
4. Authentication subsystem
- menu.java implements the login screen.
- Credentials are checked against the MySQL log_in table.
- The app supports updating credentials through log.java, so login data is persisted in the same database rather than external config.
5. Main contact-management subsystem
- mainwindow.java is the central working screen for the address book.
- It is responsible for displaying contacts and coordinating actions like search, edit, delete, and opening create/update dialogs.
- This is the primary navigation hub after login.
6. Contact creation and editing
- nw.java is the new contact window.
- edit.java is the edit contact window.
- These are separate UI flows, likely opened from the main window as modal or secondary forms, and they write changes back to the info table.
7. Login settings/update flow
- log.java handles updating the username and password.
- This is a separate administrative form, but it uses the same persistence layer as the login screen.
- The README indicates passwords are entered in masked form, which is a UI concern handled here.
8. Persistence and data model
- The application uses JDBC with the MySQL Connector library bundled in address_book/lib.
- The database is named address_book and has two tables:
- info for contact records
- log_in for authentication credentials
- Contact fields include name, age, phone/mobile, gender, address, email, DOB, and created date/time.
9. Data flow across the app
- User actions in Swing forms trigger JDBC calls directly to MySQL.
- Login reads from log_in.
- Contact CRUD screens read/write info.
- Search in the main window filters the contact list against the stored contact data.
- There is no evidence of an intermediate service layer or ORM; the architecture is a thin UI-over-database design.
10. UI assets and presentation
- ab.jpg and olpa.jpg are runtime image assets used for the splash and login screens.
- The app depends on these files being present in src/address_book, so presentation assets are part of the application package boundary.
11. External dependency boundary
- The only material external service is MySQL Server.
- The app expects a running local/remote MySQL instance with the correct schema and credentials configured in code.
- The bundled connector JAR is required to bridge Swing/JVM code to the database.
12. Operational characteristics
- The app is stateful through the database, not through local files.
- The UI appears to be mostly form-based, with each major action mapped to a dedicated screen or dialog.
- Validation and error handling are part of the UI layer, but persistence failures still depend on the database being reachable.
13. Architecture summary for diagramming
- A good diagram would show:
- User interacting with multiple Swing windows
- BBB as the launcher/splash coordinator
- menu as authentication gate
- mainwindow as the main contact hub
- nw, edit, and log as supporting dialogs
- all of them connecting directly via JDBC to a MySQL address_book database
- shared assets (ab.jpg, olpa.jpg) feeding the presentation layer
Main entry points: mainwindow.java Main window · menu.java Login · mysql-connector-java-5.1.38-bin.jar JDBC · BBB.java BBB
Components 15
Swing app
Desktop windows and startup flow
- BBB · Main entry point; shows splash and starts the app
address_book/src/address_book/BBB.java - Login · Login screen that validates credentials
address_book/src/address_book/menu.java - Main window · Primary address book screen for browse, search, edit, delete
address_book/src/address_book/mainwindow.java - New contact · Creates contact records
address_book/src/address_book/nw.java - Edit contact · Updates existing contact records
address_book/src/address_book/edit.java - Credentials · Updates login username and password
address_book/src/address_book/log.java
Persistence
JDBC access and MySQL tables
- JDBC · Direct SQL access from Swing to MySQL
address_book/lib/mysql-connector-java-5.1.38-bin.jar - MySQL · Runtime database server
- address_book db · Application database
- info table · Stores contact records
- log_in table · Stores login credentials
- Contact data · Name, age, phone, gender, address, email, DOB, timestamps
Runtime assets
Bundled images and connector library
- Splash art · Splash-screen image resource
- Login art · Login-screen image resource
Other components
- User · Operates the desktop app
Connections 21
- User → BBB: launches · Starts the desktop application
- BBB → Splash art: shows · Displays splash artwork
- BBB → Login: opens · Transitions from splash to login
- Login → Login art: uses · Renders login presentation assets
- Login → JDBC: queries · Checks credentials through JDBC
- Login → log_in table: reads · Validates against stored login rows
- Login → Main window: auth success · Enters main app after successful login
- Main window → New contact: opens · Starts new-contact flow
- Main window → Edit contact: opens · Starts contact-edit flow
- Main window → Credentials: opens · Starts credential-update flow
- Main window → info table: reads/writes · Loads, searches, updates, and deletes contacts
- New contact → JDBC: writes · Persists new contact rows
- Edit contact → JDBC: updates · Persists edited contact rows
- Credentials → JDBC: updates · Persists login credential changes
- JDBC → MySQL: connects · Uses bundled MySQL connector to reach server
- MySQL → address_book db: hosts · Provides the application schema
- address_book db → info table: contains · Contact records table
- address_book db → log_in table: contains · Authentication table
- Main window → Contact data: maps to · Displays and edits contact fields
- New contact → Contact data: creates · Builds new contact records
- Edit contact → Contact data: modifies · Changes contact records