This week, we talked about
- rails
- database schemas (use the online schema designer)
- authentication
- authorization
- git workflow
This afternoon, use these new skills to start adding the following features to a new Rails application. TDD is not dead.
Use this question guide to establish group norms.
- IdeaBox
- GifGenerator
- PointBox
- Original Idea
Let's create an app to record your ideas. Host your app live on Heroku. Users can create, edit/update, show, and destroy only their own ideas.
- ideas belong to a category
- categories can be created and destroyed by a logged-in admin user (regular logged in users cannot create or destroy categories)
- when a user types a new idea into the form, there is a selection dropdown for choosing the correct category
- allow users to add images to their ideas
- an image can have many ideas and an idea can have many images
- images can only be created by an admin user
The most simplistic way to implement images is to store a url to an online image. If you're feeling fancy and want to upload your own images, check out Carrierwave or Paperclip.
- users need to log in to see their ideas
- users can only see their own ideas -- they should not be able to visit another user's page
- users cannot create ideas for other users
- users cannot create new categories -- only the admin can do that
- users cannot create images -- only the admin can do that; however, a user can assign an image to their idea
- visitors can create user accounts
- Implement Twitter, Github, or Facebook OAuth login
- Use HAML for your views
- TDD using RSpec instead of Test::Unit
Create an app where users can "favorite" gifs.
- Admins can generate gifs by entering a one-word search term in field and then clicking "generate gif". This should create a new gif in the database. This feature is not available to regular users.
- Gifs should have an image_path. See above "Images" in project #1 for more info on implementing images.
- Use the GiphyApi to generate gifs.
- Regular users can mark a gif as "favorite".
- Regular users can see a list of all of the gifs they've marked as favorites.
- Regular users cannot delete a gif; they can only "unfavorite" it for themselves.
- Regular users should be able to see all gifs sorted by category.
- Regular users should be able to see favorited gifs sorted by category.
- Gifs belong to a category (category is the original word that was searched for by the admin).
- categories can be created and destroyed by a logged-in admin user (regular logged in users cannot create or destroy categories)
- users need to log in to see their favorited gifs
- users can only see their own favorited gifs -- they should not be able to visit another user's page
- users cannot create favorites for other users
- users cannot create new categories -- only the admin can do that
- users cannot create gifs -- only the admin can do that
- visitors (non-registered users) can create user accounts
- Implement Twitter, Github, or Facebook OAuth login
- Use HAML for your views
- TDD using RSpec instead of Test::Unit
Create an app where an admin (let's say for example, Richard) can assign points to users and users can redeem those points for rewards. Host your app live on Heroku.
- points can be created ("assigned to a user") and destroyed only by the admin
- users can see their total number of points on their dashboard
- rewards can be created, edited, updated, and destroyed only by the admin
- the list of possible rewards can be seen by regular users
- users can redeem their points for a reward
- when users redeem their points, the points are NOT destroyed; instead, they are marked as "redeemed"
- when a user redeems points for a reward, the user can see that reward on their dashboard
- users need to log in to see their points and rewards
- users can only see their own points and rewards -- they should not be able to visit another user's page
- users cannot add points to their account, nor can they create new rewards to add to the list
- a user cannot redeem another user's points
- admin can create a user
- Implement Twitter, Github, or Facebook OAuth login
- Use HAML for your views
- TDD using RSpec instead of Test::Unit
That's right. You are creative and I believe in you. Feel free to pitch an original idea for the mini-project.
- Deploy to Heroku
- Authentication/Authorization
If you choose to do this option make sure you try to implement all the concepts we've touched over the last week. For example:
- TDD - model and feature tests
- CRUD
- 1-1 and 1-many relationships
- ReST-ful routes
- Well structured relational database design
- Rails helpers
- Sessions, flashes and maybe cookies if you have a good use case for them.
- Authentication
- Authorization
Finish implementing the project over the weekend with your pair. Add the link to your project repository and Heroku URL to this document.