Building and running step 4

Add new tables and modify the application code to allow users to log in and create music playlists that contain different music tracks.

You will not modify Playlist to allow user logins and custom playlists.

Prerequisites

You must have set up your environment before starting this step.

Procedure

  1. In a terminal, go to the playlist workspace.
    cd playlist
  2. Check out the step4 branch using git.
    git checkout step4
  3. Run the cqlsh command.
    cqlsh
  4. In the playlist keyspace create the users and playlist_tracks tables.
    use playlist;
    create table users (username text primary key, password text, playlist_names set<text>);
    create table playlist_tracks (username text, playlist_name text, sequence_no timestamp, artist text, track_name text, genre text, track_length_in_seconds int, track_id UUID, primary key ((username, playlist_name), sequence_no ));
  5. Quit cqlsh.
    exit;
  6. Build and run Playlist using mvn.
    mvn verify cargo:run
  7. In a web browser, navigate to or refresh: http://localhost:8080/playlist

    Now you can create new users and playlists.

What's next

Proceed to Step 5: Add statistics views to monitor Playlist.