Please fork this repo. By 9:00am Friday, June 23th, submit your work as a pull request.
- As a user, when I go to the app's root url, I should see a welcome page.
- As a user, when I visit "/songs", I should be able to see all of the songs in my database.
- Bonus: As a user, when I click on a song it starts playing. The world is a better place
What follows are not explicit steps. Just guidelines to approach building out this Angular application.
- Run
rails new -d postgresql wdi_radio_api
to create a new rails app for your back end - Set up a model and run a migration for songs
- Write seed data to create instances of songs
- Define a controller for songs that has at least an
index
method that renders JSON for all songs in your database
- Create a main directory for your
wdi_radio
application - Create an
index.html
in your application's main directory - Make sure to load in any appropriate libraries via CDNs
- Create a
js
directory to store all of your Javascript files - Create the main
app.js
file and define the module for the angular app - Bootstrap the newly defined module in
index.html
- Add
ui.router
as a dependency and configure your app's routing inapp.js
- Add a state for the routes
/
and/songs
- Create templates for these routes
- Add
ngResource
as a dependency and set up a factory to retrieve data from your Rails API running onlocalhost
- Define a controller to handle songs
- Access the data from your songs factory and save it as a property on the controller
- Use data attached to your view model to display a list of all songs
- Implement full CRUD for Songs
Implement a "player" using an Angular custom directive
- When you click a song, a player view renders somewhere in the index
- Get the song to play
- Some options for the song player...
- Soundcloud embed
- Spotify embed
- Stream a local audio file using the HTML
<audio>
tag
If you finish this bonus, look into how you could integrate Spotify's API into your WDI Radio app.