This is a project from the course Software Engineering og Testing at Østfold University College, the task was making a prototype and documentation of an application where a user can rent out a car.
-
Getting Started
-
Prerequisites
- Requirements for the software and other tools to build, test and push
-
Start the prototype
-
Running the tests
- Running the tests with coverage
-
Deployment
-
Authors
-
Acknowledgments
-
Usefull links used under development
Make sure to have a full copy of the project files stored locally on your computer and install all the necessary software which is described under.
The project should be able to run on any computer but, we have experienced some difficulty to make the project run.
The most reliable way has been running a clean installation of ubuntu linux in a virtual machine. We have mostly been
using Windows 11 for developing and running the project.
- Download and install IntelliJ: IntelliJ Download
- Make sure to have java JDK 18.0.2 installed: Java Download
- If java commands doesn't run from the terminal make sure that environment variables are set correctly: http://www.codebind.com/windows-11-tutorials/how-to-set-environment-variables-in-windows-11/
- If java commands doesn't run from the terminal make sure that environment variables are set correctly: http://www.codebind.com/windows-11-tutorials/how-to-set-environment-variables-in-windows-11/
- Then install Node.js 16.17.0 on your computer: Node Download
- IntelliJ have built in support for maven, but if you want to use maven commands from terminal you have to install maven on your computer: Maven Download
- Make sure that maven is in your enviroment variables: https://www.qamadness.com/knowledge-base/how-to-install-maven-and-configure-environment-variables/
- For some features from the framework to work a valid licence might be required, you can get a educational licence for free here:
- Github Student Developer Pack
- Vaadin Student Program
- Then download the Vaadin Designer plug-in in IntelliJ: Vaadin Designer Plug-in
- Try to open a TypeScript file in the ~frontend directory to open Vaadin Designer to log in to activate your license on your machine.
- For usage of GitHub install Git and log in to your GutHub account in settings -> version control -> GitHub in IntelliJ.
Build project module
mvn install -f pom.xml
Alternatively you can right-click on pom.xml or the project directory in IntelliJ and select Build Module 'tjenestedk'
Install dependencies:
npm install
If nessessary run:
npm audit fix --force
To start application right-click Application class and select Run 'Application'. Directory path: ~src/main/java/no/hiof/softeng2022gruppe23/tjenestedk/Application.java
Alternatively you can run the terminal command:
mvn
If that did not work try to run these commands. According to Vaadin's documentation are these the commands meant to be used for starting the application, but they did not work for us.
# Windows
mvnw
# Linux and macOS
./mvnw
Then open http://localhost:8080 in your browser if it doesn't appear automatically.
There are some different ways you can run the tests for the project, keep in mind that the tests that extends the UIUnitTest class require a Vaadin license to run, how to obtain a licence and log in is explained above in prerequisites.
Before running tests make sure that the ~src/test/java directory is marked as Test Sources Root in IntelliJ: https://resources.jetbrains.com/help/img/idea/2022.2/test-s-root.png
The recommended way to run the tests are by right-clicking on the project folder in IntelliJ and Run 'All tests' or right-click the test class and selecting "Run 'TestClassName'", all tests are located in the ~src/test/java directory
To run all tests from terminal use this command:
mvn test
If you want to run the tests with coverage right-click the test or folder to run multiple tests, the click More Run/Debug and Run 'All tests' with Coverage. We have previously run the test wit coverage and generated a report that's available if you open this HTML document in a browser: [Coverage report](src/main/resources/db-JSON-files/coverage report/index.html)
To create a production build, call mvnw clean package -Pproduction
(Windows),
or ./mvnw clean package -Pproduction
(Mac & Linux).
This will build a JAR file with all the dependencies and front-end resources,
ready to be deployed. The file can be found in the target
folder after the build completes.
Once the JAR file is built, you can run it using
java -jar target/tjenestedk-1.0-SNAPSHOT.jar
Taken from Vaadins offcial README file
- Mats-Hansen (Mats Hansen)
- haakonhp (Håkon Pedersen)
- fredandhiof (Fredrik Andersen)
- HaakonAtw (Håkon Nerby)
- Nozdub (Christian Aasen)
- Billie Thompson - Provided README Template - PurpleBooth
- GSON JSON file handling
- Thanks to JetBrains, GutHub and Vaadin for providing us with free tools and licenses that made this project possible.
- Thanks to Google for GSON which we use for JSON file handling.
- Thanks to the team for good team effort in the making of this project.
____________________________________________________________________________________________________________
Repo navn: Tjeneste https://github.com/SoftEng2022Gruppe23/Tjeneste
Manual/Vaadin readme: README_vaadin.md https://github.com/SoftEng2022Gruppe23/Tjeneste/blob/7f932ada91169f95aab48e97fc0f3e19d9a4e9e7/README_vaadin.md
https://github.com/vaadin
https://start.vaadin.com/app
https://vaadin.com/docs/latest/guide/step-by-step/importing/intellij
https://vaadin.com/docs/latest/tutorial/overview
https://vaadin.com/docs/latest/
https://vaadin.com/docs/latest/guide
https://vaadin.com/learn/training
Spring Boot Web App Tutorial (Java) | Full Course
https://youtu.be/bxy2JgqqKDU
____________________________________________________________________________________________________________
https://vaadin.com/docs/latest/testing
https://vaadin.com/docs/latest/testing/ui-unit
https://vaadin.com/docs/latest/testing/ui-unit/getting-started
https://github.com/vaadin/testbench-demo
____________________________________________________________________________________________________________
Git 101 Basics - Computer Stuff They Didn't Teach You #4
https://www.youtube.com/watch?v=WBg9mlpzEYU
Git Pull Requests explained - Computer Stuff They Didn't Teach You #5
https://www.youtube.com/watch?v=Mfz8NQncwiQ
GitHub branch rules (protect your git branches)
https://www.youtube.com/watch?v=CNCE1gts2Yw
Best Practices for Branch Protection
https://youtu.be/gUJ52Shwtm0
____________________________________________________________________________________________________________
To add an Issue template to a repository create a file called ISSUE_TEMPLATE in the root directory.
A file extension is optional, but Markdown files (.md) are supported.
Markdown support makes it easy to add things like headings, links, @-mentions, and task lists to your templates.
Pull Request templates follows the same pattern: add a file called PULL_REQUEST_TEMPLATE to the root directory of your repository.
If you’re worried about the added clutter in the root directory of your project, we also added support for a .github/ folder.
You can put CONTRIBUTING.md, ISSUE_TEMPLATE.md, and PULL_REQUEST_TEMPLATE.md files in .github/ and everything will work as expected.
https://github.com/devspace/awesome-github-templates
https://github.blog/2016-02-17-issue-and-pull-request-templates
https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions
____________________________________________________________________________________________________________
https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
https://github.com/github/gitignore
To tell Git to use the template file (globally, not just in the current repo), I used the following command:
IMPORTANT
git config --global core.excludesfile ~/.gitignore_global
In the current project directory
KAN være at du må kopiere .gitmessage til working directoryen til GIT, denne skal være c:\users$dinbruker$
IMPORTANT
https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
https://github.com/github/gitignore
____________________________________________________________________________________________________________
To tell Git to use the template file (globally, not just in the current repo), I used the following command:
IMPORTANT
git config --global commit.template ~/.gitmessage
In the current project directory
KAN være at du må kopiere .gitmessage til working directoryen til GIT, denne skal være c:\users$dinbruker$
Se på følgende bilde guide:
IMPORTANT
https://gist.github.com/median-man/3a7c4324005e96f02691f3a20aeac26b
https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template
____________________________________________________________________________________________________________
.github/.install/VERSION_DEPENDENCY.md
https://github.com/SoftEng2022Gruppe23/Tjeneste/blob/7f932ada91169f95aab48e97fc0f3e19d9a4e9e7/.github/.install/VERSION_DEPENDENCY.md
.github/.install/enviroment_variables.md
https://github.com/SoftEng2022Gruppe23/Tjeneste/blob/7f932ada91169f95aab48e97fc0f3e19d9a4e9e7/.github/.install/enviroment_variables.md
https://www.jetbrains.com/help/idea/configuring-project-and-ide-settings.html
https://www.jetbrains.com/help/idea/configure-project-settings.html
https://www.jetbrains.com/idea/guide/tutorials/configuring-intellij-idea/configuring-preferences-settings/
____________________________________________________________________________________________________________
____________________________________________________________________________________________________________