A Social Media Like Music App for Artists, DJs, Producers, and even Listeners to share, listen, like, comment theirs and others music. Artists can promote their own music by encouraging fans to like their songs, albums, and playlists, to land a spot on the trending page.
Client: React, HTML, Vanilla CSS
Server: Ruby, Rails, Google Cloud Services
Frontend Is Using JSDoc Navigate to the Docs Folder /client/docs Open App.html To a Live Server To View A Static Site of Documentation.
This document presumes you meet these prerequisites
Installations
API Keys & Resources
Setting Up GCS (Google Cloud Service) Configs
-
Make a new file in the /config folder called gkey.json Place your GCS Service Key in /config/gkey.json.
-
In /config/storage.yml update it as follows:
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
google_dev:
service: GCS
project: <Enter Your Project ID>
credentials: 'config/gkey.json'
bucket: <Enter Your Bucket Name>
google:
service: GCS
project: <Enter Your Project ID>
credentials: 'config/gkey.json'
bucket: <Enter Your Bucket Name>
Start Rails Api
bundle install
rails db:migrate && rails db:seed
start on port :3000
Start React UI
cd ./client/audiophile
npm install
npm start
Route | Description |
---|---|
/ |
Login Page |
/signup |
Signup Page |
/create |
Create Songs, Albums, & Playlists & Upload them to the database and GCS |
/home |
Displays the trending Albums, Playlists, & Songs, based on most comments and likes |
/search |
Allows a user to search for other users by username or albums, songs, & playlists by name |
/music |
Displays a users Liked Music Items to allow for user to play and see what they have previously liked |
/profile/:username |
Displays a User's Profile. Their songs, albums, & playlists. Users information is fetched by :username param |
/settings |
Allows a User to delete their account, upload a profile picture and also change profile information |
/song/:id |
Displays an individual song, comments and allows for users to leave comments |
/album/:id |
Displays an individual album, songs & comments. Allows for users to leave comments |
/playlist/:id |
Displays an individual playlist, songs & comments. Allows for users to leave comments |
has_many :playlist_songs
has_many :poly_comments, as: :commentable
has_many :poly_likes, as: :likeable
has_one_attached :audio, service: :google
has_one_attached :image, service: :google
GET /users
GET /users/:username
POST /users
Parameter | Type | Description |
---|---|---|
id |
integer |
User ID |
name |
string |
Users Name |
username |
string |
Required Users Username |
email |
string |
Required Users Email |
password |
string |
Required Users Password (hashed) |
gender |
string |
Users Gender: 'M', 'F', null |
age |
integer |
Users Age |
user_type |
string |
Users Type: 'DJ', 'Artist', 'Producer' |
PATCH /users/:id
Parameter | Type | Description |
---|---|---|
id |
integer |
User ID |
name |
string |
Users Name |
username |
string |
Users Username |
email |
string |
Users Email |
password |
string |
Users Password (hashed) |
gender |
string |
Users Gender: 'M', 'F', null |
age |
integer |
Users Age |
user_type |
string |
Users Type: 'DJ', 'Artist', 'Producer' |
GET /users/:id/likes
Returns the users song likes (Will eventually return albums, & playlists as well)
DELETE /users/:id
has_secure_password
has_many :albums
has_many :songs
has_many :playlists
has_many :poly_comments
has_many :poly_likes
has_many :liked_songs, through: :poly_likes, source: :likeable, source_type: 'Song'
has_many :liked_albums, through: :poly_likes, source: :likeable, source_type: 'Album'
has_many :liked_playlists, through: :poly_likes, source: :likeable, source_type: 'Playlist'
has_one_attached :image, service: :google
GET /songs
GET /songs/:id
POST /songs
Parameter | Type | Description |
---|---|---|
id |
integer |
Song ID |
name |
string |
Required Song Name |
user_id |
integer |
Required Users ID (Poster) |
album_id |
integer |
Songs Album ID |
image |
file |
Songs Image |
audio |
file |
Songs Audio |
Delete /songs/:id
has_one :user
has_many :songs
has_many :poly_comments, as: :commentable
has_many :poly_likes, as: :likeable
has_one_attached :image, service: :google
GET /albums
GET /albums/:id
POST /albums
Parameter | Type | Description |
---|---|---|
id |
integer |
Album ID |
name |
string |
Required Albums Name |
user_id |
integer |
Required Users ID |
image |
file |
Albums Image |
Delete /albums/:id
has_many :playlist_songs
has_many :poly_comments, as: :commentable
has_many :poly_likes, as: :likeable
has_many :songs, through: :playlist_songs
has_one_attached :image
GET /playlists
GET /playlists/:id
POST /playlists
Parameter | Type | Description |
---|---|---|
id |
integer |
Playlist ID |
name |
string |
Required Playlists Name |
user_id |
integer |
Required Users ID |
image |
file |
Playlists Image |
Delete /playlists/:id
belongs_to :playlist
belongs_to :song
GET /playlist_songs
GET /playlist_songs/:id
POST /playlist_songs
Parameter | Type | Description |
---|---|---|
id |
integer |
Playlist Song ID |
playlist_id |
integer |
Required Playlists Id |
song_id |
integer |
Required Songs ID |
Delete /playlist_songs/:id
belongs_to :user belongs_to :likeable, polymorphic: true
GET /poly_likes
GET /poly_likes/:id
POST /poly_likes
Parameter | Type | Description |
---|---|---|
id |
integer |
Poly Like ID |
likeable_type |
varchar |
Required Liked Items Type: "Album", "Song", "Playlist" |
likeable_id |
integer |
Required Liked Items ID |
Delete /poly_likes/:id
belongs_to :user belongs_to :commentable, polymorphic: true
GET /poly_comments
GET /poly_comments/:id
POST /poly_comments
Parameter | Type | Description |
---|---|---|
id |
integer |
Poly Comment ID |
commentable_type |
varchar |
Required Liked Items Type: "Album", "Song", "Playlist" |
commentable_id |
integer |
Required Commented Items ID |
user_id |
integer |
Required Users ID |
content |
text |
Required Comments Text |
Delete /poly_comments/:id
POST /login
Parameter | Type | Description |
---|---|---|
name |
string |
Users Name |
username |
string |
Required Users Username |
email |
string |
Required Users Email |
password |
string |
Required Users Password |
POST /logout
GET /search/:term
GET /trending