I really struggled with the labs leading up to this and as a result I was late getting started. I didn’t even want to jump into it until I felt I had a clue what I was doing which wasn’t until Wednesday of the first week we had allotted to work on this.Â
That said, I really learned a lot about how to approach projects like this. By the time I got started, I realized I was really much more prepared than I thought I was. Nothing to it but to do it! By the end of the first week I already had the bulk of a working app down. I really just needed to trust myself and the process and really dig into the resources I already have available to me.Â
In the end, I’m really very proud of what I created here. There were several really interesting challenges that I was able to overcome. What was interesting was that the things I really struggled with ultimately weren’t the basic requirements of the project, but rather, the extra stuff; the stuff I wanted to add because I wanted to really refine and enhance the final project. I was excited to flex my CSS muscles, and despite the fact that my stylesheet is a bit convoluted and definitely needs refactoring, what is displayed in the end looks, frankly, really freaking cool!
This is mmovies.
The concept here is pretty simple. A user creates and account, searches for movies, and adds their personal review. The inspiration was letterboxd which is an app that allows users to do just that, and..admittedly quite a lot else. In fact, towards the end I was playing with the idea of trying to do a feature by feature clone of that app, but ultimately time and mental energy didn’t allow for that. It’s still something I may give a shot later on. Maybe even for a future project since it seems like the theme I’m going with is movie-related apps.Â
I chose in this case to have 2 models: Users and Movies with Users having many Movies and Movies belonging to Users. Users just have username and password attributes which go through validation at creation. Movies have several attributes like a title and a director as well as a foreign key to associate them with a user.Â
After setting up the database and corresponding models using ActiveRecord, the fun part started. To get going I just pretended I was a user and went through the steps creating what I’d expect to see as I went. That meant beginning at the homepage, moving on to the signup, then login, homepage after that, and so on.Â
The division of which controller specific routes needed to go into felt very natural following that process. I have 3 controllers in this app: an application controller that handles all the signup and login routes as well as some userful helper methods, a users controller which mainly functions to get the homepage to display correctly, and a movies controller which contains the bulk of the CRUD logic.Â
The thing I think I’m most proud of related to this project is managing to use an API (OMDbAPI specifically) to get all the data related to my movies. This was something I’d never touched before and I’m really proud of how much I learned by...well..googling a bunch and thinking really hard. I was able to create a custom search form that returns results from this API and was able to make those results display into a beautifully formatted and functional grid of images.
Each movie poster is a modified radio button that the user can select and then submit a POST request. This creates a movie object that the user can then add their review to. Once the user has typed their review they then send another POST request which sets the review attribute of the movie and associates the movie with the user.
The review was another tricky spot. Persisting long multiparagraph textarea entries can be tricky. When it’s saved, the string will lose the newlines and just display one long block of text. I used .gsub in an admittedly hack-y way to make the formatting of the originally entered text stay. I realize that a textarea is absolutely not idea for capturing long form text in this way, but I made it work and I’m really proud of having figured it out.Â
Beyond that, the user can access the RUD parts of CRUD from the display page. Just a couple simple buttons to allow users to edit or delete their review.
There is definitely a lot more I want to add here as I mentioned before. Users should have a favorite movies collection, a wishlist of movies they’d like to see (and the ability to add reviews of those movies once they’ve seen them), and movies should have a rating in addition to the review. I’d also like to associate users in a social networking type way where users can see what movies their friends have watched recently and view their reviews. I have a bunch of ideas of where this could go, but for now I’m really happy with where I’m leaving this for the moment.Â
Considering I went into this thinking I wouldn’t even be able to finish at all, I’m stoked at the outcome and all I learned along the way!
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
âś“ Live Streamingâś“ Interactive Chatâś“ Private Showsâś“ HD Qualityâś“ Free Actions
Free to watch • No registration required • HD streaming
I went into this project with very little idea of how I would start. I really had to use the resources around me to even begin, but first I had to come up with an idea of what I even wanted to make. Almost on a whim, after a conversation about comic book movies with my nephew, I decided to make something related to returning results related to MCU movies.
After a bit more thought, it seemed like a simple enough task: display a list of all MCU films in order, and then allow the user to get more information about each one. I had a basic idea of what sort of data I wanted to return, title of course, release date, director, and maybe a brief summary. The next step was figuring out where I would scrape this data from.
Initially, I thought that the best source for this was either going to be wikipedia or the official Marvel website. Upon an initial look at the pages themselves and inspecting the code some, I decided to use the official Marvel website.
Here I saw the movie names, and the release date very clearly displayed. Somehow, I didn't think about the fact that any information beyond that lived on pages on click through links and that all of that information was displayed very differently depending on the current level of promotional attention each film was receiving, and whether or not the film had been released yet. This was getting tricky.
Initially I decided to step away for a day and really think about how to approach this. My first instinct was to just scrap it totally and come up with a new idea. At this point I’d written enough code to iterate over the “card” elements on the page, get the movie titles and display them back in a pretty ugly list. It worked but doing much more beyond that was starting to become really frightening task. I could potentially scrape data from each of the individual movie pages. How to do that programmatically? The sources were so inconsistent I didn't see a way to cleanly make that happen and keep the program itself from becoming unnecessarily unwieldily.  The number of conditional statements I’d need was making my head spin. Was this efficiently possible at all?
Ultimately the answer I came up with was no, nothing is impossible but I’d clearly chosen a pretty awful approach to scraping data to make a program from. If only there was some sort of database of movies on the internet, an Internet Movie Database…
That’s when it clicked. I found a very tidy list on IMDb that had everything I was looking for in an organized clear format. What was great was that I was able to use much of the code I’d previously written to grab movie titles and refactor using the new class names. Now all that was left was figuring out the rest of my data.
I remembered the student scraper lab we’d completed previously, and how the data was organized into an array of hashes and how we’d used that to create objects and assign their properties. This was perfect, I’d scrape all the data from the IMDb list, organize it into a bunch of hashes with descriptive keys and the values set to the information I’d scraped, and use that to create a bunch of movie objects with all the properties assigned. At that point all I had to do was display those properties back to my user in a CLI and voila!
The basic structure and flow is like this: I created a scraper class to handle getting data from the website. That class just has one class method in which I iterate over each item in the list (cards) and pull information from them. I kept them in order by using #each_with_index and assigning them to their respective indices in a newly created “movie_array”. Each index of this new array was to be a hash with descriptive symbols as keys (:title, :director, etc) and the respective values being string text data I pulled using Nokogiri methods.
After that created a movie class that would initialize using data from the array of hashes I’ve made to create several new movie objects with all their properties/methods assigned by iterating over the array created in the scraper class and using #send on each iteration. I assigned the job of actually creating the movie objects to a class method .movie_from_hash
Last was the fun part, making the CLI. I technically started here with hard coded data just to make sure I would have a working program at the end of everything. I have an instance method #make_movies that is really just calling the .movie_from_hash method from my movie class. At that point I have an array of movie objects with properties neatly assigned that I can display back to a user however I wanted to.
The greeting just asks the use to either choose to display a list of all the movie titles, or to exit (why would they?). From here the user may type in a number to have more information about the corresponding movie displayed to them. They may continue to do this for any movie they choose, ask to display the list again, or exit the program at any point as well.
There is some validation happening there as well. If the input is a number thats not on the list, or one of the strings the user is prompted with, the program asks the use to make a valid selection rather than just breaking.
If I had more time (and I may go ahead and do this anyway), I’d broaden my scope to not be so narrowly focused on MCU movies, also include X-Men and DCEU movies too. That would simply require searching out a similarly formatted list of movies on IMDb, adding another couple methods to my scraper class, a slight modification to my movie_from_hash class method, and the addition of a few more options of my first level prompt to the user. The bulk of the code is abstract enough that everything else would be pretty much the same as it currently is (well of course I’d have to change the name too.)
I decided to have some fun here and make the terminal output colorful. I’d seen this done in the student scraper lab as well and thought it was cool. I did a bit of googling to figure out how to use that gem here and I think it looks nice. There’s quite a bit of information being shown back to the user and formatting is important to legibility.
Overall I think this bit from the instruction page for this project was the most important reminder for me:
While this is clearly more specifically related to the review, I found it to be useful to reflect on when I was stuck on something during the project, particularly when I had to totally change gears after finding out my initial source for scraping was not feasible.
I learned a lot during this! I’m excited for the next one!
My time with Learn Verified is up (assuming I pass my live assessment on Wednesday). I wanted to use this last blog post to thank some really important people (and things). So, thank you to:
IRB, Tux, rails console, pry, javascript console, and everything else that allowed me to step into my code/database and check out my return values. I couldn’t have done this without you.
The professor for my summer Calc III class, for letting me drop the test I did somewhat poorly on because I spent the entire week before coding instead of doing the homework.
@karliekloss for inspiring me to stick with coding even though I had a million other interests and couldn’t figure out what I wanted to do. Last year, I had the opportunity to ask Karlie how she managed to code even though she obviously had another full time job and was traveling constantly. She mentioned how she continued to use Learn online, and during my time in Europe I found myself doing the same.
And lastly, I have to thank Lydia and Alayna for everything they’ve done for me, from driving me to the airport in Chicago to picking fonts and colors to tirelessly typing book information. I didn’t even know them a year ago, but they have supported me constantly, even while I was away in Europe for six months.Â
Lydia is one of the most thoughtful people I have ever met. She is so on top of EVERYTHING and I have no doubt that I’ll be in my forties and still receiving emails from her about programs/products/etc I should check out. Book Up wouldn’t exist without Lydia’s creativity and smarts (she’s from the first Kode with Karlie class), and I am so grateful to have worked with her on this project.
I used to think that I was a hard worker, but I pale in comparison to Alayna. By now, she has probably typed thousands of lines of book information, not to mention the hours she has spent looking up amazon links, and high quality image links for each book as well. Without Alayna’s willingness to basically single-handedly create the database we needed, I know Book Up would never have gotten off the ground.
I think this is going to end up being a part 1 of 2 posts again. This one will be about the actual project and then the next will be about everything I’ve learned during my time at the Flatiron School.
So this is a basic version of Book Up (with a new color scheme and fonts!) and it’s built with an Angular front end and Rails API backend. I initially really underestimated how much time this project would take me. I thought that because I was using an app that I had already built, adding the Angular front end part would be relatively easy.
It turns out I really didn’t understand Angular or what a front end framework even was until maybe 20 hours after I started this project. I initially tried to just use my Rails version of Book Up and add my Angular files, but I couldn’t get anything to display and I didn’t know if I had a routing problem, a controller problem, or some sort of issue with my services. In the end, I spent maybe 10 hours just reading tutorials and docs and creating really, REALLY basic (Hello World level) Angular apps.
Once I finally understood how Angular was supposed to interact with my Rails API, I turned the original Book Up Rails App into an API. I then turned one of my really basic Angular projects into a basic version of Book Up that just displayed the text from a random book. I had two servers running, one for the API and one for the Angular app, and I realized that I had to combine them at some point.
So I started my final project a third time, and I realized that I was so much more comfortable with Angular because of all the time I’d spent taking my time to look at it more closely. And so here we are at the end:
Part 2 of 2 (Shoutout to Lydia for the artistic direction)
I had to build a quick app for my JQuery/AJAX assessment, so naturally I made a To Read List app (since I might as well stick with the theme). Even after a lot of reading and tutorials on JQuery, I didn’t really understand the whole idea of a rails API backend. I kept getting really frustrated because the data from my GET requests kept rendering as this thing that looked like a hash (which I lated realized was JSON) instead of html, and suddenly it clicked that that was literally exactly what was supposed to happen and that that was what the point of building your own API was.
So I just created a really simple app that lets you enter book titles and have them immediately appear. You can delete and check off books, as well as edit the information for each book without refreshing the page. I also used the Devise gem (which I am beginning to love) to allow users to login/logout.
I was reluctant to style this app at all because I was so sick of only styling Book Up for the past week, but thankfully, my styling expert, Lydia, was on hand to select fonts and colors for me. So in the end I didn’t have much to do but center and pad a few divs. Working with Lydia is actually a dream because she insists on sending you links and hex codes again just so you don’t have to go through your texts to find them. Also once I tried to open a new tab to look up a google fonts import code and Lydia insisted on getting that for me too.Â
Also deserving of mention is Alayna, who spent the car ride back from her college orientation entering books into the Book Up database. Alayna once promised me that I wouldn’t believe the number of books she put into the database in 48 hours and I am proud and happy to say that she was right.Â
Stay tuned for bigger and better reflections this week.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
âś“ Live Streamingâś“ Interactive Chatâś“ Private Showsâś“ HD Qualityâś“ Free Actions
Free to watch • No registration required • HD streaming
Because I’m so horribly bad at keeping up with these.
Anyway, this one is going to be short and sweet because I’ll be writing a ton about this web app in the upcoming week.
I built this project for my Rails Assessment, but before it was that, it was my project at the Flatiron School’s Precollege Intro to Software Engineering course. I came up with the idea with my two wonderful partners (now best friends), Lydia and Alayna, and somehow it ended up getting completed even after being shelved while I was busy figuring my life out in Europe.
Book Up allows users to select books based only on the text of the first page of the book. By formatting all of the first pages in the same way, Book Up removed a potential reader’s ability to judge a book by its font size, weight, author, cover, etc.
One of the greatest learning experiences I had while completing this app happened while I was struggling to set up Devise and OAuth. I kept trying to set it up while kind of following the docs and kind of doing it on my own even though I am definitely not 100% comfortable with authentication. After googling a bunch of errors that I couldn’t make any sense of, a pattern appeared among the many stackoverflow answers that I read. It was basically “I wish I could tell you exactly what the problem was that caused this error, but it went away when I just deleted everything related to OAuth and followed the Devise/OAuth docs EXACTLY.” I was very reluctant to try this strategy at first because it felt like I was throwing out my hard work, but it actually worked the first time I tried it and probably saved hours of work in the end.
The most important thing I learned during the course of this Sinatra project was that waiting until I felt like writing this blog post and recording my video walkthrough just made me not want to do it even more. But, before I get into that:
The Basics
Here’s a link to the repo.
So the app allows people to recommend books to each other. I used my newly acquired (at the time) knowledge of sessions to build a very basic authentication system. I faced two particularly challenging issues while building my book recommendation app: The first was the fact that all objects of the User class could recommend books and be recipients of book recommendations. I ended up simplifying this by adding a “recommender_id” foreign key to my Recommendations table (which was the join table for my Users and Books tables). This way, the “user_id” of the recommendation would be that of the person whose page the book appeared on, but the recommender’s information was still stored and easily accessible. I also create custom setter and getter methods in the Recommendation class for recommender_id just so I could work with it as easily as I worked with my other Active Record objects.
The second issue was my utter inability to style forms. I ended up getting a bit more comfortable with Bootstrap while styling this app, but I still cannot figure out how to style forms the way I would like them. I ended up just centering all the forms. I’ve been trying to style the forms in my next project for the past three days so hopefully I have a breakthrough soon. (Also, the styling on my next project, is much, much, MUCH better so stay tuned for that blog post/video walkthrough.)
EDIT
The forms look totally fine in this app. I literally waited so long to record this video walkthrough and write this blog post that I forgot that I do know how to style forms. The styling issue that i had was that I wanted to display my books in a grid formation but couldn’t get the spacing right.
Reflections
Anyway, it was a terrible idea for me to wait to write about this app because I didn’t realize that as soon as I started learning Rails and moved on to building my Rails project, this project seemed less and less interesting to me. BUT, one really nice thing about returning to my Sinatra app was that I had a meeting last week at the Upperline School of Code, where I’ll be a teaching assistant for a course that culminates in the building of a Sinatra app. Since I’ll be helping students create Sinatra apps, it doesn’t hurt to get some extra practice.
If you know me personally, you probably already know how excited I am to be learning to code at the Flatiron school. Â I am roughly one month into the program so far and loving it. Â
I’ve just wrapped up writing a Ruby gem that allows you to search Indeed.com for jobs for a selected zip code.  It’s been a fun project, once I got started.  It seemed like the hardest part was finding a project that interested me.  I finally settled on a job search, because I hope to be needing that type of service in the next few months.
The gem has a CLI which asks the user to enter a zip code and search terms in order to pull the first 10 jobs returned. My gem gives the option to get more information about each job listing and even allows the user to open the job listing on Indeed.com if they would like more information or to apply.  The only problem is I keep thinking of things I would like to add to it.  Currently the interface only returns the top 10 jobs, but I’d like to add the functionality to list ALL jobs. I know it’s not the most feature rich or the most snazzy gem you’ve ever seen, but it’s my first and I’m proud of it.
If you want to check it out, my source is located at GitHub.
Also, if you are interested in coding and have been looking to learn online, I highly recommend The Flatiron  School.  I’ve enjoyed every minute of the curriculum so far.