Nightcore-Backend is used to manage content via a user interface and to serve the content via a REST Api. The data that can be obtained via the REST Api should be usable by a corresponding companion app.
- Java 8+
- MySQL
- Maven
Simple user interface to manage artists, their songs and the corresponding links to the Youtube video. Provides all common operations, such as creating, viewing, modifying and deleting entities. Users of the companion app have the possibility to make song suggestions, these suggestions are displayed visibly and can be quickly rejected or added to the database in the form of a new song/artist. The data can be searched and is displayed using a pagination.
The api exists to provide the data and functionality of the companion app.
Generic search that applies to any SearchableEntity
, such as Artist or Song.
Returns json data for multiple SearchableEntity
, each one being wrapped inside a SearchWrapper that holds the specific type and its content.
public static class SearchWrapper<T extends SearchableEntity> {
@JsonView(JsonScope.Public.class)
private final String type;
@JsonView(JsonScope.Public.class)
private final Iterable<T> content;
public SearchWrapper(String type, Iterable<T> content) {
this.type = type;
this.content = content;
}
public Iterable<T> getContent() {
return content;
}
public String getType() {
return type;
}
}
- URL
/api/search
- Method
GET
- Path Variable
Required: q=[String]
Returns json data for multiple artists by page, length and sort property.
- URL
/api/artists/all
- Method
GET
- Params
Optional: p=[Integer] l=[Integer] sortBy=[String]
Returns json data for multiple artists by search query, page, length and sort property.
- URL
/api/artists/search
- Method
GET
- Params
Required: q=[String] Optional: p=[Integer] l=[Integer] sortBy=[String]
Returns json data for a single artist by artist id.
- URL
/api/artists/{id}
- Method
GET
- Path Variable
Required: id=[Integer]
Returns json data for all songs of a single artist by artist id.
- URL
/api/artists/{id}/songs
- Method
GET
- Path Variable
Required: id=[Integer]
Returns json data for multiple songs by page, length and sort property.
- URL
/api/songs/all
- Method
GET
- Params
Optional: p=[Integer] l=[Integer] sortBy=[String]
Returns json data for multiple songs by search query, page, length and sort property.
- URL
/api/songs/search
- Method
GET
- Params
Required: q=[String] Optional: p=[Integer] l=[Integer] sortBy=[String]
Returns json data for a single song by artist id.
- URL
/api/songs/{id}
- Method
GET
- Path Variable
Required: id=[Integer]
- URL
/api/request/add
- Method
POST
- Params
Required: url=[String] date=[Date(pattern="dd-MM-yyyy")]