The server side of a simple web application that allows musicians to keep track of music and gigs. The code for the front-end can be found here.
This repository is the back-end of my final project for the Web Development Course at Eleven Fifty Academy.
Built with
The server side consists of 4 main controllers with the following endpoints
POST
Returns a token for the user to interface with their information
Request
{
"email": "[email protected]",
"password": "password123"
}
Response
{
"token": "jsonwebtoken",
"userType": "admin | user"
}
POST
Creates a new default user with the specified email and password.
Request
{
"email": "[email protected]",
"password": "password123"
}
Response
{
"token": "jsonwebtoken"
}
Retrieves all the music in a user's library
Response
{
"results": [
{
"title": "Number 9",
"artist": "Moon Hooch",
"style": null,
"instrument": "Saxophone",
"duration": "00:04:26"
},
{},
{}
]
}
Creates a new piece in the user's library
Request
{
"title": "Drunk",
"artist": "Sungazer",
"style": null,
"instrument": null,
"duration": "00:03:27"
}
*Only title required
PUT
Request
{
"title": "Drunk",
"artist": "Sungazer",
"style": "JAZZ",
"instrument": "BASS",
"duration": "00:03:27"
}
DELETE
Deletes a specified piece if it belongs to the user
Retrieve a list of all gigs made by user
Response
{
"gigs": [
{
"name": "Johnson Wedding",
"date": "2021-06-30"
},
{},
{}
]
}
Creates a new gig in the user's account
Request
{
"name": "Christmas Livestream",
"date": "2020-12-24"
}
Retrieves all info for the specified gig including name, date, and songs with notes
Response
{
"name": "",
"date": "",
"music": [
{
"title": "O Holy Night",
"artist": "Adolphe Adam",
"style": "Holiday",
"instrument": "Piano",
"duration": "00:03:27",
"set": {
"notes": "Should be in the key of D for the singer"
},
}
{},
{}
]
}
Updates the info, either name or date, of the specified gig
Request
{
"name": "Christmas Eve Livestream",
"date": "2020-12-24"
}
Deletes the specified gig
Adds a new song from the user's library to the specified gigs including notes specific to gig
Request
{
"musicId": 27,
"notes": "I will probably change this endpoint to be consistent with the others"
}
Updates the gig-specific notes for a song on the gig
Request
{
"notes": "We should transpose the bridge up a M3"
}
Deletes a song from the specified gig
Retrieves a list of all users
Response
{
"users": [
{
"email": "[email protected]",
"password": "hashedpassword",
"userType": "admin | user"
},
{},
{}
]
}
Deletes the user with the specified ID
Updates the password for the user with the specified ID
Request
{
"password": "newpassword456"
}
Gives a specified user Admin status