https://beatrate.onrender.com/ # BeatRate is a platform that connects musicians to music connoisseurs. The sole purpose of BeatRate is simple: Musicians post albums, and users review them. The website's structure allows people to check out their favorite artists' profiles, check out other users' profiles to see what they're into, see what's regarded as a musician's best works, and express their own feelings on what hits hardest. BeatRate's simple but robust layout allows for many exciting experiences like hearing about new releases on the home page and learning more about a musician or fellow user via their profile details.
Prerequisites
Installation
Clone the repo
Install dependencies pipenv install -r requirements.txt
cd react-app
and run npm install
Create a .env file based on the example with proper settings for your development environment
Setup a PostgreSQL database, user, and password and make sure they match your .env file.
Get into your pipenv, migrate your database, seed your database, and run your app
pipenv shell
flask db upgrade
flask seed all
python run.py
Start the backend Flask server: python run.py
Start the frontend Vite server: npm run dev
Ctrl/Command click the localhost:XXXX
link in the Vite server to open the live link!
Erik Hervall | Cece Potakey | Nikita Kastyshyn
Start by logging in:
Method: POST
URL: /api/auth/login
Body:
{
"email": "demo@aa.io",
"password": "password"
}
Successful Response:
{
"is_musician": false,
"email": "demo@aa.io",
"firstname": "Demo",
"id": 3,
"lastname": "User",
"username": "demouser",
"description": "This is the demo user's bio",
"image_url": "https://demo.image/url.jpg"
}
Method: POST
URL: /api/albums
Body:
{
"title": "Album Name",
"release_date": "Tue, 11 Jun 2021",
"description": "This is an album!",
"image_url": "https://this.is.an/image.url",
"user_id": 1
}
Successful Response:
{
"id": 10,
"title": "Album Name",
"release_date": "Tue, 11 Jun 2021",
"description": "This is an album!",
"image_url": "https://this.is.an/image.url",
"user_id": 1,
"created_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"updated_at": "Tue, 11 Jun 2024 14:15:49 GMT"
}
Method: GET
URL: /api/albums/
Body: none
Successful Response:
{
"albums": [
{
"id": 10,
"title": "Album Name",
"release_date": "Tue, 11 Jun 2021",
"description": "This is an album!",
"image_url": "https://this.is.an/image.url",
"user_id": 1,
"created_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"updated_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"songs": [
{
"name": "Main Song",
"created_at": "Fri, 24 May 2024 05:00:36 GMT",
"duration": 78,
"id": 1,
"updated_at": "Fri, 24 May 2024 05:00:36 GMT"
},
]
},
{
"id": 11,
"title": "Album Name 2",
"release_date": "Tue, 11 Jun 2021",
"description": "This is an album!",
"image_url": "https://this.is.an/image.url",
"user_id": 1,
"created_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"updated_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"songs": [
{
"name": "Another song",
"created_at": "Fri, 24 May 2024 05:00:36 GMT",
"duration": 78,
"id": 1,
"updated_at": "Fri, 24 May 2024 05:00:36 GMT"
},
]
}
]
}
Method: GET
URL: /api/albums/:albumId
Body: none
Successful Response:
"album": [
{
"id": 10,
"title": "Album Name",
"release_date": "Tue, 11 Jun 2021",
"description": "This is an album!",
"image_url": "https://this.is.an/image.url",
"user_id": 1,
"created_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"updated_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"songs": [
{
"name": "Main Song",
"created_at": "Fri, 24 May 2024 05:00:36 GMT",
"duration": 78,
"id": 1,
"updated_at": "Fri, 24 May 2024 05:00:36 GMT"
},
]
}
]
Method: PUT
URL: /api/albums/:albumId
Body:
{
"title": "Album name but edited",
"release_date": "Tue, 11 Jun 2029",
"description": "This is an album description but updated!",
"image_url": "https://this.is.an/image.url/but/updated/woohoo",
"user_id": 1
}
Successful Response:
{
"id": 10,
"title": "Album name but edited",
"release_date": "Tue, 11 Jun 2029",
"description": "This is an album description but updated!",
"image_url": "https://this.is.an/image.url/but/updated/woohoo",
"user_id": 1,
"created_at": "Tue, 11 Jun 2024 14:15:49 GMT",
"updated_at": "Tue, 16 Jun 2024 94:95:49 GMT"
}
Method: DELETE
URL: /api/albums/:albumId
Body: none
Successful Response:
{
"message": "Album deleted successfully"
}
Method: POST
URL: /api/songs/albums/:albumId
Body:
{
"album_id": 1,
"title": "A new song",
"duration": 5,
"image_url": "https://example.image/url.jpg"
}
Successful Response:
{
"album_id": 1,
"title": "A new song",
"duration": 5,
"image_url": "https://example.image/url.jpg",
"created_at": "Tue, 11 Jun 2024 15:37:38 GMT",
"id": 40,
"updated_at": "Tue, 11 Jun 2024 15:37:38 GMT"
}
Method: DELETE
URL: /api/songs/:songId
Body: none
Successful Response:
{
"message": "Your song has been deleted sucessfully"
}
Method: GET
URL: /api/reviews/albums/:albumId
Body: none
Successful Response:
{
"reviews": [
{
"created_at": "Tue, 13 Jun 2024 14:18:29 GMT",
"id": 26,
"comment": "Great album!",
"rating": 5,
"album_id": 1,
"user_id": 5,
"updated_at": "Tue, 13 Jun 2024 14:18:29 GMT"
},
{
"created_at": "Tue, 11 Jun 2024 14:18:29 GMT",
"id": 27,
"comment": "Ok album!",
"rating": 3,
"album_id": 1,
"user_id": 1,
"updated_at": "Tue, 11 Jun 2024 14:18:29 GMT"
}
]
}
Method: POST
URL: /api/reviews/albums/:albumId
Body:
{
"comment": "Great album!",
"rating": 5,
"album_id": 1,
"user_id": 5
}
Successful Response:
{
"created_at": "Tue, 11 Jun 2024 14:18:29 GMT",
"id": 27,
"comment": "Great album!",
"rating": 5,
"album_id": 1,
"user_id": 5,
"updated_at": "Tue, 11 Jun 2024 14:18:29 GMT"
}
Method: PUT
URL: /api/restaurants/:restaurantId/reviews/:reviewId
Body:
{
"comment": "I changed my mind, this album is mid.",
"rating": 3
}
Successful Response:
{
"created_at": "Tue, 11 Jun 2024 14:18:29 GMT",
"id": 27,
"comment": "I changed my mind, this album is mid.",
"rating": 3,
"album_id": 1,
"user_id": 5,
"updated_at": "Tue, 13 Jun 2024 13:38:39 GMT"
}
Method: DELETE
URL: /api/restaurants/:restaurantId/reviews/:reviewId
Body: none
Successful Response:
{
"message": "Succesfully deleted your review"
}
Method: GET
URL: /api/reviews/albums/:albumId
Body: none
Successful Response:
{
"reviews": [
{
"created_at": "Tue, 13 Jun 2024 14:18:29 GMT",
"id": 26,
"comment": "Great album!",
"rating": 5,
"album_id": 1,
"user_id": 5,
"updated_at": "Tue, 13 Jun 2024 14:18:29 GMT"
},
{
"created_at": "Tue, 11 Jun 2024 14:18:29 GMT",
"id": 27,
"comment": "Ok album!",
"rating": 3,
"album_id": 1,
"user_id": 1,
"updated_at": "Tue, 11 Jun 2024 14:18:29 GMT"
}
]
}
Method: POST
URL: /api/reviews/albums/:albumId
Body:
{
"comment": "Great album!",
"rating": 5,
"album_id": 1,
"user_id": 5
}
Successful Response:
{
"created_at": "Tue, 11 Jun 2024 14:18:29 GMT",
"id": 27,
"comment": "Great album!",
"rating": 5,
"album_id": 1,
"user_id": 5,
"updated_at": "Tue, 11 Jun 2024 14:18:29 GMT"
}
Method: PUT
URL: /api/restaurants/:restaurantId/reviews/:reviewId
Body:
{
"comment": "I changed my mind, this album is mid.",
"rating": 3
}
Successful Response:
{
"created_at": "Tue, 11 Jun 2024 14:18:29 GMT",
"id": 27,
"comment": "I changed my mind, this album is mid.",
"rating": 3,
"album_id": 1,
"user_id": 5,
"updated_at": "Tue, 13 Jun 2024 13:38:39 GMT"
}
Method: DELETE
URL: /api/restaurants/:restaurantId/reviews/:reviewId
Body: none
Successful Response:
{
"message": "Succesfully deleted your review"
}