- LiveView is a SSR library for Phoenix
- Absinthe is a library for phoenix that provides GraphQL, here are Install Absinthe in a Phoenix project
Install phoenix
- brew install elixir
- mix local.hex
- mix archive.install phxnew
Adding authentication to a Phoenix Webframework Applicationhacks
- Added dependency to application
- mix phx.gen.auth Account User users
- Updated and committed files as needed
- Fixed test suite
Notes on framework
lib/app_name/application.ex
has the logic for starting, stopping, and
supervising each application lib/app_name_web/endpoint.ex
: beginning
of the web logic
âGenerally speaking, a context encapsulates all business logic for a common purpose. This way, we can interact with our business logic from controllers, channels or remote APIs, without having to duplicate code. In a nutshell, a controller exists to work with context functions. It parses end user requests, calls context functions and translates those results into something the end user can understand. Each slice of code has an isolated purpose. The context doesnât know about the controller, and the controller doesnât know about the business rules.â
â Form Programming Phoenix1
Rendering Pathway
Router: define pipelines and routes â Controller: functional logic
before view â View: render template â Template: .eex
extension
Releases
- Historically, releases were served by distillery a third party utility that packaged the web app up as a tar ball. This was replaced by a native elixir solution via mix release in elixir 1.9.
Deployment
Deploy a Phoenix app with Docker stack
Console equivalent
1. McCord, C., Tate, B. & Valim, J. Programming Phoenix: Productive Reliable Fast. (Pragmatic Bookshelf, Dallas, Texas, 2016).