- gui
- users_persistent
- users
- friends_persistent
- friends
- playlists_persistent
- playlists
- songs_persistent
- songs
- feed_persistent
- feed
This is the service that handles the main interface between the user and the application. It is a web application that is built using the Flask framework. It is responsible for the following:
- Fetching the pages of the application for the user
- Main service that the user interacts with
- Passing the user input to the appropriate microservice by sending requests to the microservice's API
- Endpoints:
- /login Inteface for the login page, passes the user input to the users microservice.
- /register Interface for the register page, passes the user input to the users microservice.
- /add_friend Redirects to /friends page, passes the user input to the friends microservice
- /friends passes Interface for friends, fetches output from the friends microservice
- /create_playlist Redirects to /playlists, passes the user input to the playlists microservice
- /add_song_to/<int: playlist_id> Redirects to /playlists/<int: playlist_id> passes the user input to the playlists microservice
- /playlists Interface for the playlists, fetches from the playlists microservice
- /playlists/<int: playlist_id> Interface for the playlist, passes the user input to the playlists microservice
- / Interface for feed, fetches from the feed microservice
- /catalogue Interface for the catalogue of songs, fetches from the songs microservice
- /invite_user_to/<int: playlist_id> Redirects to /playlists/<int: playlist_id>, passes the user input to the playlists microservice
- /logout Redirects to /
This is the service that holds the database of the users. It is responsible for the following:
- Creating the database "users"
- Creating the tables
- users (username,password)
- Hosting the database
This is the service that handles the user data and anything related to it. It uses the users_persistent service to store and retrieve the data. It opens a connection with the database on the users_persistent service and passes a query. It is responsible for the following:
- Creating a new user /users/register/
- Checking in the database if the username already exists
- Adding the user to the database
- Logging in a user /users/login/
- Checking in the database if the username exists
- Checking in the database if the password matches the username
- Checking if a user exists /users/exists/
- Checking in the database if the username exists
- Endpoints:
- POST /users/register/
- input string username: username of the user
- input string password: password of the user
- returns boolean: True on success, False otherwise
- POST /users/login/
- input string username: username of the user
- input string password: password of the user
- returns boolean: True on success, False otherwise
- GET /users/exists/
- input string username: username of the user
- returns boolean: True on existence, False otherwise
- POST /users/register/
This is the service that holds the database of the friends. It is responsible for the following:
- Creating the database "friends"
- Creating the tables
- friends (username,username_friend)
- Hosting the database
This is the service that handles the friends data and anything related to it. It uses the friends_persistent service to store and retrieve the data. It opens a connection with the database on the friends_persistent service and passes a query. It is responsible for the following:
- Adding a friend
- Checking in the database if the friend is already added
- Checking in the database if the friend exists -> /users/exists/
- Checking in the database if the user exists -> /users/exists/
- Adding the friend to the database
- Retrieving a friendlist
- Checking in the database if the user exists -> /users/exists/
- Retrieving the friendlist from the database
- Endpoints:
- POST /friends/add/
- input string username1: username of user 1
- input string username2: username of user 2
- returns boolean: True on success, False otherwise
- GET /friends/
- input string username: username of the user
- returns list: list of friends
- POST /friends/add/
This is the service that holds the database of the playlists. It is responsible for the following:
- Creating the database "playlists"
- Creating the tables
- playlists (playlist_id, username, playlist_name)
- songInPlaylist (playlist_id, artist, title)
- playlistSharedWith (playlist_id, username)
- Hosting the database
This is the service that handles the playlists data and anything related to it. It uses the playlists_persistent service to store and retrieve the data. It opens a connection with the database on the playlists_persistent service and passes a query. It uses the song service to validate the existence of songs. It uses the users service to validate the existence of users. It uses the feed service to add new activities. It is responsible for the following:
- Creating a new playlist - POST /playlists/create/
Creates a new playlist named "title" for the user "owner"
- Input string owner: username of the user/owner
- Input string title: name of the playlist
- Returns boolean: True on success, False otherwise
- Adding a song to a playlist - POST /playlists/add_song/
- Input string title: name of the song
- Input string artist: name of the artist
- Input int playlist_id: id of the playlist
- Input string owner: username of the owner of the playlist
- Returns boolean: True on success, False otherwise
- Retrieving all playlists - GET /playlists/ or GET /playlists/owned/
- Input string username: username of the owner of the playlist
- Returns list(int): list of owned playlists (ids)
- Retrieving all shared playlists - GET /playlists/shared/
- Input string username: username of the user
- Returns list(int): list of shared playlists (ids)
- Retrieving a playlist - GET /playlists/<int: playlist_id>/
- Input int playlist_id: id of the playlist
- Returns list(string,string): list of songs in the playlist (title, artist)
- Invite a user to a playlist - POST /playlists/<int: playlist_id>/invite/
- Input int playlist_id: id of the playlist
- Input string username: username of the user to invite
- Input string username_owner: username of the owner of the playlist
- Returns boolean: True on success, False otherwise
This is the service that holds the database of the songs. It is responsible for the following:
- Creating the database "songs"
- Creating the tables
- songs (artist, title)
- Populating the database with the songs from the csv file
- Hosting the database
This is the service that handles the songs data and anything related to it. It uses the songs_persistent service to store and retrieve the data. It opens a connection with the database on the songs_persistent service and passes a query. It is responsible for the following:
- Retrieving all songs
- Retrieving all songs from the database
- Checking if a song exists
- Checking in the database if the song exists
- Adding a song
- Checking in the database if the song exists
- Adding the song to the database
This is the service that holds the database of the feed. It is responsible for the following:
- Creating the database "feed"
- Creating the tables
- feed (activity_id, username, description, timestamp)
- Hosting the database
This is the service that handles the feed data and anything related to it. It uses the feed_persistent service to store and retrieve the data. It opens a connection with the database on the feed_persistent service and passes a query. It is responsible for the following:
- Adding an activity to the feed /activities/add/
- Checking in the database if the user exists -> /users/exists/
- Adding the activity to the database
- Retrieving the feed /activities/ or /feed/
- Checking in the database if the user exists -> /users/exists/
- Retrieving the feed from the database