Skip to content

Merge Release/v1.0.0 into main #56

Merged
merged 130 commits into from
Mar 20, 2026
Merged
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
7e166c7
Resolved merge conflict
Feb 26, 2026
530223b
feat: created Organisation class
emilfa Feb 26, 2026
51a85e6
feat: made Organization into a record class + error handling + javadoc
emilfa Feb 26, 2026
fbbdab4
test: made unit tests for Organization
emilfa Feb 26, 2026
837cf93
feat[User]: add constructor and get methods
Feb 26, 2026
30a7212
Merge pull request #33 from Group-5/chore/folder-cleanup
fredrjm Feb 26, 2026
76e620f
feat: created OrganizationRepo class
emilfa Feb 26, 2026
98b995b
test: created OrganizationRepoTest class
emilfa Feb 26, 2026
aefd5ff
feat: created abstract class Repository
emilfa Feb 26, 2026
dc7bc8f
feat: minor changes to OrganizationRepo
emilfa Feb 26, 2026
b9693b7
feat[User]: Add Bcrpyt in verifying password in class and dependency …
Feb 26, 2026
509d48a
Merge branch 'main' into release/v1.0.0
Feb 26, 2026
99783a1
Merge branch 'main' into release/v1.0.0
Feb 26, 2026
e09c96d
feat[test]: add tests classes to visually display the folder structur…
Feb 26, 2026
fae604f
update: delete target by mvn clean
Feb 26, 2026
00cb18b
chore: fix merge conflict in pom.xml
Feb 26, 2026
8bd6986
test[User]: Add dependency for the Bcrypt, and add positive and Negat…
Feb 26, 2026
50b7c3a
update[User]: Add negative test scenario for null-inputs for better c…
Feb 26, 2026
1c15398
Merge pull request #37 from Group-5/feat/User
lucych Feb 26, 2026
e4b38a5
perf[User]: Improve User validation and update corresponding JUnit tests
Feb 28, 2026
77afc5c
Merge branch 'feat/organizationRepo' of git.ntnu.no:Group-5/Help-Me-H…
Mar 1, 2026
0523bce
test: added positive test for the constructor in OrganizationTest
Mar 1, 2026
ee4a9ca
test: created tests for the OrganizationRepository
emilfa Mar 1, 2026
e2c0f1a
refactor: minor changes to OrganizationRepository
emilfa Mar 1, 2026
7f88fa1
refactor: minor changes to OrganizationRepositoryTest
emilfa Mar 1, 2026
58965ef
feat[Wrapper]: add abstract class for wrappers
Mar 1, 2026
d9dff24
feat[OrgAPIWrapper]: add a wrapper for APIs
Mar 1, 2026
082c2a3
Made the Donation class with accessor-methods and javadoc
Mar 1, 2026
0b005bc
Tested constructor and getters for Donation
Mar 1, 2026
d838299
feat: created Repository
Mar 1, 2026
ccdc4a5
feat: created the abstract class DBRepository
Mar 2, 2026
a3752a2
feat&chore[Wrapper]: Add APIWrapper child class of Wrapper, and updat…
Mar 2, 2026
0db6023
Perf: Update model classes and write Customer class
Mar 2, 2026
7c90b5b
perf: Add exception handling to increase robust code
Mar 2, 2026
5787e12
refactor: DBRepository to use generics <K, V>
Mar 2, 2026
02c60a5
Update: update imports to Customer class
Mar 2, 2026
d608890
feat: convert Donation to record and add throws to constructor
Mar 2, 2026
3361b26
feat: implement DonationRepository with sorting and filtering methods
Mar 2, 2026
ae7f856
feat: added throw exceptions to DonationRepository
Mar 2, 2026
3335ba2
fix: fix logic when adding preferance
Mar 3, 2026
c4b2eac
update: update relationship between Customer and intermideary Donatio…
Mar 3, 2026
23c7524
refactor: made Repository use generics instead of Object type
emilfa Mar 3, 2026
662c4ce
refactor: made OrganizationRepository consistent with Repository
emilfa Mar 3, 2026
6b313cc
update[Customer]: update customer class to better suit the application
Mar 3, 2026
a8f6f9f
fix[DonationService]: Change timestamp syntax to better readability a…
Mar 3, 2026
81a0a43
refactor: made the positive test for Organization more robust
emilfa Mar 3, 2026
f97f5ee
Merge branch 'feat/organizationRepo' into feat/organisation
emilfa Mar 3, 2026
ba59aca
Merge branch 'release/v1.0.0' into feat/organisation
emilfa Mar 3, 2026
967fb50
Merge pull request #40 from Group-5/feat/organisation
fredrjm Mar 3, 2026
2e3bee8
Merge branch 'release/v1.0.0' into feat/User
Mar 3, 2026
b0614fd
test: added negative tests for DonationTest
Mar 3, 2026
c334f4e
merge: merge feat/wrapper into feat/user
Mar 3, 2026
dcc32bf
perf: increase performance of Organizationrepository
Mar 3, 2026
fecaec9
test[OrgAPIWrapper]: add tests for OrgAPIWrapper
Mar 3, 2026
59be68d
test[OrgAPIWrapper]: add tests for OrgAPIWrapper
Mar 3, 2026
da95605
merge: merge v1.0.0 into feat/wrapper
Mar 3, 2026
632e8fa
test: added positive and negative tests to DonationRepositoryTest
Mar 3, 2026
ba2d6ad
Merge pull request #41 from Group-5/feat/wrapper
fredrjm Mar 4, 2026
adce116
fix: fix Organizational classes by fixing constructor and JUnit tests
Mar 4, 2026
07dd8af
merge release/v1.0.0 into feat/User
Mar 4, 2026
e569363
style[Wrapper]: add javadocs and change formatting to conform to goog…
Mar 4, 2026
57f1fe4
style[OrgApiWrapperTest]: add javadocs and other formatting changes t…
Mar 4, 2026
9215175
Merge pull request #42 from Group-5/update/wrapper/add-javadoc
lucych Mar 4, 2026
f81c347
fix: fix login method's unnecessary String casting of char[] argument
Mar 5, 2026
e15478f
fix: resolved merge conflict and refactored DBRepository
Mar 5, 2026
be3995b
style[OrganizationRepository]: change style on method for better read…
Mar 5, 2026
e401d27
Merge pull request #44 from Group-5/feat/donation
emilfa Mar 5, 2026
fb67556
Fix: merge release/v1.0.0 into feat/User for finalization of the backend
Mar 5, 2026
e5689e8
feat: made App class work with JavaFX
emilfa Mar 5, 2026
6c34cfc
Fix: Fix OrganizationRepository constructor and update related classes
Mar 5, 2026
bb91d6e
feat: created a HeaderView component and made App work with JavaFX
emilfa Mar 5, 2026
4ac5cdd
perf: unify repository constructors, unify Backend classes, standardi…
Mar 7, 2026
eeff1df
Merge pull request #43 from Group-5/feat/wrapper
fredrjm Mar 7, 2026
3f13cfa
Merge branch 'release/v1.0.0' into feat/User
Mar 7, 2026
c3b7e40
feat: merge release/v1.0.0 into feat/User, fix up on differences in b…
Mar 7, 2026
a875a55
feat[DonationRepository]: Add filterByUser() method and respective JU…
Mar 7, 2026
6982dd9
Update&Test[Repository]: Update Repository and JUnit tests
Mar 10, 2026
54cd266
Merge pull request #45 from Group-5/feat/User
lucych Mar 10, 2026
a5aa3e0
feat: made a MainController and a HeaderController which make it poss…
emilfa Mar 10, 2026
446438a
Update&Test[Service]: Add get methods and tests to make the frontend …
Mar 10, 2026
1a9aef9
feat:add LoginPageView with image section
Mar 10, 2026
9b9e9db
feat(user): switch password handling to char[] and enforce BCrypt 72-…
Mar 10, 2026
b312097
feat[DbWrapper]: add methods for connecting to database
Mar 10, 2026
bdaeb1c
refactor: changed the file structure for resources connected to views
emilfa Mar 10, 2026
6bf7ee7
feat: added HomePageController for HomePageView
emilfa Mar 10, 2026
df5a249
feat: created HomePageView
emilfa Mar 10, 2026
eb54636
feat: made it so that logosection when clicked sends user to Homepage
emilfa Mar 10, 2026
f2c74cc
refactor: made app and MainView work together
emilfa Mar 10, 2026
16ce552
feat: made LoginHeader for LoginPageView
Mar 10, 2026
1e60e44
update&test[userService]: Test login with a passowrd char[0]
Mar 10, 2026
7802896
feat: merged feat/loginpage into feat/homepage
Mar 10, 2026
075f0e5
Merge pull request #49 from Group-5/feat/User
fredrjm Mar 10, 2026
1c56f3c
update[DbWrapper]: remove input for script and database paths
Mar 10, 2026
83063c9
fix: fixed placements of images
Mar 10, 2026
c1ce598
feat: add email, password fields and register navigation to LoginPage…
Mar 11, 2026
f200ee8
feat: add SignInPageView into MainView and controllers
Mar 11, 2026
73191e3
feat: merged release/v1.0.0 into feat/loginpage
Mar 11, 2026
de7e295
fix: a bug in App
Mar 11, 2026
37c7db7
feat: made SignInPageView and removed HeaderController from SignIn an…
Mar 11, 2026
bdd2284
refactor[wrapper]&feat[DbWrapper]: move wrapper classes to its own fo…
Mar 12, 2026
fe39dd0
refactor[wrapper-tests]: move wrapper tests to a wrapper subfolder
Mar 12, 2026
ea35d89
feat: created files associated with BrowsePage
emilfa Mar 12, 2026
05bb334
refactor: altered Controller structure for better coupling
emilfa Mar 12, 2026
8ee932d
feat: added showBrowsePage functionality to MainView and altered it t…
emilfa Mar 12, 2026
93e8a65
feat: created BrowsePage and a component for cards representing an or…
emilfa Mar 12, 2026
1b27911
style: minor style changes
emilfa Mar 12, 2026
a50cab8
refactor: changed spacing and stuff
emilfa Mar 12, 2026
c0556a1
update[DbWrapper]: add exception-throwing to export methods
Mar 12, 2026
73df8e6
feat: made DonationPageView
Mar 14, 2026
e6a2d09
feat: made PaymentCompletePageView and its controllers
Mar 14, 2026
24229ee
update[DbWrapper]: change excpetion handling and implement logging
Mar 15, 2026
f3a6e5a
test[DbWrapper]: add tests for both users and donations
Mar 15, 2026
06c135b
feat: made UserPageView and added connection to controllers and testd…
Mar 15, 2026
963d53f
feat: merged feat/wrapper into workaround/ntnu-git-is-suboptimal
Mar 16, 2026
74cf853
feat: created organization page
emilfa Mar 16, 2026
b356fbe
feat: merged feat/organizationpage into workaround/ntnu-git-is-subopt…
Mar 16, 2026
28eb0a1
fix&update[UserService]: change login to return a User, easier connec…
Mar 19, 2026
c650c5c
update6test[UserService]: add test to check return of correct user
Mar 19, 2026
04080ed
update[]: add session user to make it clear which user is logged in …
Mar 19, 2026
6901cd0
Update&feat[]: Connect backend to frontend by adding login, registrat…
Mar 19, 2026
44b0811
update[UserPageView]: Update Previous donations to have currency disp…
Mar 19, 2026
e746035
feat[app]: overwrite close method to export information to database o…
Mar 20, 2026
ab5ab06
fix[app]: properly call the stop super method when overriding
Mar 20, 2026
4444322
fix&test[model]: fix the repositories not only adding new rows
Mar 20, 2026
8676d9b
fix[DBWrapper]: Fix exporting of Donations to successfully export whe…
Mar 20, 2026
97be183
Merge pull request #53 from Group-5/feat/connectfrontback-2
lucych Mar 20, 2026
3acabc5
Merge pull request #54 from Group-5/feat/connectfrontback
lucych Mar 20, 2026
ae861cb
Merge pull request #55 from Group-5/workaround/ntnu-git-is-suboptimal
lucych Mar 20, 2026
d60c6d5
fix[user]: fix failing tests
Mar 20, 2026
1a99990
Merge pull request #57 from Group-5/fix/failingtests
lucych Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ out/
## VSCode
##############################
.vscode/

