Code Monkey home page Code Monkey logo

adessokicker's Introduction

CircleCI

What is adesso kicker?

Adesso kicker is a web application for adesso coworkers to make playing foosball even more fun and to find out who is the best kicker player. Each person can login with Keycloak and record the result of matches they have played. Our web application is sending notifications and email to the other participants, so they can confirm valid games. Our internal ranking system based on elo will determine the skill of each person and position them into a ranking list. You can also look at each players statistics which will be also displayed in various charts at their profiles.

Screenshots

Record matches

alt text

Ranking list

alt text

User profile

alt text

Building

Before the project can be build the properties for a Keycloak and SMTP Server have to be set in application-prod.properties

Docker

To build with docker run docker build - t tag ..
If you want to cache the maven dependencies you can enable experimental docker features and run docker build -f experimental.Dockerfile -t tag ..
Afterwards run the container with docker run -d -p external_port:80 tag.
If you want to persist logs and database run docker run -d -p external_port:80 --mount source=kicker_logs,target=/kicker/logs --mount source=kicker_db,target=/kicker/db tag
This creates the volumes kicker_logs and kicker_db if they don't exist yet and persists logs and the database.

Maven

To build with maven you can use the maven wrapper and run ./mvnw package -DskipTests (or mvnw.cmd package -DskipTest on Windows) in the root directory to create a jar of the project in target.

adessokicker's People

Contributors

ccaylak avatar czarnecki avatar flo4l avatar janschneider1 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

s-gbz flo4l

adessokicker's Issues

Refactor user package and tests

The user package and tests have become somewhat outdated since the new specifications have been set. That's why they need a general clean-up.

Remove methods from UserController that don't belong there

The UserController has become a place where all general site functionality has been put into. It would be better if those methods were in their own class in another package.
These methods are:

  • impressum()
  • home()

Putting them into their own class would also prevent this from happening in the future.

Choose a ranking algorithm

For the ranking system that has to be implemented we need to decide on an algorithm.

Some possibilities from the top of my head are:

  • Glicko2
  • Elo

Frontend Functionality - ranking.html

  • Allow page to load ranking data
  • Implement pagination
  • Allow user to search a user in the searchbar and load the user and the users after him in the rankinglist
  • Show position of the logged-in user

Clone master to different branch and remove tournaments

The focus has shifted from tournaments to a ranking system. As part of the restructuring that comes with this we need to remove code that's not related/necessary for this.
We need to do the following:

  • Clone master to a different branch
  • Remove tournaments and teams from working branches that are still to be merged

Improve UX and design choices

First feedback on the new frontend showed different things to improve/change:

  • Orange color seems distracting and unfitting (change to black)
  • Less animation (more sutle animation if use of animation)
  • Change 'hitbox' of custom radiobuttons

Refactoring of the 'ressources' package in the frontend branch

I'm currently working with the new frontend, so for that I want to remove the old or unnecessary stuff.
So here are the thing I want to remove. If you have anything to add oder that you think we should keep, please raise your voice.

