Elixir Phoenix Hashrocket Projects
Today I Learned in Phoenix
The Phoenix port of Today I Learned, Tilex, is live.
Today I Learned began as a Ruby on Rails application. We open-sourced the code after launch and have maintained it for over two years. Our mission:
Today I Learned is an open-source project by Hashrocket that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any Rocketeer as well as selected friends of Hashrocket. We hope you enjoy learning along with us.
Today, we are moving forward with an Elixir/Phoenix port of the project. Here's a little more about the project, focusing on the work, technology, some observations, the people behind it, and the future.
Work
This project began over two years ago as my Hashrocket apprentice project. Here's the launch announcement from that time.
We open-sourced the Ruby on Rails application in February 2016. A handful of forks are in production, documented in the usage guide.
Why port this application to Elixir? My curiosity in Elixir deepened after reading Seven More Languages in Seven Weeks by Bruce Tate, Fred Daoud, Jack Moffitt, and Ian Dees, which features Elixir. Elixir's unique raison d'être– a Rubyist's quest for a language that sidestepped some of the limitations of the Ruby language– resonated with me. Many on our team have grown to love Elixir, and we wanted a project that featured it.
In October 2016 we made our initial commit to the port. The name, Tilex, came from the Elixir convention of adding 'ex' to everything. And so, Tilex ('TIL' + 'ex') was born.
Technology
We created our application using Phoenix 1.2 (since upgraded to 1.3) and set to work.
For project management, we chose to use a Github project. Github Projects is a great choice for a simple project. A key advantage over a tool like Trello or Pivotal Tracker is that it's already integrated with your repository.
For hosting we chose Heroku. Setup was not as simple as launching a Ruby on Rails application, but was still pretty straightforward.
We've been running our tests with Travis CI, including a Credo integration, and have used AppSignal for error monitoring.
Observations
Here are few of my personal observations as a member of this team.
First, Elixir is a pleasure to write and maintain. The language mixes some of the best ideas from Ruby with an outstanding foundation in Erlang. The combination of the joy of Ruby idioms, functional programming, and features such as pattern matching, is truly unique.
Also noteworthy: we didn't write as many tests for Tilex. I credit a mix of experience and bravado earned by having written almost this entire application before. Precompiled languages catch a lot of issues in development, giving us a sense of confidence when deciding whether to test.
As noted by many others, Elixir's tooling is not as polished as Ruby's, but it's improving all the time. As we built the application, we got to watch it get better.
This was a learning experience, and here are few posts I wrote along the way:
The Today I Learned elixir channel is itself loaded with small discoveries we made during the process.
People
The following people committed to the Tilex release:
- Brian Dunn
- Chris Erin
- Cody Roberts
- Dorian Karter
- Jake Worth
- Josh Branchaud
- Lexin Gong
- Taylor Mock
- Vidal Ekechukwu
Thanks as well to Cameron Daigle, who created the design. We also appreciate the Rails app contributors; many of the features we recreated were built by them. Also, my thanks to Hashrocket for the paid open-source time which made this possible.
Most importantly, thank you to my coworkers, who have built this site into something amazing. Today I Learned is nothing without the posts. I learn something from our feed every day.
Future
Here's how we plan to celebrate this release.
First, more work! As of this writing, we have a handful of open issues on Github. Interested in contributing? Check out our contributing page for more information about getting started.
I'd also like to do some benchmarking. Is there a performance or resource advantage to this platform? How does our churn compare, and how easy will it be to maintain? I'm curious about these questions.
As for the Rails application: can we maintain a codebase we don't use? For now, I plan to update the documentation of that project to indicate that it's not the deployed version of Today I Learned, and then work on a plan for the future.
Please enjoy the new Elixir/Phoenix version of Today I Learned, hit us up on Github or Twitter, and keep learning every day.
Cover photo by Jonathan Bean on Unsplash.com