diff --git a/README.md b/README.md index af2a3dd..4313ac2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Help-Me-Help - IDATT1005 Team 5 Portofolio Project Spring 2026 :octocat: +# Help-Me-Help - IDATT1005 Team 5 Portofolio Project Spring 2026 :octocat: [//]: # (TODO: Fill inn your name and student ID) [//]: # (TODO: Mappe-2025-Marjoni-fj) @@ -14,7 +14,16 @@ ## Project descriptionπŸ’» [//]: # (TODO: Write a short description of your project/product here.) -This Java-based application, developed using Maven... +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 πŸ“ @@ -25,19 +34,106 @@ 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 interface)
+β”‚ └── DBRepository.java (Database repository interface)
+|
+β”œβ”€β”€ 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/
+β”œβ”€β”€ header/
+β”‚   └── images/
+β”‚       └── hmh-logo.png
+β”œβ”€β”€ loginpage/
+β”‚   └── loginpage.css
+β”œβ”€β”€ homepage/
+β”‚   └── homepage.css
+β”œβ”€β”€ causespage/
+β”‚   └── causespage.css
+β”œβ”€β”€ organizationpage/
 
+ [//]: # (TODO: Describe the structure of your project here. How have you used packages in your structure. Where are all sourcefiles stored. Where are all JUnit-test classes stored. etc.) ### πŸ“¦ Package Responsibilities -#### Models +#### 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 +#### Controller: Bridge between UI and business logic -#### View +- `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 -#### Utils +#### 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`) @@ -49,9 +145,9 @@ The JUnit tests are stored under `src/test` and mirror the main package structur 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) +- 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) --- @@ -69,9 +165,10 @@ What is the input and output of the program? What is the expected behaviour of t **Requirements:** -* Java JDK 25 -* Maven -* IDE (Ideally IntelliJ or VSCode with Java Extension Pack) +- Java JDK 25 +- Maven +- IDE (Ideally IntelliJ or VSCode with Java Extension Pack) + **Steps:** 1. **Clone repository** @@ -94,12 +191,18 @@ What is the input and output of the program? What is the expected behaviour of t 5. **Input and Output** -* Input: -* Output: +- Input: User interactions (login, organization selection, donation amount) +- Output: JavaFX UI displaying organizations, user profiles, donation confirmations 1. **Excpected 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 πŸ§ͺ @@ -107,11 +210,11 @@ The program allows the user to: 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 the Project Open VS Code and select **File > Open Folder**, navigating to the root folder of the project (containing `pom.xml`). -* ### Run all tests +- ### Run all tests To execute the full test suite, run: @@ -127,7 +230,7 @@ This command: --- -* ### Viewing test results +- ### Viewing test results After the tests finish, Maven creates detailed reports here: `target/surefire-reports/`