SpaceRocket |> Blog

Think, Learn, Share

Michael Chavez
Michael Chavez

Moving from WordPress to Elixir and Phoenix

Posted by Michael Chavez on August 24, 2019

Welcome to the new Space-Rocket website!

Hi and welcome to the newly rebranded Space-Rocket |> software design and development website. My partner and I founded Space-Rocket in 2012 to build websites using the WordPress content management system (CMS). As technology has evolved, so have our offerings. We are transitioning from being a WordPress web design & development shop to being a full-fledged San Francisco software design and development boutique agency. 

No more WordPress

Our new website is a custom CMS built on top of the Elixir programming language and the Phoenix framework. José Valim, a long-time Ruby contributor, invented Elixir to solve concurrency problems faced with Ruby and other programming languages. The Phoenix framework is built on top of the Elixir programming language and was developed by Chris McCord, who was trying to solve similar problems with Ruby on Rails. They brought with them the excellent tooling, supportiveness, and developer happiness from the Ruby and Rails communities. Building a CMS for the Space-Rocket site has been a breeze using Elixir and Phoenix.

Choosing Elixir and Phoenix

I selected Elixir and Phoenix after years of researching various javaScript frameworks and languages such as Angular (both 1 & 2), Ember and React. Vanilla javascript, isomorphic/universal javascript, Next.js. I even tried out Elm and also explored other languages such as Go and Clojure. Amongst these, in 2015, I built a demo app from the Programming Phoenix book (first edition). Programming in Elixir and Phoenix was a pleasurable experience.  After three years and doubling down on javaScript, the demo apps I made with Elixir and Phoenix are still running without any updates or maintenance. Meanwhile, apps that were built in javaScript both vanilla and with frameworks would have significant amounts of rot and require overhauls of libraries and syntax. I believe Elixir and Phoenix is the best choice for the next decade to build web apps on. 

So, what is Elixir?

Elixir is a functional programming language built on top of the Erlang VM “BEAM.” Erlang was first released in 1986 by Ericsson to run telecommunication applications. At the heart of Erlang and Elixir is that everything is a process. If an error happens to one process and it crashes, the other processes stay alive, giving you fault tolerance out of the box.

Other great features of Elixir (and Phoenix)

  • Functional programming is easy to understand and learn
  • Elixir has a great package manager in Hex
  • Mix, Elixir’s build tool is top-notch
  • Erlang, Elixir, and Phoenix are all open-source with supportive, welcoming communities
  • Is loved by developers who have found their way to it
  • Easy maintainability and Stability
  • Low server cost and easy scalability out of the box
  • Future proof
  • Concurrency out of the box through Phoenix Channels

The architecture of Space-Rocket CMS

The Space-Rocket CMS is designed around the WordPress schema using the idea of “Post Types” and applying them to Phoenix contexts. There is a base context of “Post Types” and a base “Post” schema. A blog post, for instance, uses the most generic post type, “posts,” pages and media attachments also use that same base “post” schema. “Post type” is specified with the post_type attribute in the base post schema. The post and post type is then queried, just like in WordPress using Ecto, Phoenix’s database helper. 

Dogfooding our work

The Space-Rocket website demonstrates a custom content management system built with Elixir and Phoenix. As always, it’s best to dog food your work, meaning we use our product. New projects bring new features to the toolbox. We already have a headstart with the Space-Rocket CMS. The underlying structure is a boilerplate for projects, with an end goal of becoming a product based on market demands. Concepts such as user authentication system, multitenancy, and UI/UX components are reusable across multiple clients software project’s needs.

Final thoughts

As a final thought, I would like to give a heartfelt thank you to everyone we’ve worked with over the past decade and to the entire WordPress community. WordPress was my gateway to programming and has given me an outlet for my creative passion.

Do you have a project that you think would be a good fit for Elixir and Phoenix? Contact us.


Thanks for reading!