Giter Site home page Giter Site logo

dirkriehle / wahlzeit Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 309.0 15.51 MB

The Wahlzeit Java framework for Photo Sharing and Rating websites

Home Page: http://wahlzeit.org

License: GNU Affero General Public License v3.0

Java 82.26% CSS 0.59% JavaScript 0.36% HTML 16.58% Dockerfile 0.21%

wahlzeit's Introduction

Wahlzeit: Open Source Software for Photo Rating Sites

Introduction

Wahlzeit is an open source web application that lets users upload photos and rate photos of other users on a 1..10 scale. Users get to present their best photos and learn what other users thought of theirs.

Wahlzeit is used to teach agile methods and open source software development at the Professorship of Open Source Software at the Friedrich-Alexander-University of Erlangen-Nürnberg.

It is an easy-to-learn yet complete Java web application that is available under the GNU Affero Public License v3 license, see the LICENSE.txt file.

For more information, please see http://github.com/dirkriehle/wahlzeit and http://osr.cs.fau.de.

Wahlzeit Setup

  • Install Java JDK 8 or higher. We recommended you to use Java JDK 11.
  • An easy way to manage Java JDKs and JREs is by using SDKMAN. With SDKMAN you can install the Java SDK with the following command: sdk install java 11.0.8.j9-adpt
  • Ensure java -version can be executed from the command line.
  • [optional] Install Docker and Docker Compose to use the container deployment option.
  • Create your own repository by forking Wahlzeit from dirkriehle to your GitHub-account.

Windows user have to clone the repository with the following command; otherwise it will cause problems during the Docker build:

git clone YOUR_URL --config core.autocrlf=input

PostgreSQL Database

Wahlzeit stores its data in a PostgreSQL database. Therefore, an PostgreSQL instance need to be reachable if you start Wahlzeit.

The easiest way to run a PostgreSQL instance is via Docker and Docker Compose.

With docker-compose up db adminer you can start PostgreSQL as Docker container. It will also start Adminer which is a simple database management ui. It allows you to query the database and alter tables within the database. You can access the ui via http://localhost:8090/.

If you run a PostgreSQL without the preset Docker image ensure that the your instance has the following settings:

POSTGRES_DB: wahlzeit
POSTGRES_USER: wahlzeit
POSTGRES_PASSWORD: wahlzeit

How to Use

Build and Run

Before you can start Wahlzeit a PostgreSQL instance need to be reachable (see above).

To build and run Wahlzeit you can use ./gradlew appRun (on Windows: gradlew.bat appRun). This will build the app and start an embedded Jetty server to serve the app.

If the app is successfully built you can reach the ui under http://localhost:8080/wahlzeit.

Run Wahlzeit inside a Docker container

  • Build the Docker image docker-compose build or docker build -t wahlzeit .
  • Run the Docker container docker-compose up to start the app and the database.
  • Open http://localhost:8080/wahlzeit to try out Wahlzeit inside a Docker container

Test

To run all unit test use ./gradlew test (on Windows: gradlew.bat test). It will list all test with an indicator if a test failed or succeed.

Debug

To debug the app you have to start the app in debug mode with ./gradlew appRunDebug and use remote debugging in your IDE of choice. The debug port is 5005.

We provided a remote debugging configuration for Visual Studio Code and IntelliJ named Debug Local App. These configuration will automatically be visible in these two IDEs.

In Visual Studio Code:

In IntelliJ IDEA:

Run Wahlzeit inside a Docker container

  1. Build the Docker image docker-compose build or docker build -t wahlzeit .
  2. Run the Docker container docker-compose up or docker run --network=host -p 8080:8080 wahlzeit
  3. Open http://localhost:8080 to try out Wahlzeit inside a Docker container

Activate GitHub Actions (CI)

Go to GitHub settings and navigate to Developer settings -> Personal Access Tokens. Generate new personal access token (PAT) with privileges repo, write:packages, and read:packages.

Every tagged commit starting with adap-cw will publish and overwrite the wahlzeit:{tag-name} image.

wahlzeit's People

Contributors

andreas-bauer avatar dirkriehle avatar georg-schwarz avatar hannesd avatar tfrdidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wahlzeit's Issues

Dockerize UI

On branch wahlzeit-40-new-ui, we should dockerize the UI as well. This is a leftover from PR #133.

  • Docker image for ui; I'd write a very simple one-step that just starts vue-cli. Better setup with multi-stage build should be a homework for students
  • Build with CI
  • Add to cocker-compose setup
  • Update documentation on how to start up

Show next photo

As a visitor, I am presented with a random photo when I go to the website

Repeated visits to the site provide different photos

Browse photo portfolio

As a user, I can browse my collection of uploaded photos (my portfolio), complemented by basic information.

I am provided with a browseable list of all my photos to select one from.

Logout

As a logged-in user, I can logout from Flowers to free up the computer for some other person

After logging out, I have lost access to user functionality and can only regain it by logging in again

API Documentation

On branch wahlzeit-40-new-ui.

