top | item 19971456

Minimum Viable Phoenix

174 points| pcorey | 6 years ago |petecorey.com

27 comments

order

yellowapple|6 years ago

I really wish this tutorial existed 5 years ago. It would've convinced me to actually try Phoenix instead of pulling up the official getting started guide only to scream internally at all the moving parts and start looking for alternatives.

But on the other hand, had this tutorial existed 5 years ago, I wouldn't have found Sugar (sugar-framework.github.io), and in turn wouldn't have started contributing to it, and in turn wouldn't have gone on the various deep dives into OTP and Plug necessary to comprehend it, let alone become one of the maintainers of it (albeit a rather neglectful one; this year's New Years Resolution is to address some longstanding bugs and get it back into a state where it could actually be to Phoenix as, say, Padrino is to Rails or Flask is to Django), so I guess it ain't all bad :)

txcwpalpha|6 years ago

I hear ya. I think Hexdocs is great and I really appreciate the standardization of the Elixir community on one documentation format/site (though ironically it doesn't look like Sugar uses hexdocs), and in particular it's great at listing the various functions/modules etc within a package. However, I find it to be very lacking in terms of guide/tutorial content, and the Phoenix guide [1] is a great example of how it falls short. Compared to stuff like Django, which has amazing documentation, not just for the API, but also for guides that tell you how to do stuff like add routes, add authentication, do advanced queries [2], etc, the Phoenix guides are missing a lot.

It took me until I actually read an entire book about Phoenix (Programming Phoenix 1.4 [3], which I do recommend) before I actually got onboard with it. And while there's nothing wrong with reading a book, it is a significantly higher barrier to entry compared to something like Django or Rails, frameworks which a beginner can be taught the basics of in a single day just by browsing through the official documentation.

Now, with all that being said, I really do enjoy working in Phoenix now that I actually "broke through" that initial barrier of understanding. It and Elixir are very well thought out and pleasant to work with, even if they do take a little bit of extra effort to get started.

1: https://hexdocs.pm/phoenix/up_and_running.html

2: https://docs.djangoproject.com/en/2.2/contents/

3: https://pragprog.com/book/phoenix14/programming-phoenix-1-4

dve|6 years ago

Ive been waiting for a tutorial like this. I am most likely doing something wrong, but sadly the code samples do not function as listed. Even cloning the repo and executing the commands listed only results in errors after the first step.

xtagon|6 years ago

I really like this style of "literate commits".

gojomo|6 years ago

What is Phoenix?

brightball|6 years ago

Phoenix framework for the Elixir language. It's a web framework that leverages the natural concurrency and performance structure of the Erlang VM to handle both standard web development and web sockets.

That's the high altitude view.

In my professional opinion, Elixir and Phoenix also address the vast majority of short and long term issues that cause problems in projects without a negative impact on developer productivity. I'm a big believer it both. It's also got the perk of being so lightweight that there's almost no performance impact to using Phoenix instead of raw Elixir.

anthony_doan|6 years ago

It's the most popular web framework for Elixir.

It's MVC-ish with the caveat that the Model is broken down into two files, context and schema.

From what I've gathered, it also offer three unique things compare to other framework (on top of the power of Erlang's VM).

1) Channel - easy integration with websocket

2) Presence - some advance thing that keep track of people online

3) LiveView - In beta-(ish?) It's a compromise between front end framework.

Do note I haven't had the chance to use 2 or 3. I did a little of 1 as a tutorial.

drcongo|6 years ago

This is a really great idea and well executed. Thank you.

sansnomme|6 years ago

Meanwhile it still doesn't have Authn/Authz built-in.

Ndymium|6 years ago

It's a deliberate decision to not impose any set authn/authz structure on the user as many projects have differing requirements in that area.

Maybe someone could make a project creator on top of Phoenix that adds some basic authn/authz to the default structure.

seeker61|6 years ago

Another framework. May merciful Providence deliver us.

verttii|6 years ago

In all fairness it's been around for quite some time.

Moreover, the abundance of frameworks is not inherently a bad thing in my opinion. You don't need to learn it if it doesn't solve a problem for you after all.

fouc|6 years ago

Hmm? You haven't heard of Phoenix/Elixir? It's mentioned on HN fairly often.

ramchip|6 years ago

It’s the only framework with significant usage in Elixir. I don’t think one framework per language is excessive.