Giter Site home page Giter Site logo

gigtrackerserver's Introduction

Gig Tracker Server

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.

Motivation

This repository is the back-end of my final project for the Web Development Course at Eleven Fifty Academy.

Tech/framework used

Built with

API reference

The server side consists of 4 main controllers with the following endpoints


/user

user/login

POST

Returns a token for the user to interface with their information

Request

{
	"email": "[email protected]",
	"password": "password123"
}

Response

{
	"token": "jsonwebtoken",
	"userType": "admin | user"
}

user/register

POST

Creates a new default user with the specified email and password.

Request

{
	"email": "[email protected]",
	"password": "password123"
}

Response

{
	"token": "jsonwebtoken"
}

/music

/music/ - GET

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"
		},
		{},
		{}
	]
}

/music/new - POST

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

/music/<musicId>

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


/gig

/gig - GET

Retrieve a list of all gigs made by user

Response

{
	"gigs": [
		{
			"name": "Johnson Wedding",
			"date": "2021-06-30"
		},
		{},
		{}
	]
}

/gig/new - POST

Creates a new gig in the user's account

Request

{
	"name": "Christmas Livestream",
	"date": "2020-12-24"
}

/gig/<gigId> - GET

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"
			},
		}
		{},
		{}
	]
}

/gig/<gigId> - PUT

Updates the info, either name or date, of the specified gig

Request

{
	"name": "Christmas Eve Livestream",
	"date": "2020-12-24"
}

/gig/<gigId> - DELETE

Deletes the specified gig

/gig/<gigId>/add - POST

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"
}

/gig/<gigId>/<musicId> - PUT

Updates the gig-specific notes for a song on the gig

Request

{
	"notes": "We should transpose the bridge up a M3"
}

/gig/<gigId>/<musicId> - DELETE

Deletes a song from the specified gig


/admin

/admin/users - GET

Retrieves a list of all users

Response

{
	"users": [
		{
			"email": "[email protected]",
			"password": "hashedpassword",
			"userType": "admin | user"
		},
		{},
		{}
	]
}

/admin/users/<userId> - DELETE

Deletes the user with the specified ID

/admin/updatepassword/<userId> - PUT

Updates the password for the user with the specified ID

Request

{
	"password": "newpassword456"
}

/admin/add/<userId> - PUT

Gives a specified user Admin status

License

© Conor Broaders

gigtrackerserver's People

Contributors

cbroaders12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.