We should document the backend API in an interactive way. I suggest to use swagger to generate an OpenApi spec that we can feed into a Swagger-UI container.

Review flagged photo

As an administrator, I can review a flagged photo and unflag it or take it offline

After unflagging, the photo is viewable again; after taking it offline, the user receives an email notification

Add compile-time info to footer

For a given build, determine the compile-time, and add it to page output of a running Wahlzeit instance. The purpose is to see in one view, when this application was compiled (deployed).

Change basic profile

As a user, I can change my basic profile data, which at a minimum involves real name and email address

After changing my basic profile data, any changes are active right away

Delete photo

As a user, I can select any photo from my portfolio and have it deleted

After deleting the photo, it will not be shown any longer to any user

Instrument photo page

As a search engine, I find meaningful meta-data in a photo page, created from the photo data

Using a search engine and a photo's meta-data, the search engine points to the photo page

Flag photo

As a user, I can flag a photo as inappropriate or copyright violation; a flagged photo becomes invisible immediately

The flagged photo cannot be viewed by anyone any longer but the owning user or an administrator

Change password

As a user, I can change my password; having to double-enter my password protects me from mistakes

After changing my password, the change has become active right away

Cold backup and restore

As a sysadmin, I can backup all data to files and reload it fresh while the system is down, using the command line

Running restore after backup recreates the same identical system

Show or hide photo caption

As a visitor, I am presented with a photo caption, which I can expand to show full photo data

A first clock shows me the photo data, a second click hides it again; rinse and repeat

Prompt basic profile

As a user, I am asked to enter basic profile data upon every login, if it doesn't yet exist

I am asked for basic data upon every login; after providing it once, I never get this dialog again

Select photo

As a user, I can select any one of my photos and have it shown to me, including any added information

After selecting one of my photos I'm presented with a screen that shows the photo and its information

Track repeat offender

As an administrator, I receive an email, if a user had three photos flagged by the community

The administrator receives the email providing the user name; for every additional photo, s/he receives another email

[ADAP Task 2] see description for details

1a. class Tags stores its data in a set
1b. implemented equals() for class Tags (including tests)
2. added HandlerTestSetup for initialization of test data
3a. changed DatabaseConnection in order to allow dynamic configuration of DB connections
3b. test cases can now use an in-memory db (HSQL) - warning: this feature is currently disabled for org.wahlzeit.AllTests since HSQL has some problems parsing the SQL script which is needed for populating the DB

Recreate agent tasks lost in 2.0

There should be two periodic background tasks:

  • random praise generator
  • photo praise notifier

Check and reinstate if necessary.

Login

As a guest, I can login using my previously created user account data to get access to user functionality

After logging in, I have access to user functionality

Lint UI

On branch wahlzeit-40-new-ui. This is a leftover from PR #133.

  • There should be a more strict linter configuration
  • Integrate into CI

Known issues that should be included

  • Some template roots have multiple elements (only one allowed).
  • Your alias-based imports (@) are shown as error. Is there something required to be configured locally?
  • The Vetur plugin shows another error: Property '$router' does not exist on type 'App' - probably something is not configured in the shim?

Upload photo

As a user, I can upload a new photo and add information to it; meta-data is extracted from the photo

After uploading a new photo, I can find it in my photo portfolio

Rate photo and proceed

As a visitor, I can rate a photo with a numerical value of 1-10; after rating, another photo is shown.

The rating is stored and an average value is computed

Tell a friend

User story

  1. As a guest
  2. I can email a friend about a photo
  3. So that I can share my passion

Acceptance criteria

  • After hitting OK, an email is sent
  • After hitting Cancel, no email is sent
  • The next page is the main page

Definition of done

To be defined week 5 onwards.

Change photo data

As a user, I can select any of my photos and change the information available for it

After changing the photo's information, the change becomes effective immediately

Photo set exhausted in half the time

When trying the sample flower photo set, only half of the photos show up before having to starting over with the available photos. Which photos are skipped and which are shown seems to be random.

Provide stable URLs

As a guest, I can copy and paste a photo page URL from the URL bar, and it will always be the same photo

Upon requesting the same URL repeatedly, it will always be the same photo page

Create default admin

As a sysadmin, I can create a default application administrator from the command line

After running the command, a default "admin" account with default password "dingdong" exists and can be used

View flagged photo queue

As an administrator, I can view all flagged photos, ordered by time of flagging

The list shows all previously flagged photos

Startup and shutdown scripts

As a sysadmin, I can startup and shutdown the service from the command line

Three consecutive startup and shutdown command line invocations leave the system in a consistent state

Register

As a guest, I can register on Flowers for free, to become a user and get access to user functionality

After registration, my newly created account is available right away and I can login

Reset password

As a visitor, I can request to be sent an email with a link to a page that lets me create a new password

Upon having received the email, I can use the linked-to page to create a new password

Reboot and shtudown UI

As a administrator, I can reboot or shutdown the service using a graphical UI

The command is only available to the administrator role and shuts down the system to a clean restartable state

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.