Umbrella project with REST API, client and custom plug
Minimal Elixir project that demonstrates decoupling and separation of concerns. Inside the umbrella, there are three apps that expose their business logic via Phoenix contexts.
iex> PlaygroundDb.Posts.list_posts()
[
%PlaygroundDb.Posts.Post{
comments: [
%PlaygroundDb.Posts.Comments.Comment{
content: "First comment",
}
],
content: "First post",
},
%PlaygroundDb.Posts.Post{
comments: [],
content: "Second post",
},
# etc...
]
- Phoenix 1.4.0 or later
- Elixir 1.7 or later
- Erlang 21 or later
To start your Phoenix server:
- Install dependencies with
mix deps.get
- Create and migrate your database with
mix ecto.setup
- Change to Phoenix directory with
cd apps/playground_web
- Install Node.js dependencies with
cd assets && npm install
- Start Phoenix endpoint with
mix phx.server
Now you can visit localhost:4000
from your browser.
Some tools need to be installed globally:
$ mix archive.install hex sobelow
$ mix dialyzer --plt
$ mix sobelow --config -r apps/playground_web
$ mix credo
$ mix dialyzer
Generate project documentation and check its quality:
$ mix docs
$ mix inch
See LICENSE.