Ectogram: Introduction

3 min read

They say the best way to learn is to build so to apply what I have learned in reading Programming in Ecto I have decided to build a clone of the popular social media application, Instagram. Their is one catch to this clone, their will be no frontend. This is solely a clone of the functionality of Instagram from the perspective of the data layer.

Ecto is the popular database wrapper in Elixir that follows in Elixir’s footsteps by doing everything in a functional way. To be blunt with you:

I ❤️ Ecto!

In my short time as a developer I’ve worked with Mongoose, Knex, Sequelize & Django when it comes to ORMs (Object Relational Maps). I’m not here to talk badly on any of the above. I really feel after learning how Ecto works it’s vastly easier to reason about…especially for a developer who spends most of his time in Frontend Land with ReactJS.

The Plan

This will not be a full draft: false featured: false copy of Instagram. That would take a couple months since this is a side project and I will be writing about it step-by-step. Things that will be missing at least in this initial build:

  • Advanced authentication via TOTP
  • Public/Private Users
  • Saved Post List / Ability to save a post to your saved lists

What I will be able to do at the end of this series is to CRUD a user, post, comment, like, hashtag, and follower with their respective relationships in place, validation & constraints applied, and thorough testing.

Things To Note

If you choose to follow along with the series the below is what I will be using so make sure you have the correct versions to avoid weird problems:

  • elixir >= 1.13
  • ecto >= 3.7
  • psql >= 13

With iex I can pretty much do everything I would want or need to do and I will be using it extensively throughout this series. There is also the psql command line tool that you will have access too as well for querying the database. If command line tools are not your jam and you want to use a GUI tool their is nothing wrong with that. Below is a list of ones I have used in the past and are good options:

With that I am ready to get started. As a final note the code for this series will be public on my GitHub and will be organized so that each post corresponds with a branch and the corresponding pull request that merges to the production branch for the final product.

~ Cody 🚀

Related Articles


    Ectogram: Testing Ecto

    Part 4 in the Ectogram series where I cut my teeth on testing the user schema with ExUnit.

    Ectogram: Setting Up Ecto

    Part 2 in the Ectogram series where I setup the project and make customizations to Ecto.

Cody Brunner

Cody is a Christian, USN Veteran, Jayhawk, and an American expat living outside of Bogotá, Colombia where he works as a Senior Frontend Developer for WAO Fintech.