Visu track hub
I'm looking for the simplest technology stack to implement a project like this:
I would like visu to have a built-in level browser for downloading from the internet. In visu
, in the settings, there would be a UI for adding custom servers (just URL addresses). Then the search option would query a simple API of these URLs, and a simple JSON with a list of found tracks would be returned. Visu
itself would concatenate these responses to display a single list.
A visu
level is a zip file containing files like *.json
, *.ogg
, *.mp4
, *.png
, *.bmp
.
*.ogg
and *.mp4
files might be copyright-protected, so I want distributed servers that anyone can set up - my plan to bypass the copyright problem ๐
The MVP seems simple, I basically have it done already. It involves a simple app in node.js with a mocked API, always returning the same search result and allowing the download of one track. I believe that implementing such a repository is not the right way, as something like this must already exist (for example, levels for Beat Saber, osu, etc.)
I see it like this: I would upload the project with the server and a Dockerfile to my GitHub (of course, also upload the Dockerfile to Docker Hub) which would contain the server and instructions on how to run it locally. Meanwhile, I would host an "anonymous" hub, which would be the default, and it could contain content with dubious "copyright".
My MVP is not enough because it should include the possibility of logging in, adding/deleting tracks (uploading zip from the client, verifying if it's really a visu
level, whether it contains files from the whitelist, whether it doesn't contain any junk, viruses, etc.), DDoS protection, etc.
I'm a "goat programmer" so I see how I could code it all myself, but this time I'd like to use something ready-made and focus on configuring in YAMLs rather than writing code.
Roles/Authentication
Users are needed with three types of roles:
User
: can add new tracks and delete their own tracks.
Moderator
: can add and delete tracks, add or remove users from ban list
Admin
:can do everything what moderator can + assign roles to other users.
API
/get/{trackId}
Type: GET
Description: Link to zip with visu track
Parameters:
string
trackId: ID of visu track
Response content type: application/json
Response codes:
200
: Successful operation
404
: Visu track not found
Example response:
{
"code": 200,
"message": "Successfull",
"payload": {
"url": "https://url.to/track.zip"
}
}
/find
Type: POST
Description: Return JSON Collection
Parameters:
string
query: Prompt from user
Response content type: application/json
Response codes:
200
: Successful operation
400
: Invalid query supplied
Example response:
{
"code": 200,
"message": "Successfull",
"payload": {
"result": [
{
"id": "EXAMPLE_ID",
"author": "Author public nickname from external authenticator service",
"name": "Sewerslvt - Blissfull Overdose",
"description": "Yoo, check this sick level I've made"
}
]
}
}
/put
Type: PUT
Description: Upload visu track to server.
Parameters:
string
name: Name of visu track, max 256 characters
string
description: Note from author, max 2048 characters
file
track: zip with visu track
Response content type: application/json
Response codes:
200
: Successful operation
400
: Invalid form supplied
401
: Unauthorized
415
: Invalid visu track
Example response:
{
"code": 200,
"message": "Track added successfully",
"payload": {
"id": "EXAMPLE_ID"
}
}
/delete
Type: DELETE
Description: Remove visu track from server.
Parameters
- string id: ID of visu track
Response content type: application/json
Response codes:
- 200: Successful operation
- 400: Invalid ID supplied
- 401: Unauthorized
- 404: Visu track not found
Example response:
{
"code": 200,
"message": "Track removed successfully",
"payload": {
"id": "EXAMPLE_ID"
}
}