This is a server to keep track of songs.
Download the code
git clone https://github.com/UCL/PopChat-BE.git
Create a popchat database
createdb popchat
createuser -P popchat # Make sure password is "popchat"
Run the code
mvn spring-boot:run [-Djava.version=<Your Java Version>]
http://localhost:8080/words/rhymes-with/bee
.Or run the tests
mvn -Dspring.profiles.active=test [-Djava.version=<Your Java Version>] test
You can set set up options in src/main/resources/application.properties
The following options are used to configure the application:
spring.datasource.url
: The connection string for the database (eg. jdbc:postgresql://localhost:5432/popchat)spring.datasource.username
: The database usernamespring.datasource.password
: The database passwordinitialSongDataDirectory
: The directory to look for song jsons to preload the database. /
is src/main/resources
salt.algorithm
: The algorithm to use the generate random salts. Supported options are: SHA1PRNG
hash.algorithm
: The hashing algorithm to use. Supported options are: PBFDF2
salt.length
: Length of the salthash.length
: Length of the hashhash.iterations
: Number of hashing iterations.default.admin.username
: The default administrator username if one doesn't existdefault.oauth2.client
: Name of default OAuth2 client to create if there isn't one
Note that the length of salt + length of hash must be <= 600.
Example Song JSON file
{
"artist": "Artist name",
"title": "Song title",
"year": 2015,
"video": "URL to the video",
"lyrics": "[00:20.500]Sing song lyrics in LRC format"
}
Documentation about the endpoints is automatically generated with Swagger.
It can be accessed at /swagger-ui.html
, e.g. http://localhost:8080/swagger-ui.html.
The raw Swagger config data can be accessed at /v2/api-docs
.