Implement a forum data model in Elixir
Building an Elixir data layer for our Forum with Ecto
Building an Elixir data layer for our Forum with Ecto
@knewter
Building an Elixir data layer for our Forum with Ecto.
We're going to build a Forum GraphQL API, but the API is not our application - it's just an interface to our application. We'll build the core business logic in a
firestorm_data
application inside of an umbrella.
We can start by building a new umbrella project:
mix new firestorm --umbrella cd firestorm
We have a new umbrella app - let's create the
firestorm_data
app to hold our business logic and database interface:
cd apps mix new firestorm_data --sup cd firestorm_data
Let's review the Forum data model:
We'll begin with categories. We should be able to create a category:
# test/categories_test.exs defmodule FirestormData.CategoriesTest do # We'll create a DataCase momentarily use FirestormData.DataCase import FirestormData.Categories alias...
To see the complete version of this and more awesome lesson
become a superuser
Comments for Implement a forum data model in Elixir