Welcome to ContactApp, a JavaFX-based contact management application built with Maven! This app allows you to create, view, update, and delete contacts with ease, featuring a sleek UI and robust database integration. Whether you're managing personal connections or professional networks, ContactApp has you covered! π
- Features
- Technologies
- Project Structure
- Setup Instructions
- Running the Application
- Testing
- Usage
- Screenshots
- Contributing
- License
- Add Contacts: Create new contacts with details like name, phone number, email, address, birth date, and an optional profile image. π
- View All Contacts: Browse a table of all contacts with search functionality to filter by name or phone number. π
- Edit Contacts: Update existing contact details with an intuitive form. βοΈ
- Delete Contacts: Remove contacts with a confirmation dialog for safety. ποΈ
- Image Support: Upload and display profile images for contacts. πΌοΈ
- Validation: Ensures required fields are filled and email addresses are valid. β
- Navigation: Seamless transitions between pages (Home, Add, View, Details, Delete). π
- Java: Version 17 (compatible with 23 with adjustments) β
- JavaFX: For the graphical user interface π¨
- Maven: Dependency management and build tool ποΈ
- JDBC: Database connectivity with SQLite (or your chosen DB) ποΈ
- JUnit 5: Unit testing framework π§ͺ
- Mockito: Mocking for unit tests π
- TestFX: Testing JavaFX components π€
- AssertJ: Fluent assertions for readable tests π
contactapp/
βββ src/
β βββ main/
β β βββ java/
β β β βββ org/project/contactapp/
β β β βββ controllers/ # JavaFX controllers
β β β β βββ AddContactController.java
β β β β βββ AllContactsController.java
β β β β βββ ContactDetailsController.java
β β β β βββ DeleteContactController.java
β β β β βββ HomePageController.java
β β β βββ daos/ # Data Access Objects
β β β βββ entities/ # Data models
β β β βββ utils/ # Utility classes
β β β βββ DatabaseConnection/ # DB connection utility
β β β βββ MainApp.java # Application entry point
β β βββ resources/
β β βββ org/project/contactapp/
β β βββ images/ # App images and screenshots
β β β βββ add_contact.png
β β β βββ allcontacts.png
β β β βββ contact_details.png
β β β βββ home.png
β β βββ *.fxml # FXML files for UI layouts
β βββ test/
β βββ java/
β βββ org/project/contactapp/
β βββ controllers/ # Unit tests for controllers
βββ pom.xml # Maven configuration
βββ README.md # You're reading it! π
- Java JDK: 17 or later (tested with 23, see notes below) β
- Maven: 3.6.0+ ποΈ
- Database: SQLite or your preferred JDBC-compatible database ποΈ
- IDE: IntelliJ IDEA, Eclipse, or any Java-supporting IDE (optional but recommended) π»
-
Clone the Repository:
git clone https://github.com/yourusername/contactapp.git cd contactapp -
Configure the Database:
- Update
dbConnection.javawith your database connection details (URL, username, password). - Ensure the
persontable exists with columns:id,lastname,firstname,nickname,phone_number,address,email_address,birth_date,image_path.
- Update
-
Install Dependencies:
mvn clean install
-
Java 23 Notes:
- If using Java 23, update Mockito and Byte Buddy in
pom.xmlto versions supporting Java 23 (e.g., Mockito 5.14.0+, Byte Buddy 1.15.7+), or downgrade to Java 17 for full compatibility with current dependencies.
- If using Java 23, update Mockito and Byte Buddy in
-
Compile and Run:
mvn javafx:run
-
Default Entry Point:
- The
MainAppclass launches the application, starting at thehome-page.fxml.
- The
-
Expected Output:
- A window opens with the Home page, offering "View Contacts" and "Add Contact" options.
- Execute all unit tests with:
mvn test
- Controllers: Tests for navigation, input validation, and database interactions.
- DAO: Tests for CRUD operations (
getAllPersons,savePerson,updatePerson,deletePerson). - Notes: UI-specific interactions (e.g.,
Alert,FileChooser) are not fully tested in unit tests; consider integration tests for complete coverage.
-
Home Page:
- Click "View Contacts" to see all contacts.
- Click "Add Contact" to create a new contact.
-
Add Contact:
- Fill in required fields (last name, first name, phone number).
- Optionally add nickname, address, email, birth date, and an image.
- Save to store the contact or cancel to return home.
-
View All Contacts:
- Browse contacts in a table.
- Search by name or phone number.
- Double-click a contact to view/edit details.
- Select a contact and click "Delete" to remove it.
-
Edit Contact:
- Update contact details and save or cancel to revert changes.
-
Delete Contact:
- Confirm deletion; successful deletion returns to the all contacts page.
Here are some screenshots showcasing the ContactApp in action!
We welcome contributions! Hereβs how to get involved:
- Fork the Repository.
- Create a Branch:
git checkout -b feature/your-feature-name
- Commit Changes:
git commit -m "Add your feature" - Push and Open a Pull Request:
git push origin feature/your-feature-name
- Follow Java coding standards and add tests for new features. π
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to the JavaFX community for an awesome UI framework!
- Shoutout to xAI for inspiring this assistant-driven documentation! π€
Happy coding, and enjoy managing your contacts with ContactApp! πΌ



