GithubHelp home page GithubHelp logo

cryptic-game / java-backend-old Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 6.0 5.42 MB

This is the Java Backend of the Cryptic project.

Home Page: https://cryptic-game.github.io/java-backend

License: GNU Affero General Public License v3.0

Java 99.04% Dockerfile 0.96%
java java-11 netty hibernate-orm sql api cryptic cryptic-game hacktoberfest

java-backend-old's Introduction

Cryptic Java Backend

Releases Build
DockerHub - Server DockerHub - Java Daemon DockerHub - Admin Panel

This is the Java Backend of the Cryptic project.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

Installing

A step by step series of examples that tell you how to get a development env running

git clone https://github.com/cryptic-game/java-backend.git

Then you can open it with you IDE.

Running

To test the things you have changed you have to execute the Gradle Task 'run'.

Server:

./gradlew :server:start

Java-Daemon:

./gradlew :java-daemon:start

Admin-Panel:

./gradlew :admin-panel:start

To customize your development environment, check our available environment variables.

Documentation

The Javadocs can be found in GitHub Pages and the protocol documentation in our wiki.

Deployment

See Cryptic backend deployment. (TODO Link)

Used Tools

Authors

The Cryptic Java Team

java-backend-old's People

Contributors

actions-user avatar bene99 avatar cr7mbl3 avatar dependabot[bot] avatar devfeddy avatar drschlaubi avatar fuam5 avatar jannikemmerich avatar lewimbes avatar marcelcoding avatar msentwickler avatar renovate-bot avatar renovate[bot] avatar themorpheus407 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

java-backend-old's Issues

Delete Expired and Invalid Sessions

Is your feature request related to a problem? Please describe.

Currently all sessions are saved, even if they have expired or are invalid.

Describe the solution you'd like

Delete all expired and invalid sessions.

Fix new Json System

Describe the bug
There is currently a bug with the new Json System where all fields of an object are included into the JsonObject.

Add exception if the user provides no valid UUID

Is your feature request related to a problem? Please describe.
Currently the server does not catch the exception if a uuid provided by the client is invalid.

Describe the solution you'd like
Catch the exception and send an error to the client.

Refactor Api & Config System

Is your feature request related to a problem? Please describe.
Refactor Api & Config System

Describe the solution you'd like
Use new Api and Config Backend System (No changes in the Api for Endpoints e.g.)

Add Admin Control Panel Interface

Is your feature request related to a problem? Please describe.
We want to add an admin control panel to the frontend for administrators / moderators. Therefore we need an interface in the backend.

Describe the solution you'd like
Add new endpoints that are used by the admin control panel.

Additional Comments
We also have to add a user role system.

Add limitation to the username length

Describe the bug
The server accepts an infinitely long name attribute on login and signup.
This could lead to a Denial of Service or performance issues.

Reproduce
Send an websocket signup or login request with a very long name.

Expected Behavior
The Server should send an error message and names should be limited to 256 characters.

Handle Disconnecting Daemons

Is your feature request related to a problem? Please describe.

Currently the disconnecting daemons and their endpoints are not removed from the list.

Describe the solution you'd like

Remove the daemon and its endpoints when the connecting is closed.

Delete Sessions related to the user

Is your feature request related to a problem? Please describe.
When a user is deleted, the user's sessions are currently retained.

Describe the solution you'd like
Delete the sessions when the user is deleted.

Add Api Test Editor

Is your feature request related to a problem? Please describe.
Add an editor to test endpoints in the same way as in Swagger.

Add unit tests for endpoint collections

Is your feature request related to a problem? Please describe.
Currently we don't have any unit tests.

Describe the solution you'd like
Add unit tests for the endpoint collections.

Add method to Notify a user

Is your feature request related to a problem? Please describe.
In the moment you can't notify a User/Client

Describe the solution you'd like
Add a method in the daemon and a forwarding to the client to the server to actively send information to the user.

Add Chat Data Classes

Describe the solution you'd like

Add data classes for the chat system.
Add javadoc to the chat data classes.

Additional Comments

To be stored in the database:

  • existing channels
  • chat history

You can find some information about the chat system in the old backend.

Some examples of javadoc can be found in data classes with existing javadoc.

