This is a repository that consists of a JavaFX app. This app can be used for managing units in a unit storage house. Based on if the user is a manager or employee the user can:
- Add and delete units (Only Manager)
- Add and remove a tenant from a unit.
The user also has an overview of the units and their status: if the unit is rented, location and size.
The application reads and stores date to JSON files. The user can choose if this happens remotely or locally.
The files for the application are located in the gr2232 folder. In hindsight we realize this folder should have had a more appropiate name. However, we believe it is not critical. The other files in the same location as this README are files for configuration of Gitpod and .gitgnore file for specifying untracted files Git should ignore.
For further reading and documentation, please have a look at the end of this page.
To launch the project in gitpod click on the "Gitpod Ready-to-code tag".
To launch the project locally you first need to clone or download the repository and open it as a Maven project in an IDE of choice. We recommed Vscode.
After opening the repository in gitpod or locally: Navigate into gr2232 folder. Execute the following command in your terminal:
foo@bar:~/gr2232/gr2232/
mvn install
Note that some tests will fail (ClosedChannelException) while running mvn install, due to requiring REST-server running.
Launch the REST-server by going into the rest folder and executing the following command.
foo@bar:~/gr2232/gr2232/rest
mvn spring-boot:run
The REST-server should now be up and running! Having the server running is needed to test the full functinality of the application.
Next create a new terminal instance and don't close the terminal with the rest server running! Everything should now work. Doublecheck using:
foo@bar:~/gr2232/gr2232/
mvn verify
If the build is a success we can finally run the JavaFX application!
The application is now ready to use. To run the project on your computer, navigate to the FXUI directory, and execute the following command:
foo@bar:~/gr2232/gr2232/fxui
mvn javafx:run
To use the rest-api and server simply press the "Use Rest?" at log in.
To log in as a manager you have to type the username: admin and the password: admin123
NOTE: If you use local storage (default). Rememeber that after adding units you can save them locally by clicking at the settings button and then naming the file and pressing save. The same thing if you want to load an file you previously had saved.
"Clear system?" clears all the units you have added from the application.
This project uses Spotbugs to find possible errors,bugs and vulnerabilities. Keep in mind Spotbugs will issue a Build Fail if any spotbugs are found. Project also uses Checkstyle to keep the same styling and indendation on the files. The projects also uses a test coverage plugin called jacoco. To run these plugins, execute the following command:
foo@bar:~/gr2232/gr2232
mvn verify
To see the test-coverage for the repository make sure you have allready executed mvn verify or mvn test.
Then navigate to the wished directory:
foo@bar:~/gr2232/gr2232/core/target/site/jacoco
foo@bar:~/gr2232/gr2232/fxui/target/site/jacoco
foo@bar:~/gr2232/gr2232/rest/target/site/jacoco
And open the corresponding index.html files. Note that you have to run maven test before looking at the test-coverage.
To create a shippable project, navigate to fxui-folder. Note that you need to have Wix installed to create an installer for Windows os. Then execute the following commands.
foo@bar:~/gr2232/gr2232/fxui/
foo@bar:~/gr2232/gr2232/fxui/$ mvn javafx:jlink
foo@bar:~/gr2232/gr2232/fxui/$ mvn jpackage:jpackage
foo@bar:~/gr2232/gr2232/fxui/target/dist
The installer should now be located inside the dist-directory.
Here is all the documentation in the repository.
Go here to view illustration, package-, sequences-, classdiagram of the application.
Go here to view documentation about the core module and the JSON-data files that are used
Go here to view documentation about the fxui module
Go here to view documentation about the rest module and the rest-api.
Go here to read about workhabits our use of tools and reason for late submission.
Go here to read about userstories used as a basis developing the application.
Go here to read about our reflection about type of persistence.