Day 01 - Organizations [Phoenix/Elixir]

Progress

  • Application: Complete and tested with four endpoints
  • CI: Complete
  • Deployment:
    • Dev: In-progress
    • Production: In-Progress

Summary

Our first application's topic was for lawyer organizations, which we decided to build using Phoenix, Ecto and Elixir.
Our first hurdle was understanding the new Phoenix v1-3-0-rc-n file structure changes along with a move away from Models in MVC.

TL:DR - Move /web into the lib/ directory of the app and now the generators build a module for fetching records from the database

Donald Plummer and Matt Purdy were amazing enough to build a phoenix template generator into our avvo-cli library. Though this was helpful we decided an umbrella app was not necessary for such small apps.

Learnings of the day : Add different templates for elixir apps to our cli

Onto the next change: the mix tasks have switched from mix phoenix.new to the new mix phx.new that handle the new directory structure

To use that we had to install the new tasks:

mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

API Design

jsonapi.org set out a guideline for the 1.0 specifciations which greatly differ from our current schema.

jsonapi.org sample json json { "meta": { "total-pages": 13 }, "data": [ { "type": "articles", "id": "3", "attributes": { "title": "JSON API paints my bikeshed!", "body": "The shortest article. Ever.", "created": "2015-05-22T14:56:29.000Z", "updated": "2015-05-22T14:56:28.000Z" } } ], "links": { "self": "http://example.com/articles?page[number]=3&page[size]=1", "first": "http://example.com/articles?page[number]=1&page[size]=1", "prev": "http://example.com/articles?page[number]=2&page[size]=1", "next": "http://example.com/articles?page[number]=4&page[size]=1", "last": "http://example.com/articles?page[number]=13&page[size]=1" } }

avvo sample json json { lawyers: [ { id: 28995, prefix: null, firstname: "Mark", middlename: "S", lastname: "Britton", ... }], meta: { status: 200, per_page: 10, page: 1, total_entries: 100 } }

There was some debate that we should stay the course with our old schemas, but after looking at the conventions in the Rails and Phoenix communities, we decided to move into the new jsonapi 1.0 specifications.

As expected we ran into issues deploying our application to rancher. I'll be working with our infrastructure team and their new configuration tool they have built to allow self-serve deployments.

Stay tuned for deployment updates.