Goal: Use React-Redux to create a single-page trivia application.
Building my trivia app was a long but rewarding process. I was tasked with creating two apps, essentially: a Rails API backend to handle data persistence and a React-Redux frontend. To me, it made the most sense to begin with the backend as that’s where my users’ data would be stored, and, though it wasn’t a project requirement, I knew that other features of my app would require ‘log in’/’sign up’ functionality.
To create a Rails API skeleton I ran:
rails new [api_name] — api
I then versioned my controllers so…
User Experience will make or break a website (and the company behind it). Page taking too long to load? On to the next. Site too difficult to navigate? There goes your revenue.
One of the most important features of any app is authentication. In its simplest form, you want your user to be able to sign up, log in, and log out securely. You could rely on Rails’ built in method
has_secure_password to provide that functionality, but then you’re required to add necessary password validations and helper methods yourself. And what if your user forgets their password? That quickly gets complicated. While it is important to understand the basic steps involved in authentication, once you do, there is a much simpler way to achieve it, and much more.
The Devise gem was…
To say this was a grueling undertaking would be an understatement. At times my RESTful routes had me feeling like I was in a maze with no maps, despite four controllers full of them. I understood the concept and the logic, but why weren’t my routes taking me where I wanted them to?
A few days into building my app, it became glaringly, painfully clear that I should have created a diagram of my app behaving how I wanted it to and then built it from there.
Takeaway #1: Literally map out your CRUD (Create, Read, Update, Delete) functionalities, view…
Like the beginning of any project, staring at a blank slate was by far the scariest part. First, I had to decide what I wanted my gem to be able to do, so I asked myself what I would find fun or helpful, or both. Beer is fun. Knowing which beers I absolutely must try is helpful. How about a gem that can access Beeradvocate’s top rated new beers? Yes, please!
Full Stack Developer