Exercise
Turn in your project the same way you turned in Lekker Plekke and the weekend homework. Create the app in your iXperience folder (not inside of session0202_exercises) and initialize a new git repository. Connect your local repo to a new GitHub repo and push your code. Refer to this Github Resource if you are unsure how to create a new Github repo. When your app is complete, share the link via Piazza.
BruGram
Problem Statement
Brus, it's all about the insta. Let's re-create an Instagram-like app just for brus to share all the sick pics we've taken so far.
Project Description
MVP
MODELS:
- User: authentication must be implemented with Devise.
- Photo: must at least have an attribute
public
, which is a boolean. indicating the privacy of a photo, caption
which is of type text
, and an attribute for image
, which is a URL. The URL is a string
.
- Comments: must at least have an attribute
body
which is of type text
.
ASSOCIATIONS:
- User has many Photos, Photo belongs to User
- Photo has many Comments, Comment belongs to Photo
ACTIONS:
- A user should be able to log in and out
- If a user is logged in, a user should be able to CRUD photos associated to that user, but should only be able to R photos associated to other users if the photo is
public
.
- A logged in user should also be able to CRUD his or her own comments on public photos, and R comments of other users.
VIEWS:
- View all photos: view all photos of all users
- View all personal photos: view all photos of current logged in user
- View a specific photo: view single photo and comments associated with that photo
- Install and use Bootstrap
Bonus (you must pick at least one!)
- (EASY/INTERMEDIATE) More authentication: Implement Omniauth in addition to Devise by following this Omniauth Tutorial exactly (assumes you already have Devise installed). To get the
APP_ID
and APP_SECRET
for Facebook, you need to visit Facebook Developers and create a new app.
- (INTERMEDIATE) Playing with gems: Implement file uploads via the Paperclip gem to replace image URLs in the Photo model. Replace authorization (privacy of photos) with the Pundit gem. Checkout these slides or this article for some guidance.
- (INTERMEDIATE) Likey likey: add in
likes
, which is an integer
, to your Photo and Comment model. Add in functionality for users to like photos and comments. The number of likes should then be displayed next to the respective photos or comments. Food for thought: a user can only like something once!
- (ADVANCED) #Hashtag: Implement hashtags by creating a Hashtag model. Implement views that will display all photos associated with a specific hashtag. To do so, you must extract all hashtags in a photo caption. Hint: When are hashtags created? What does this mean about where this code lives in your app? Use Google to help you figure out how to extract the hashtags from the photo caption!
- (EXPERT) Follow me: Implement functionality to support followers. Users should be able to follower other users, and have followers. Get creative on what types of features you can now support. For example, you could implement a feature that will allow a user to adjust a photo's privacy setting to "followers only".
Great work! Now add and commit your work then push it to GitHub :)