UCL / PopChat-BE

PopChat's back-end work
0 stars 0 forks source link

Pronouncing

This is a server to keep track of songs.

Dependencies

Instructions

  1. Download the code

    git clone https://github.com/UCL/PopChat-BE.git
  2. Create a popchat database

    createdb popchat
    createuser -P popchat # Make sure password is "popchat"
  3. Run the code

    mvn spring-boot:run [-Djava.version=<Your Java Version>]
    • You can check the server is live by opening a browser on http://localhost:8080/words/rhymes-with/bee.
    • When you run the code the system will automatically populate some data. Specifically it will:
      • Load all the song JSON files into the songs database
      • If there is no administrator user, it will create a new administrator and write their login credentials to the console
      • If there is not AOuth2 client application, it will create a new application and write its credentials to the console
  4. Or run the tests

    mvn -Dspring.profiles.active=test [-Djava.version=<Your Java Version>] test

Set up options

You can set set up options in src/main/resources/application.properties

The following options are used to configure the application:

Song JSON format

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"
}

Endpoints Documentation

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.