Bootcamp
Search…
4.POCE.2: Drummers for Hire

Introduction

Create an app that allows anyone to hire a drummer for their party or event.

Routes

URL Path
Method
Purpose
/drummer/:id
GET
Render a single drummer. The id param is a primary key from the users table.
/reservation/:drummer_id
POST
Accept a post request to make a reservation with this drummer. The drummer_id param is a primary key from the users table.
/reservations/:drummer_id
GET
Get a list of all reservations for this drummer.
/
GET
Render a list of drummers.

Getting Started

Begin by forking the exercise repo: https://github.com/rocketacademy/drummer-mvc-bootcamp​

Base

Part 1

Begin by making the migrations and seed data for the app.
For simplicity, seed the app with all of the drummers. That is, don't allow creation of new drummers in the app.
The app has no user login. Anyone can create a reservation.
A reservation only has a date. A drummer is hired by day only (no time).
A drummer has many reservations.

Part 2

When creating the routes begin with a single route and then follow with it's associated MVC components.
Create a route. If needed add a new controller. If needed add a new model. If needed add a new EJS file. Don't add all routes or models or controllers at once.
Create the routes in the order shown above.

More Comfortable

Price

Add a per-gig price for each user/drummer. Create a migration to add this column to the drummers table.

Equipment

Add the ability for the drummer to record what equipment they have, such as a drum set or other percussion instruments such as a xylophone. A drummer can have many pieces of equipment. Since the app does not allow creation of a new drummer, create the seed data for all equipment as well.

Users

Add the ability for users to log in and reserve a drummer.

Reference solution

Click here to see the reference solution for this post class.