haakonhp / tjeneste

Group Exam for Software Engineering at Hiof year 2022

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gruppe 23 Software Engineering og Testing gruppeoppgave

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.

Table of contents

  • 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

Getting Started

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.

Prerequisites

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.

Requirements for the software and other tools to build, test and push

Start the prototype

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.

Running the tests

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 

Running the tests with coverage


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)

Deployment to production

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

Authors

  • Mats-Hansen (Mats Hansen)
  • haakonhp (Håkon Pedersen)
  • fredandhiof (Fredrik Andersen)
  • HaakonAtw (Håkon Nerby)
  • Nozdub (Christian Aasen)

Sources / Reference list

Acknowledgments

  • 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.


____________________________________________________________________________________________________________

Usefull links used under development:

Prosjektet:

App navn: no.hiof.softeng2022gruppe23.tjeneste

Inkluderer Docker og Kubernetes config

Framework:

https://github.com/vaadin
https://start.vaadin.com/app

Vaadin guides (coding):

Hvordan importere prosjektet til IntelliJ:

https://vaadin.com/docs/latest/guide/step-by-step/importing/intellij

Introduction to Vaadin Designer with IntelliJ IDEA:

https://youtu.be/oFBe8DLCn-s

Building Modern Web Applications with Spring Boot and Vaadin:

https://vaadin.com/docs/latest/tutorial/overview

Vaadin Docs Develop Web Apps in Java:

https://vaadin.com/docs/latest/

Quick Start Guide:

https://vaadin.com/docs/latest/guide

Training videos and certifications:

https://vaadin.com/learn/training

Hele Kurs:

Spring Boot Web App Tutorial (Java) | Full Course
https://youtu.be/bxy2JgqqKDU
____________________________________________________________________________________________________________

Testing:

Testing Vaadin Applications Using TestBench:

https://vaadin.com/docs/latest/testing

UI Unit Testing:

https://vaadin.com/docs/latest/testing/ui-unit

Getting Started with UI Unit Testing:

https://vaadin.com/docs/latest/testing/ui-unit/getting-started

TestBench Demo:

https://github.com/vaadin/testbench-demo
____________________________________________________________________________________________________________

Essential guides GitHub:

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

____________________________________________________________________________________________________________

Issue and Pull Request templates:

Git Configuration:

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
____________________________________________________________________________________________________________

Gitignore / Gitignore Global USAGE:

Git Configuration:

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
____________________________________________________________________________________________________________

Commit Template USAGE:

Git Configuration:

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:
Step1
Step2
IMPORTANT

https://gist.github.com/median-man/3a7c4324005e96f02691f3a20aeac26b
https://thoughtbot.com/blog/better-commit-messages-with-a-gitmessage-template
____________________________________________________________________________________________________________

Set-up IntelliJ:

Install the following plug-ins:

https://hiof.sharepoint.com/:x:/r/sites/SoftEng2022Bibliotek/_layouts/15/Doc.aspx?sourcedoc=%7B12CBB9EC-70AC-4D79-8976-B0F70CE11820%7D&file=1301%20Versjonsliste%20over%20programvare%20for%20prosjektet.xlsx&action=default&mobileredirect=true

or look at the project version dependency:

.github/.install/VERSION_DEPENDENCY.md
https://github.com/SoftEng2022Gruppe23/Tjeneste/blob/7f932ada91169f95aab48e97fc0f3e19d9a4e9e7/.github/.install/VERSION_DEPENDENCY.md

And look at what you need to have as enivorment variables in windows:

.github/.install/enviroment_variables.md
https://github.com/SoftEng2022Gruppe23/Tjeneste/blob/7f932ada91169f95aab48e97fc0f3e19d9a4e9e7/.github/.install/enviroment_variables.md

How to change settings/default settings:

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/

____________________________________________________________________________________________________________


____________________________________________________________________________________________________________

About

Group Exam for Software Engineering at Hiof year 2022

License:The Unlicense


Languages

Language:HTML 73.9%Language:Java 20.9%Language:TypeScript 4.2%Language:CSS 0.5%Language:JavaScript 0.4%Language:Dockerfile 0.1%