← All series

Series contents

Log in to track your progress

  1. 1. Elixir TDD with ExUnit (interview / toy problem) Episode
  2. 2. Fixing generated Phoenix tests (Trello clone P1) Episode
  3. 3. Finishing the scaffold (Trello clone P2) Episode
  4. 4. Setting up Vue and SASS (Trello clone P3) Episode
  5. 5. Integration testing Elixir with Wallaby Episode
  6. 6. Integration testing Elixir with Wallaby Part 2 Episode
  7. 7. Styling cards and todo lists (Trello clone P4) Episode
  8. 8. New cards, JSON APIs and Ajax (Trello Clone P5) Episode

Finishing the scaffold (Trello clone P2)

In this episode we'll continue our Phoenix 1.4 Trello clone (which we started last episode).

We've already got a workable system for fixing tests generated by mix phx.gen.html after making associations between schemas and we'll continue using it. This time we'll do the comment and activity models, which are a bit more complex but progress is fast since we can lean on helpers we made in Part 1.

At the end our tests will be passing and our contexts and schemas will look like this:

  • ACCOUNTS
    • user --- username
  • TASKS
    • list
      • name
      • position: integer
      • belongs_to :user
      • has_many :cards
    • card
      • title
      • details, :text
      • belongs_to :list
      • belongs_to :user
      • has_many :comments
      • has_many :activities
    • comment
      • body, :text
      • belongs_to :card
      • belongs_to: user
    • activity
      • action: [completed, added, moved]
      • user_id, references: User,
      • from_id, references: List,
      • to_id, references: List
      • belongs_to :card

(Source code available for premium members)

Next episode: Part 3: Setting up SASS and Vue

Open standalone page ↗

No Comments