Add Lombok

Is your feature request related to a problem? Please describe.
Adding Lombok to improve the code readebil.

Add an endpoint to get the username of another user

Is your feature request related to a problem? Please describe.
We need to get away from UUIDs in the frontend. There is currently no way to display users with user names, we have to display UUIDs and that's not pretty and not at all informative.

Describe the solution you'd like
Add a new endpoint that takes a UUID and responds with the username, maybe the last-seen date and later possibly the online status of the corresponding user.

Additional Context
Please implement this endpoint inside the server.

Merge WebSocket and HTTP Server into one Server

Is your feature request related to a problem? Please describe.
Currently the WebSocket and the HTTP server are two separate Netty servers.

Describe the solution you'd like
The WebSocket and HTTP server should be a Netty server.

Set UTC Timezone in ARM Docker Image

Is your feature request related to a problem? Please describe.

Currently the timezone of the Docker container is not set.

Describe the solution you'd like

Set the timezone of the Docker container to UTC.

Additional Comments

There must be no commands in the docker file, otherwise GitHub Actions cannot build the image.

Add Javadoc to Data Classes

Is your feature request related to a problem? Please describe.

Currently there is no documentation for the data classes.

Describe the solution you'd like

Add javadoc to every data class.

Additional Comments

For some examples look into data classes with existing javadoc

Remove old Json system

Is your feature request related to a problem? Please describe.
Since there is a new Json system in the v0.3.0-pre-alpha the old can now be removed.
Also remove the timer.

Add chat endpoints

Describe the solution you'd like
Add network endpoints so that the new Java backend has the same state as the old one.

Additional Comments
You can find the endpoints in the old backend.

Add settings endpoints

Is your feature request related to a problem? Please describe.
The frontend has to store some individual user settings in the backend.

Describe the solution you'd like
Add settings endpoints like in the old backend.
Create a Setting data class and a settings endpoint collection inside the daemon with the following endpoints:

  • settings/save
  • settings/get
  • settings/delete

Additional context
The old implementation can be found here:

Add new Json system

Is your feature request related to a problem? Please describe.
A new Json serialization and deserialization system.

Add Request Timeout

Is your feature request related to a problem? Please describe.

If the daemon does not respond for some reason, the client will not receive any response.

Describe the solution you'd like

Add a timeout after which the client receives an error message.

Additional Comments

The duration of the timeout is defined in the environment variables.

Disable/Enable endpoints

Is your feature request related to a problem? Please describe.
In cases of security- or gamebreaking bugs, you should be able to disable endpoints temporarily.

Describe the solution you'd like
There should be a configuration-like approach to disable/enable endpoints without rebuilding the entire project.

Flat Daemon Requests

Is your feature request related to a problem? Please describe.
Remove Endpoint daemon/send

Describe the solution you'd like
e.g. daemon/send -> network/create

Use new JsonBuilder

Is your feature request related to a problem? Please describe.
Currently we're using the old JsonBuilder which is removed in v0.4.0-pre-alpha.

Describe the solution you'd like
Replace all usages of the old JsonBuilder with the new one.

Add in-memory database with hibernate

Is your feature request related to a problem? Please describe.
Currently one has to set up a database to test the backend.

Describe the solution you'd like
Add a config value that enables the in-memory database provided by hibernate.

Add missing javadocs

Describe the bug
Missing javadoc for the data-classes:

  • Some parameter descriptions are missing in the javadocs.
  • There are also missing package-infos and javadoc for the classes and the constructors.

Logs