So I would suggest removing the following:

  • The old header and everything related (CSS)
  • The impressum
  • The old home page (we dont need it anymore) and everything related (JS and CSS)
  • 'simple_user_searchbar.html' (I did this and it isn't usable anymore)
  • Everything related to the matches except add as base for the 'match result form'
  • Everything related to login and registration as we use KeyCloak

I also would like discussing the following pages as I dont know which is really needed:

  • Football Icon (we use Fontawesome, so do we really need them, we don't use them anywhere)
  • There is a '_cookieWarning.js' and a 'cookieWarn.js' and there are in use BOTH. They only differ by one line of code, doesn't look like thats intended, we should only keep one)
  • Error pages 400 and 404 (they seem usable to me, but I'm not shure if you think so too)
  • Index.html (is outdated, we can make a new one if it is required)

Seeking for your Feedback!

Add ranking system based on ELO

After deciding on using ELO for the ranking system we now need to implement it into our application.
Rankings should be separate from our existing packages.
We also need to decide on how to handle the k-factor. Whether it should change with rating and how high it should be set.
We also need to decide on the initial rating a user should have.

Remove or fix User#showUsersSearchbar

The method has an empty catch block which catches any Exception.
I would suggest to either fix that or remove it completely as it's of questionable use at the moment.

Opinion on class names

I'm currently reading 'Java By Comparison' and I noticed how hard it can be to understand code, that has really long variable/class names. I think our situation isn't as bad as it was with 'SingleEliminationTournament' or 'MatchResultVerificationRequestRepository'. But still the name 'MatchVerificationRequest' bothers me. Specially when you have the connecting parts like 'MatchVerificificationRequestRepository', I think its really hard to understand what 'MatchVerificationRequest' stands for. The class is supposed to allow the users to verify if a team has won a match, lets take a look which words of 'MatchVerificationRequest' conway meaning:

Match -> The class is about a match, but how is the match relating to this class?
Verification -> The class is about verification, but this is not what it does this class 'verifies' a match
Request -> Is request necessary? Does it add any meaning? I don' think so.

So I personally would suggest changing the name to 'verifyMatch' as it is less confussing, and directly says what the class is suppossed to do to verify a match.

This suggestion might be a bit late, but reading this book, makes me really think about how hard it would be to read our code. I kindly look forward to your opinion and if you have other names that we should disuss to change

Frontend Functionality - User

Take the user logged-in user and do the following on these sites:

header.html

  • Display the user name
  • Enable the user to logout with the logout button

profile.html

  • Display the user name
  • Display the statistics of the user

matchresult.html

  • Display and set the user as a default value for the first player of the first team

Package naming inconsistency

Please change 'MatchVerificiationRequest' and 'Message' to lower case
like 'matchverificationrequest' and 'message' for naming consistency ;)

Restructure database model

As part of the restructuring the idea came up to rework the current database model. We need to layout how the new tables need to look and how the relationships look.

  • remove time in match
  • upload on github

Frontend Functionality - Notifications

header

  • Load notifications of the logged-in user in the dropdown
  • Accepting notification (AJAX request)
  • Deleting notification (AJAX request)
  • Display the count of unseen notifications
  • (Continiously update received notifications while on the site like a messaging service if possible)

Implement UserNotFound check in getUser

Currenty it's possible to search for non existing users. We need to handle it with UserNotFoundException. Catch it in the UserController and return a 404 status.

Update formatting rules to put chained methods into new lines each

Currently if you chain methods the spotless only put methods into a new line if it would be over the line limit.
For example:

mockMvc.perform(post("/matches/add").param("date", LocalDate.now().toString()).param("teamAPlayer1", "user")
                .param("teamBPlayer1", "user2")).andDo(print()).andExpect(model().attributeExists("noWinner"));

And I believe it would be more readable like this:

mockMvc.perform(post("/matches/add").param("date", LocalDate.now().toString())
.param("teamAPlayer1", "user")
.param("teamBPlayer1", "user2"))
.andDo(print())
.andExpect(model().attributeExists("noWinner"));

Use Spring Boot/Thymeleaf i18n

This would allow us to easier translate the program to different languages and makes it easier to adjust/change text.

Create new frontend based on mockups

Pages we need to create:

  • Header
  • Ranking
  • Profile
  • Matchresult

The goal of this issue is to create pages seperate to the backend. In the next sprint we would be able to plug in all functions from the backend.

Create Notification classes

  • Notifcation

  • NotificationType (enum)

  • NotificationService

  • NotificationRepository

  • NotificationController

  • MatchVerificationRequest

  • MatchVerificationRequestRepository

  • VerifyMatchService

  • Message

  • MessageType

  • MessageRepository

  • SendMssageService

  • NotificationNotExistingException

  • WrongReceiverException

  • MessageDummy

  • MatchVerificationRequestDummy

  • NotificationServiceTest

  • SendMessageServiceTest

  • VerifyMatchService

Implement Events

Implement an event API to allow Services to communicate with each other

  • MatchCreatedEvent
    • send requests
  • MatchDeclinedEvent
    • delete match
  • MatchVerifiedEvent
    • verify match
    • execute ranking

Match equals() isn't correctly implemented

These things are wrong in my opinion:

  1. Variable is named just 'o'
  2. The equals method doesnt follow the proper conformation
    (1. NULL-Check, 2. CLASS-Check, 3. EQUALS-Check)
    -> Comparing 'o' with == seems confusing to me
  3. The compare part is kinda long, maybe use the hash instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.