Day 01 - Organizations [Phoenix/Elixir]


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


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 to the new mix that handle the new directory structure

To use that we had to install the new tasks:

mix archive.install

API Design set out a guideline for the 1.0 specifciations which greatly differ from our current schema. 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": "[number]=3&page[size]=1", "first": "[number]=1&page[size]=1", "prev": "[number]=2&page[size]=1", "next": "[number]=4&page[size]=1", "last": "[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.