Hacker News new | ask | show | jobs
by colinramsay 2540 days ago
Where are people getting their documentation for Phoenix? The stuff on the website is awful for grasping the bigger picture and how the parts of Phoenix combine. It gave me the impression of being an immature version of Rails when I tried it recently which doesn’t gel with the attitude people seem to have of it.
4 comments

The actual API reference is top notch: https://hexdocs.pm/phoenix/Phoenix.html

But I'd suggest reading through "Phoenix In Action" to get a feel for how everything composes together, but its surface area is much smaller than Rails (though I haven't used Rails in a decade)

Phoenix only deals with the web framework component. If you want to talk with databases, the official library is Ecto. For GraphQL there's Absinthe.

I would say Phoenix doesn't attempt to be quite as magical as Rails and Django-style frameworks. It is a bit more explicit and as such hopefully easier to follow. The goal doesn't seem to be Rails for Elixir but rather that every new backend language needs a good web framework or it may be dead in the water.

As someone suggested, check out the Hex docs. That is where you get the better in-depth stuff and API reference. I've found the Getting started-stuff very helpful but also a bit limited in scope.

I've found that it really helps to start with the high-level overview of Phoenix if you don't have experience with 'Railsy' frameworks.

Then look at the 'magic' bits. <app_name>_web.ex is an important one, and the view/template distinction can be a bit confusing at first.

From there I suppose endpoint.ex covers pretty much all the rest of it (and then hands things off to router.ex).

With Rails I was always uncomfortable that I couldn't quite follow or understand the path taken through my codebase, but with the exception of a few 'magic' things, Phoenix is wonderfully transparent in this regard.

For the bigger picture I would say grab the Programming Phoenix 1.4 book. It was written by the authors of Elixir and Phoenix.

It focuses on building a web app and shows how everything fits together while solving real issues, which is a much better learning experience than the documentation IMO. If you come at it with a Rails background you'll probably walk away with a completely different impression.

Programming Phoenix 1.4 by Chris McCord, Bruce Tate and José Valim & Elixirforum

Lots of trials and errors. The one thing that I think was pretty dang unclear for phoenix is authentication.

I went through 3 libraries and scrap many codes to figure out what's what. I settle on POW, the programmer is very nice and awesome he answers a lot of questions on elixirforum.