Photo by Artur Shamsutdinov on Unsplash

Signing user up, in and out are nearly universal features for every type of app. In this series I’ll teach you how to build a simple authentication system. Part 1 will cover the basics of API calls and models. In part 2 I’ll teach you how to store authenticated users inside your app with the Cubit package and in part 3 we’ll be learning how to maintain sign-in after our app closes by using the shared preferences package.


Learn to code:

Creating a Base API class:

Our first step is to build a BaseAPI class to hold all of the URL’s of…

Thoughts & Fitness

While building the Thoughts & Fitness E-commerce platform I ran into a very interesting problem. My client wanted to be able to create daily workouts on his site. Each workout would have a given number of lifts and the number of lifts for each workout would vary.

Usually, when dealing with associated models we tend to use nested resources, but in this scenario, nested resources would make it very cumbersome to add lifts to each workout. I needed a dynamic form, one that would allow me to seamlessly add new forms for each lift in the daily workouts.

Gem File Configuration

For this…

Before we accept payments or subscriptions in Stripe we need register our users as customers in the stripe API. For this tutorial I’m already assuming that you have a user model and already have Stripe setup within your project.

Every time we create a user we’re going to create a corresponding Stripe Customer object and save the customer id to our user model. First lets add a stripe_id to our user model:

rails g migration AddStripeIdToUsers stripe_id:string
rails db:migrate

Next we’re going to create a method that makes a call to the Stripe API to create an instance of Customer…

Photo by JOSHUA COLEMAN on Unsplash

Active Storage is a tool which allows us to attach files to our Rails Models. These attachments are dynamic, they can be anything we want form PDFs to JPG files. In this tutorial I’ll teach you the basics of uploading files with Active Storage and how to use attachments in an API setting.

Need an App? Checkout Gardner App Development

The Official Corey’s Corner Podcast:

Learn Ruby on Rails Here:

First add this to your GemFile

gem 'activestorage'

Then from the console run

rails active_storage:install

followed by

rails db:migrate

Active Storage uses three tables in your application’s database…

JSON or Java Script Object Notation is a way of storing data using key/value pairs, it is essentially the exact same thing as a hash or map. In the past I’ve used the JSON in my Rails models in order to simplify my database.

When I was building the Newport Marine Detailing application I decided to use JSON in order to keep track of each appointments services. Ultimately this made my application a lot easier to build because I didn’t have to create a new Services model or associate it with existing models. The corresponding migration looked like this:


Photo by Michael Dziedzic on Unsplash

In the last tutorial I taught you how to build a Customer model and API for authentication. To make our Customer objects available in our widgets we’ll be using Cubit’s from the flutter_bloc package (be sure to install this package before following along). Let’s get started !


Learn to code:

Cubits are a subset of the BLOC architecture. I think of Cubits as a form of state that exist throughout the application. …

Newport Marine Detailing now available on iOS

I’ve been coding for about two years but I really didn’t get into web and iOS app development until last year. I’m entirely self-taught and last month I launched my first app in the Apple Store, here is how I did it.

I began to learn how to code by watching YouTube tutorials. When I knew that I wanted to become a “real” developer I decided to invest in myself and bought Michael Hartl’s Ruby on Rails Tutorial and later on purchased his Learn Enough To Be Dangerous courses. …

I read somewhere that programmers begin to lose concentration and productivity when their files exceed ~120 lines. Dart is a statically typed language that tends to eat up a lot of space, making API calls to your backend can become a bit of a hassle if you don’t organize yourself properly.

The first thing I like to do is create a BaseAPI class to store all of the URLs my app will be requesting:

static var rootUrl = "https://localhost:3000/"
var usersPath = rootUrl + "users"
// More Urls

By defining root as a static var we do two…

Viruses are fascinating because they blur the boundaries between life and death, they are self replicating yet considered to not be alive because they don’t have a metabolism. Viruses are also a lot like computer hackers, a computer hacker hijacks the host network for her own purposes while viruses hijack the cellular machinery of other organisms to replicate themselves.

An idea is a perspective on reality. Ideas are a lot like viruses without us humans they wouldn’t exist. They replicate by hopping from person to person and eventually from culture to culture. …

There are times when my mind gets out of control. My mind tackles problems I am having in my life by thinking about them over and over again. This constantly occurs and it takes months or years for my mind to stop engaging in self destructive habitual rumination. The classical definition of insanity is doing the same thing and expecting different results, my Default Mode Network did not get this memo.

Sometimes I will replay events in my head. Other times I start engaging in catastrophic thinking were everything I would never want to happen ends up happening. …

Corey Gardner


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store