diff --git a/README.md b/README.md index f186dda..ac54a61 100644 --- a/README.md +++ b/README.md @@ -1 +1,284 @@ -# Help-Me-Help +# Help-Me-Help - IDATT1005 Team 5 Portfolio Project Spring 2026 :octocat: + +**TEAM 5 STUDENT NAMES** + +
+
  • Emil Fagerjord
  • +
  • Mathea Gjerde
  • +
  • Fredrik Jonathan Marjoni
  • +
  • Lucy Ciara Herud-Thomassen
  • +
    + +## Project descriptionπŸ’» + +Help-Me-Help (HmH) is a Java desktop application, developed using Maven, designed to help users donate money to legitimate charitable organizations and emergency relief initiatives. +The application fetches verified organization data from Innsamlingskontrollen (IK), a non-profit foundation that verifies fundraising activities. +Users can create profiles, track their donation history, and browse organizations by status (approved/pending). +The application prioritizes security, data persistence, and an intuitive user experience following Don Norman's interaction design principles. + +## Key Features + +- User authentication and profile management +- Browse verified and pending organizations with descriptions and logos +- Make donations to organizations +- View donation history +- Data persistence using H2 database +- Web scraping of organization information (descriptions, logos) from external sources + +## Project structure πŸ“ + +--- +The project follows a standard Maven layout and is organized into clearly separated packages according to responsibility-driven design (RDD). +All source files are stored under the `src` directory. + +### Main Package Structure (`src/main`) + +
    +src/main/java/edu/group5/app/
    +β”œβ”€β”€ App.java                                      (JavaFX Application entry point)
    +|
    +β”œβ”€β”€ control/                                      (Controllers - business logic)
    +β”‚ β”œβ”€β”€ AuthController.java                         (User login/signup handling)
    +β”‚ β”œβ”€β”€ DonationController.java                     (Donation processing)
    +β”‚ β”œβ”€β”€ NavigationController.java                   (Page navigation)
    +β”‚ └── OrganizationController.java                 (Organization data access)
    +|
    +β”œβ”€β”€ model/                                        (Business entities & repositories)
    +β”‚ β”œβ”€β”€ organization/
    +β”‚ β”‚ β”œβ”€β”€ Organization.java                         (Organization entity)
    +β”‚ β”‚ β”œβ”€β”€ OrganizationRepository.java               (Data access for organizations)
    +β”‚ β”‚ β”œβ”€β”€ OrganizationService.java                  (Business logic)
    +β”‚ β”‚ └── OrganizationScraper.java                  (Web scraping - descriptions & logos)
    +β”‚ β”œβ”€β”€ user/
    +β”‚ β”‚ β”œβ”€β”€ User.java                                 (User base class)
    +β”‚ β”‚ β”œβ”€β”€ Customer.java                             (Customer implementation)
    +β”‚ β”‚ β”œβ”€β”€ UserRepository.java                       (Data access for users)
    +β”‚ β”‚ └── UserService.java                          (User authentication & registration)
    +β”‚ β”œβ”€β”€ donation/
    +β”‚ β”‚ β”œβ”€β”€ Donation.java                             (Donation entity)
    +β”‚ β”‚ β”œβ”€β”€ DonationRepository.java                   (Data access for donations)
    +β”‚ β”‚ └── DonationService.java                      (Donation processing)
    +β”‚ β”œβ”€β”€ wrapper/
    +β”‚ β”‚ β”œβ”€β”€ DbWrapper.java                            (H2 database connection & operations)
    +β”‚ β”‚ └── OrgApiWrapper.java                        (Innsamlingskontrollen API client)
    +β”‚ β”œβ”€β”€ AppState.java                               (Global application state)
    +β”‚ β”œβ”€β”€ Repository.java                             (Base repository abstract)
    +β”‚ └── DBRepository.java                           (Database repository abstract)
    +|
    +β”œβ”€β”€ view/                                         (JavaFX UI components)
    +β”‚ β”œβ”€β”€ loginpage/
    +β”‚ β”‚ β”œβ”€β”€ LoginPageView.java
    +β”‚ β”‚ β”œβ”€β”€ SignUpPageView.java
    +β”‚ β”‚ β”œβ”€β”€ LoginHeader.java
    +β”‚ β”‚ └── loginpage.css
    +β”‚ β”œβ”€β”€ homepage/
    +β”‚ β”‚ └── HomePageView.java
    +β”‚ β”œβ”€β”€ causespage/
    +β”‚ β”‚ β”œβ”€β”€ CausesPageView.java
    +β”‚ β”‚ β”œβ”€β”€ OrganizationCard.java
    +β”‚ β”‚ └── causespage.css
    +β”‚ β”œβ”€β”€ organizationpage/
    +β”‚ β”‚ β”œβ”€β”€ OrganizationPageView.java
    +β”‚ β”‚ └── organizationpage.css
    +β”‚ β”œβ”€β”€ donationpage/
    +β”‚ β”‚ β”œβ”€β”€ DonationPageView.java
    +β”‚ β”‚ β”œβ”€β”€ PaymentCompletePageView.java
    +β”‚ β”‚ └── donationpage.css
    +β”‚ β”œβ”€β”€ userpage/
    +β”‚ β”‚ └── UserPageView.java
    +β”‚ β”œβ”€β”€ aboutuspage/
    +β”‚ β”‚ └── AboutUsView.java
    +β”‚ └── Header.java
    +|
    +└── utils/
    +└── ParameterValidator.java                       (Input validation utilities)
    +
    +src/main/resources/                               (Static assets - CSS, images, etc.)
    +β”œβ”€β”€ header/
    +β”‚   └── images/
    +β”‚       └── hmh-logo.png                          (Application logo)
    +β”œβ”€β”€ loginpage/
    +β”‚   └── loginpage.css                             (Login/signup page styling)
    +β”œβ”€β”€ homepage/
    +β”‚   └── homepage.css                              (Home page styling)
    +β”œβ”€β”€ causespage/
    +β”‚   └── causespage.css                            (Organization browsing styling)
    +β”œβ”€β”€ organizationpage/
    +β”‚   └── organizationpage.css                      (Organization details styling)
    +└── donationpage/
    +    └── donationpage.css                          (Donation flow styling)
    +
    + +### πŸ“¦ Package Responsibilities + +#### Models: Business logic and data entities + +- `Organization`: Represents a charity/relief organization with status, logo, description +- `User` & `Customer`: User profiles with authentication +- `Donation`: Records of user donations +- Services and Repositories implement the business logic and data access layers + +#### Controller: Bridge between UI and business logic + +- `AuthController`: Handles user login/registration with password hashing (BCrypt) +- `OrganizationController`: Manages organization data retrieval and caching +- `DonationController`: Processes donations and updates user history +- `NavigationController`: Coordinates page navigation + +#### View: JavaFX UI components + +- Login/signup pages with form validation +- Organization browsing with filtering (approved/pending) +- Donation flow with payment confirmation +- User profile and donation history + +#### Utils: Helper functions + +- `ParameterValidator`: Validates null, empty, and positive values + +### JUnit Tests (`src/test`) + +The JUnit tests are stored under `src/test` and mirror the main package structure. These tests cover both positive and negative test of all classes (except `App.java` and UI classes) and their methods ensuring program reliability according to the specification given in the portofolie project descriptions +
    +src/test/java/edu/group5/app/
    +β”œβ”€β”€ AppTest.java                                    (Application startup tests)
    +β”œβ”€β”€ control/
    +β”‚   └── (Controller integration tests - to be added)
    +β”œβ”€β”€ model/
    +β”‚   β”œβ”€β”€ donation/
    +β”‚   β”‚   β”œβ”€β”€ DonationRepositoryTest.java            (Data access layer tests)
    +β”‚   β”‚   β”œβ”€β”€ DonationServiceTest.java               (Business logic tests)
    +β”‚   β”‚   └── DonationTest.java                      (Entity tests)
    +β”‚   β”œβ”€β”€ organization/
    +β”‚   β”‚   β”œβ”€β”€ OrganizationRepositoryTest.java        (Data access layer tests)
    +β”‚   β”‚   β”œβ”€β”€ OrganizationScraperTest.java           (Web scraping tests - 86% coverage)
    +β”‚   β”‚   β”œβ”€β”€ OrganizationServiceTest.java           (Business logic tests)
    +β”‚   β”‚   └── OrganizationTest.java                  (Entity tests)
    +β”‚   β”œβ”€β”€ user/
    +β”‚   β”‚   β”œβ”€β”€ CustomerTest.java                      (Customer entity tests)
    +β”‚   β”‚   β”œβ”€β”€ UserRepositoryTest.java                (Data access layer tests)
    +β”‚   β”‚   └── UserServiceTest.java                   (Authentication & registration tests)
    +β”‚   └── wrapper/
    +β”‚       β”œβ”€β”€ DbWrapperDonationsTest.java            (Database wrapper tests - donations)
    +β”‚       β”œβ”€β”€ DbWrapperUserTest.java                 (Database wrapper tests - users)
    +β”‚       └── OrgApiWrapperTest.java                 (API client tests)
    +β”œβ”€β”€ utils/
    +β”‚   └── ParameterValidatorTest.java                (Input validation tests)
    +└── view/
    +    └── ViewTest.java                              (UI component tests)
    +
    + +### Maven Layout + +The project uses the standard Maven directory structure, which ensures: + +- clean separation of source and test files +- compatibility with IDEs such as IntelliJ, VS Code, and Eclipse +- maintainability and easy future extensions (e.g., persistence or additional views) + +## Link to repositoryπŸ“š + + + +## How to run the projectπŸ“ + +**Requirements:** + +- Java JDK 25 +- Maven +- JavaFX SDK 25.0.1-- + +**Run With Maven:** (Windows + Mac + Linux) + +1. **Download and Unzip Project:** + Download project zip from the repository. + +2. **Navigate to Project Folder:** + Navigate to project folder in the terminal. + + ```bash + cd path/to/project/ (linux + mac) + cd path\to\project\ (windows) + ``` + +3. **Run the Application:** + Start the program by running the main class: + + ```bash + mvn javafx:run + ``` + +**Run From JAR: (Windows)** + +1. Download Project JAR: + Go to repository and download the JAR. + +2. Run the JAR in Terminal: + + ```bash + java --module-path "path\to\javafx\sdk" --add-modules javafx.controls -jar path\to\jar.jar + + +- Input: User interactions (login, organization selection, donation amount) +- Output: JavaFX UI displaying organizations, user profiles, donation confirmations + +1. **Expected behavior:** +
    + +The program allows the user to: + +- Login/signup with validation +- Browse approved organizations from Innsamlingskontrollen API +- View organization details (description, logo, status) +- Complete donation workflow +- View donation history in user profile +- Graceful error handling with user-friendly messages + +--- + +## How to run the tests πŸ§ͺ + +This project uses JUnit 5 for unit testing. +All test classes mirror the main package structure and are stored in `src/test` + +- ### Open the Project + + Open your IDE and select **File > Open Folder**, navigating to the root folder of the project (containing `pom.xml`). + +- ### Run all tests + + To execute the full test suite, run: + + ```bash + mvn clean test + +This command: + + 1. Cleans old build files + 2. Compiles the main source code + 3. Compiles the tests + 4. Runs all JUnit tests + +--- + +### Viewing test results + +After the tests finish, Maven creates detailed reports here: +`target/surefire-reports/` + +Each report includes: + + 1. Test class summaries + 2. Stack traces for any failures + 3. Execution times + 4. Running tests in an IDE + +## References πŸ”— + +For more references and project details, kindly refer yourself to the project report and Wiki pages + +- **GitHub Wiki**: [GitHub Wiki](https://git.ntnu.no/Group-5/Help-Me-Help/wiki) + +- **Innsamlingskontrollen API**: [Innsamlingskontrollen](https://app.innsamlingskontrollen.no/api/public/v1/all) + +---