Firebase, Firestore, AWS, and Jurassic Gains

Posted on Posted in Uncategorized

Adding Authentication with Firebase and AWS Amplify

This past week has been a lot of fun. I have developed a login system to my Android application “Jurassic Gains”. This took a few days to figure out, but was pretty smooth and easy once I realized how to do it. I was given a demonstration about a month ago at a JavaScript meetup of adding authentication using AWS Amplify for a web application. I thought it was super cool so I wanted to do it for my Android Application. It all seemed easy like it could be done in less than an hour. So, I started working on the authentication using AWS Amplify. To my surprise, I was very confused on how to get it working (for Android) reading their documentation. It seemed very complex and there wasn’t much support for it. I spent about 2 days trying to understand what I needed to do and made close to no progress. I started thinking “I wonder if there are other companies that offer this service”. A quick google search led me to Google Firebase (wonder why). From the small research I did on it, it at least deserved a shot after the minimal progress I was making with AWS Amplify. After about half a day working with Firebase I made a lot more progress with adding the authentication. There was much better documentation and support (in my opinion). The process was much smoother and more understandable. I created an email login page using their services in about a day and a half. I noticed they also have this thing called “drop-in Auth”. This type of authentication gives users the ability to login using social sites like Google and Facebook. It also can save their password so they don’t have to remember their login credentials every time they want to login. I thought it may be long and complex, but I thought I would give it a shot. It took me only a few hours to add this authentication to my Application.  It was a lot easier than creating my own login page. The Firebase drop-in Auth made the process even easier. I didn’t even have to hardly worry about designing my own login page. The drop-in UI did all of that for me. It was amazing. I can login to Firebase’s Google Console and see everyone who creates a page. I don’t think my judgment between Firebase and AWS Amplify is fair right now as I don’t have a ton of experience using these two technologies. But I think that Firebase is better at the moment for Android Developers.


Firestore, NoSQL, SQL Databases

The next step for my “Jurassic Gains” application would be to allow users to save their preferences to the cloud. Right now everything is saved through local Shared Preferences. This has given me more than a few headaches over the last couple of days. Firebase has a thing called Firestore which gives you the ability to create NoSQL databases. I have never worked with NoSQL databases. Firebase also has a thing called “Firebase Realtime Database”. I immediately jumped right in and went with Firebase’s Firestore. This process was not nearly as easy as I thought it would be. My application requires data to contain a lot of nested arrays and maps. I thought this would be no problem as it is a document. Therefore, I thought it would be just like grabbing data from json. I was wrong, wrong, so wrong. You can’t just grab the data from Firestore as JSON. When I get the data, Firestore gives it to me as a map of all the fields and their values. Since I have a lot of nested lists and objects, it takes a lot of work to dive deep into these values. It has gotten me thinking that maybe using Firestore isn’t the right approach to this problem. Maybe I should have figured out a way to use a SQL database. Earlier tonight, I figured out a way to get to the nested values. I believe I am on the right path. So as of now, I plan on sticking with Firestore.


The Future of Jurassic Gains

Jurassic Gains is becoming the project that I want to turn into a marketable product. Sure, it is already an Android Application, but, I want to expand the horizon and give users a product they want. I want to make a website version of the application so that users can go on their computers and track their exercise progress. I also want to make it dynamic so that users can create their own exercise routines. The application should have groups. Groups with a “Master User” (like a sports coach or a personal trainer) that can create exercise routines and allow players/trainees to input their progress each week. The Master User can then track his players and see their progress. This requires a lot of work. I realize this is probably going to take close to a year to develop. But, I believe it will happen.

Leave a Reply

Your email address will not be published. Required fields are marked *