##############################
## Misc
##############################
.settings/*
.project
.classpath
482 changes: 482 additions & 0 deletions google_checks.xml

Large diffs are not rendered by default.

67 changes: 66 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,44 @@
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version>
<classifier>win</classifier>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-crypto -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>7.0.2</version>
</dependency>
</dependencies>
<!-- Source: https://mvnrepository.com/artifact/tools.jackson.core/jackson-databind -->
<dependency>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>6.1.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.2.224</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
Expand Down Expand Up @@ -86,6 +116,41 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
</plugin>

<!-- Fat JAR plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF.versions.9.module-info</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>edu.group5.app.App</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
98 changes: 94 additions & 4 deletions src/main/java/edu/group5/app/App.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,100 @@
package edu.group5.app;

import edu.group5.app.control.MainController;
import edu.group5.app.control.wrapper.DbWrapper;
import edu.group5.app.control.wrapper.OrgApiWrapper;
import edu.group5.app.model.donation.Donation;
import edu.group5.app.model.donation.DonationRepository;
import edu.group5.app.model.donation.DonationService;
import edu.group5.app.model.organization.OrganizationRepository;
import edu.group5.app.model.organization.OrganizationService;
import edu.group5.app.model.user.User;
import edu.group5.app.model.user.UserRepository;
import edu.group5.app.model.user.UserService;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.util.List;

import java.util.logging.Logger;

/**
* Hello world!
* Main entry point for the Help-Me-Help charity donation application.
* Handles database connection, data loading, and application setup.
*/
public class App {
public static void main(String[] args) {
System.out.println("Hello World!");
public class App extends Application {
DbWrapper dbWrapper;
UserRepository userRepository;
DonationRepository donationRepository;
private Logger logger;
private MainController controller;
private Scene scene;

@Override
public void init() {
this.logger = Logger.getLogger(App.class.getName());
this.logger.info("Application starting");

this.dbWrapper = new DbWrapper(false);
OrgApiWrapper orgApiWrapper = new OrgApiWrapper("https://app.innsamlingskontrollen.no/api/public/v1/all");

while (!dbWrapper.connect()) {
this.logger.warning("Failed to connect to database");
}

// Load data from database
List<Object[]> userData = dbWrapper.importUsers();
List<Object[]> donationData = dbWrapper.fetchAllDonations();
dbWrapper.disconnect();

// Load organizations from API
Object[] organizationData = new Object[0];
try {
if (orgApiWrapper.importData()) {
organizationData = orgApiWrapper.getData();
}
} catch (InterruptedException e) {
System.err.println("Failed to load organization data: " + e.getMessage());
}

// Create repositories with fetched data
this.userRepository = new UserRepository(userData);
this.donationRepository = new DonationRepository(donationData);
OrganizationRepository organizationRepository = new OrganizationRepository(organizationData);

// Create services (backend wiring)
UserService userService = new UserService(this.userRepository);
DonationService donationService = new DonationService(this.donationRepository, organizationRepository);
OrganizationService organizationService = new OrganizationService(organizationRepository);

this.controller = new MainController(userService, donationService, organizationService);

this.scene = controller.getMainView().getScene();
}

@Override
public void start(Stage stage) {
this.controller.showLoginPage();

stage.getIcons().add(new Image(getClass().getResource("/header/images/hmh-logo.png").toExternalForm()));
stage.setTitle("Help-Me-Help");
stage.setScene(this.scene);
stage.show();
}

@Override
public void stop() throws Exception {
super.stop();
this.logger.info("Application stopping");
this.dbWrapper.connect();
this.dbWrapper.exportUsers(this.userRepository.export());
this.dbWrapper.exportDonations(this.donationRepository.export());
this.dbWrapper.disconnect();
}

public static void main(String[] args) {
launch(args);
}
}
16 changes: 16 additions & 0 deletions src/main/java/edu/group5/app/control/BrowseCardController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package edu.group5.app.control;

import edu.group5.app.model.organization.Organization;

public class BrowseCardController {
private final MainController controller;

public BrowseCardController(MainController mainController) {
this.controller = mainController;
}

public void handleCardClick(Organization organization) {
controller.setCurrentOrganization(organization);
controller.showOrganizationPage();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package edu.group5.app.control;

public class BrowsePageController {
private final MainController controller;

public BrowsePageController(MainController mainController) {
this.controller = mainController;
}
}
28 changes: 28 additions & 0 deletions src/main/java/edu/group5/app/control/HeaderController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package edu.group5.app.control;

public class HeaderController {
private final MainController controller;

public HeaderController(MainController controller) {
this.controller = controller;
}

public void handleHomeBtn() {
System.out.println("Home button pressed");
controller.showHomePage();
}

public void handleCausesBtn() {
System.out.println("Causes button pressed");
controller.showBrowsePage();
}

public void handleAboutBtn() {
System.out.println("About button pressed");
}

public void handleProfileBtn() {
System.out.println("profileSection");
controller.showUserPage();
}
}
19 changes: 19 additions & 0 deletions src/main/java/edu/group5/app/control/HomePageController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package edu.group5.app.control;

public class HomePageController {
private final MainController controller;

public HomePageController(MainController controller) {
this.controller = controller;
}

public void handleDonateToACauseBtn() {
System.out.println("Donate to a cause button pressed");
controller.showBrowsePage();
}

public void handleAboutUsBtn() {
System.out.println("About us button pressed");
controller.showAboutUsPage();
}
}
44 changes: 44 additions & 0 deletions src/main/java/edu/group5/app/control/LoginPageController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package edu.group5.app.control;

import edu.group5.app.model.user.User;
import edu.group5.app.model.user.UserService;
import edu.group5.app.view.loginpage.LoginPageView;

public class LoginPageController {
private final MainController controller;
private final UserService userService;
private LoginPageView view;

public LoginPageController(MainController controller, UserService userService) {
this.controller = controller;
this.userService = userService;
}

public void setView(LoginPageView view) {
this.view = view;
}

public void handleLoginBtn() {
String email = view.getEmail();
char[] passwordChars = view.getPassword();

if (email == null || email.trim().isEmpty() || passwordChars == null || passwordChars.length == 0) {
view.showError("Email and password are required");
return;
}

User user = userService.login(email, passwordChars);

if (user != null) {
controller.setCurrentUser(user);
controller.showHomePage();
} else {
view.showError("Invalid email or password");
}
}

public void handleRegisterBtn() {
System.out.println("Sign in button pressed");
controller.showSignInPage();
}
}
Loading
Loading