Merch Challenges

This is the spot I’m using to document some of the challenges the Merch team and I have faced over the course of the project. I’ll try and include code snippets as much as possible to show what we’re dealing with but that all depends on time. By the way, my partner in crime on this project is @tahaadiljalil; a new friend from Bitmaker Labs in Toronto. Enjoy!

First Steps: User Sign Up and Log In #

Essentially, we built this whole step nearly to completion locally on our machines using a pretty standard Rails setup and gemset which worked really well until we had to integrate what we had with [Parse](www.parse.com). Getting our baby Rails app to share data with a prebuilt database on Parse proved to be a pretty big speed bump. Naturally, we spent some time searching out a solution and eventually thought we’d found one. Enter parse_resource.

The goal of parse_resource is to make interacting with Parse’s REST API as close to working with ActiveRecord as possible; according to the docs “Ruby/Rails Developers should feel right at home”. That seemed like a good sign so we decided to include it in the gemfile and get to work. On the surface it seemed like we’d found a straightforward solution and we were excited to implement it but five minutes into our relationship with parse_resource the cracks in our strategy started to show.

Before I go any further I want to say how impressed I am that the original author and maintainer has continually responded to issues, questions and pull requests, and generally been another example of how helpful the Rails community can be to one another. It doesn’t seem like he has a lot of time for this gem in particular but he’s at least involved and helpful which is great.

Like I just said, parse_resource has been (and continues to be) a bit of a headache for Taha and I. First, the methods provided by the authentication gem we were using, Sorcery, stopped working for us. So we removed Sorcery and tried to move on. Then the same thing happened with a few more of our gems: SimpleForm, Carrierwave, and (oddly enough) Hirb.

Okay, now this looks a little bigger than we’d bargained for. Taha and I took a step back and talked through our next steps and decided to approach the problem differently by learning more about our tools and then implementing them. So we set up a separate repo and spent an afternoon learning about Parse, reading issue logs for parse_resource, and trying to work out why some of our gems had failed on us. That turned out to be a great strategy.

Because we had done a lot of the build already, we had a good codebase to work off of and rebuild from. Since all of our forms were now broken and we knew how to code with Rails form helpers, we just removed the offending gem (SimpleForm) and rebuilt with form_for instead. Eventually we had forms working once again. This little victory gave me some traction and I started work on getting a user to sign up on the web app and then able to log in to their account from the iOS application. By the end of the day, Matt and I logged in to Merch from his iPhone successfully and I got to check off another piece of functionality as ‘complete’ before moving on to the next thing.

We’re still working out an authentication system for the web app but it should be finished today. After that we’ll be tackling image uploads for a user’s Avatar potentially without the help of Carrierwave (it doesn’t play well with parse_resource). Those challenges will be for other posts but I will say that so far on this project I have learned so much more than I was expecting and my confidence with coding and development in general has gotten a real boost despite the sometimes-looming obstacles. All of those obstacles are learning experiences for Taha and I, and as frustrating as they are, the feeling of overcoming just one of them is enough to keep us coming back for more.

 
9
Kudos
 
9
Kudos

Now read this

bitmaker labs: filling in the gap

I told myself to take time and write about Bitmaker Labs earlier than the end of the 7th week. Ideally I wanted to write about it at the end of every week rather than once near the end of the program. But it got busy and I forgot, so it’... Continue →