2020-04-16T16:29:06.1334107Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelAutoId.java:29: warning: no @param for <T>
2020-04-16T16:29:06.1334437Z 
2020-04-16T16:29:06.1335029Z     public static <T extends TableModelAutoId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:06.1383677Z                                                  ^
2020-04-16T16:29:06.1384417Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelAutoId.java:29: warning: no @param for entityClass
2020-04-16T16:29:06.1398405Z     public static <T extends TableModelAutoId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:06.1398561Z                                                  ^
2020-04-16T16:29:06.1399152Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelId.java:25: warning: no @param for <T>
2020-04-16T16:29:06.1399358Z     public static <T extends TableModelId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:06.1399517Z                                              ^
2020-04-16T16:29:06.1399993Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelId.java:25: warning: no @param for entityClass
2020-04-16T16:29:06.1400172Z     public static <T extends TableModelId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:06.1400317Z                                              ^
2020-04-16T16:29:06.3302794Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/utils/JsonBuilder.java:193: warning: no @param for <T>
2020-04-16T16:29:06.3320610Z     public <T> JsonBuilder add(final String key, final List<T> values) throws InvalidPropertiesFormatException {
2020-04-16T16:29:06.3320932Z                            ^
2020-04-16T16:29:13.9307555Z /home/runner/work/java-backend-dev/java-backend-dev/java-data/src/main/java/net/cryptic_game/backend/data/currency/CurrencyTransaction.java:125: warning: no description for @param
2020-04-16T16:29:13.9308061Z > Task :java-data:javadoc
2020-04-16T16:29:13.9308701Z      * @param purpose
2020-04-16T16:29:13.9308979Z        ^
2020-04-16T16:29:13.9309602Z /home/runner/work/java-backend-dev/java-backend-dev/java-data/src/main/java/net/cryptic_game/backend/data/currency/CurrencyTransaction.java:143: warning: no description for @param
2020-04-16T16:29:13.9310133Z      * @param origin
2020-04-16T16:29:13.9310346Z        ^
2020-04-16T16:29:14.1301979Z /home/runner/work/java-backend-dev/java-backend-dev/java-data/src/main/java/net/cryptic_game/backend/data/device/DeviceFile.java:115: warning: no description for @param
2020-04-16T16:29:14.1302736Z      * @param device
2020-04-16T16:29:14.1303065Z        ^
2020-04-16T16:29:20.1305232Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelAutoId.java:29: warning: no @param for <T>
2020-04-16T16:29:20.1305669Z 
2020-04-16T16:29:20.1306201Z     public static <T extends TableModelAutoId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:20.1306620Z                                                  ^
2020-04-16T16:29:20.1313502Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelAutoId.java:29: warning: no @param for entityClass
2020-04-16T16:29:20.1314382Z     public static <T extends TableModelAutoId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:20.1314752Z                                                  ^
2020-04-16T16:29:20.6338875Z /home/runner/work/java-backend-dev/java-backend-dev/java-data/src/main/java/net/cryptic_game/backend/data/currency/CurrencyTransaction.java:125: warning: no description for @param
2020-04-16T16:29:20.6339827Z      * @param purpose
2020-04-16T16:29:20.6340253Z        ^
2020-04-16T16:29:20.6340939Z /home/runner/work/java-backend-dev/java-backend-dev/java-data/src/main/java/net/cryptic_game/backend/data/currency/CurrencyTransaction.java:143: warning: no description for @param
2020-04-16T16:29:20.6341691Z      * @param origin
2020-04-16T16:29:20.6341986Z        ^
2020-04-16T16:29:20.8304270Z /home/runner/work/java-backend-dev/java-backend-dev/java-data/src/main/java/net/cryptic_game/backend/data/device/DeviceFile.java:115: warning: no description for @param
2020-04-16T16:29:20.8304909Z      * @param device
2020-04-16T16:29:20.8305410Z        ^
2020-04-16T16:29:21.0302695Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelId.java:25: warning: no @param for <T>
2020-04-16T16:29:21.0303582Z     public static <T extends TableModelId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:21.0304225Z                                              ^
2020-04-16T16:29:21.0304879Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/sql/models/TableModelId.java:25: warning: no @param for entityClass
2020-04-16T16:29:21.0305250Z     public static <T extends TableModelId> T getById(Class<T> entityClass, final UUID id) {
2020-04-16T16:29:21.0305432Z                                              ^
2020-04-16T16:29:21.3303791Z /home/runner/work/java-backend-dev/java-backend-dev/java-base/src/main/java/net/cryptic_game/backend/base/utils/JsonBuilder.java:193: warning: no @param for <T>
2020-04-16T16:29:21.3363944Z     public <T> JsonBuilder add(final String key, final List<T> values) throws InvalidPropertiesFormatException {
2020-04-16T16:29:21.3364125Z                            ^

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.