Skip to content

sopra-fs23-group-15/envisage-server

Repository files navigation

Envisage

envisageAsBanner

Introduction

In ENVISAGE, you and your friends can compete against each other over multiple rounds to create the best AI generated masterpieces. At the beginning of the first round, you are given a picture from the category you choose and an image style as a requirement. Your task is to generate an image as close as possible to the requirements. At the end of each round, you get to vote on your favorite picture (not your own!) and the best picture is given as the prompt for the next round with a different style requirement. The process continues till the final round is completed and a winner is declared based on the accumulated votes.

You can play Envisage here.

Technologies

Programming Language: Java

  • Spring Boot
  • JPA
  • Communication with the client
    • REST
    • Stomp (websockets)
  • External APIs
  • Testing
    • JUnit
    • Mockito
  • Hosted on Google App Engine

High-level components

The lobby keeps track of the players which can join a lobby with a lobby pin. Furthermore, the lobby knows how long one round is and how many rounds are going to be played. The lobby has a one-to-one relation with a game entity.

The game has a one-to-many relation with the round entity. The game has as well a one-to-many relation with the playerscore entity. If the players decide to restart a game, the old game will be deleted and a new game entity will be created and linked to the lobby.

The ChallengeService is responsible for creating a challenge. A challenge consists of a category which gets passed from the client to the server. The prompt image for the first round is then chosen according to the category. For the subsequent rounds the prompt image is the winning image of the previous round. Furthermore, the challenge has a style requirement. Style requirements are artists or art styles.

The PlayerImageService handles all resposibilities concerning a playerImage. First of all it handles the creation of an image. We use the DALL-E API to create unique images according to a prompt the player has entered. Furthermore, the playerImage service is responsible to retrieve playerImages from the database.

Launch & Deployment

Prerequisites

Clone the server repository:

git clone [email protected]:sopra-fs23-group-15/envisage-server.git

Build

Run the following command to build the application:

./gradlew build

Run

Run the application with the following command:

./gradlew bootRun

By visiting localhost:8080 in your browser, you can verify that the server is running.

Test

Run the tests with:

./gradlew test

Deployment

The application is hosted on Google App Engine. A push to the main will automatically lead to the deployment to the Google App Engine.

Roadmap

  • Play with anyone in the world by introducing waiting lobbies
  • Ability to download your images
  • Accounts to save player stats and their generated images
  • Disappearing Mode (images disappear after a while and are not displayed for the entire round duration)

Authors and acknowledgment

We would like to thank our mentor Valentin Hollenstein - v4lentin1879 for supporting us throughout the project.

License

This project is licensed under Apache-2.0 license.