Git Product home page Git Product logo

tunr_sinatra's Introduction

Tunr 1.0!

We're going to be building Tunr, the worlds #1 music catalog / player (those Spotify haters can't keep up with us).

Part 1 - Database / Schema / Models

In this repo are three files artist_data.rb, song_data.rb, seeds.rb and console.rb. Ultimately we want to use the seeds.rb file to seed our database and the console.rb file to be a REPL for our Sinatra app.

Create the database

Create a postgres database called tunr_db. Make sure to use that exact name, or you'll have trouble later on!

Create a schema

Inside the db folder, create a schema.sql file, and then load it into your tunr_db database.

Here's what our data model looks like:

Artists

column name type
id primary key (int)
name text
photo_url text
nationality text

Songs

column name type
id primary key (int)
title text
album text
preview_url text
artist_id foreign key (int)

Create the Models Using Active Record

Load the Seed Data

Set up Sinatra app

  • Define a route with view defined at /. For now it should say Hello World when you visit that url.

Part 2 - Build a RESTful Interface using Sinatra

Make sure to commit after completing each feature. Don't move to the next feature without first finishing a feature.

The Index Feature

Build the index feature for artists

If you need a reference, check out the index part of the AR/Sinatra lesson

The Show Feature

Build the show feature for an artist

If you need a reference, check out the show part of the AR/Sinatra lesson

The Create Feature

Build a feature that creates a new artist in the database.

If you need a reference, check out the create part of the AR/Sinatra lesson

The Edit Feature

Build a feature that allows a user to edit an existing artist in the database

If you need a reference, check out the edit part of the AR/Sinatra lesson

The Delete Feature

Build a feature that allows users to delete an existing artist from the database.

Bonuses

  • create the 7 RESTful Routes for songs
  • make songs a nested route under artists

Mega-Bonuses

  • Make a third model like playlists
  • incorporate user authentication

tunr_sinatra's People

Contributors

andrewsunglaekim avatar mvaden avatar

Watchers

James Cloos avatar  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.