Skip to content

dm-mensavi/contacts_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


ContactApp πŸ“‡

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! πŸš€


Table of Contents


Features ✨

  • 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). 🌐

Technologies πŸ› οΈ

  • 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 πŸ“œ

Project Structure πŸ“‚

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! 😊

Setup Instructions βš™οΈ

Prerequisites

  • 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) πŸ’»

Steps

  1. Clone the Repository:

    git clone https://github.com/yourusername/contactapp.git
    cd contactapp
  2. Configure the Database:

    • Update dbConnection.java with your database connection details (URL, username, password).
    • Ensure the person table exists with columns: id, lastname, firstname, nickname, phone_number, address, email_address, birth_date, image_path.
  3. Install Dependencies:

    mvn clean install
  4. Java 23 Notes:

    • If using Java 23, update Mockito and Byte Buddy in pom.xml to 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.

Running the Application πŸƒβ€β™‚οΈ

  1. Compile and Run:

    mvn javafx:run
  2. Default Entry Point:

    • The MainApp class launches the application, starting at the home-page.fxml.
  3. Expected Output:

    • A window opens with the Home page, offering "View Contacts" and "Add Contact" options.

Testing πŸ§ͺ

Running Tests

  • Execute all unit tests with:
    mvn test

Test Coverage

  • 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.

Usage πŸ“‹

  1. Home Page:

    • Click "View Contacts" to see all contacts.
    • Click "Add Contact" to create a new contact.
  2. 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.
  3. 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.
  4. Edit Contact:

    • Update contact details and save or cancel to revert changes.
  5. Delete Contact:

    • Confirm deletion; successful deletion returns to the all contacts page.

Screenshots πŸ“Έ

Here are some screenshots showcasing the ContactApp in action!

Home Page

Home Page

All Contacts Page

All Contacts

Add Contact Page

Add Contact

Contact Details Page

Contact Details


Contributing 🀝

We welcome contributions! Here’s how to get involved:

  1. Fork the Repository.
  2. Create a Branch:
    git checkout -b feature/your-feature-name
  3. Commit Changes:
    git commit -m "Add your feature"
  4. Push and Open a Pull Request:
    git push origin feature/your-feature-name
  • Follow Java coding standards and add tests for new features. πŸ™Œ

License πŸ“œ

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments 🌟

  • 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! πŸ’Ό


About

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! πŸš€

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages