Building a JSON API in Elixir with Phoenix 1.5+

I think™ JWT is part of the json-api spec. I’d recommend using it regardless as token based auth is much nicer for an api than session based auth.

I just came across this tutorial and I am must confess that this is the best of any other tutorial I have seen so far on google, @zenw0lf, you did a nice job seeing you put it into consideration of people who are new into the elixir/phoenix tech.

2 Likes

Hello @issoft, I don’t think this is the right place to start a discussion about application design.

Nonetheless, let me tell you that is better to have separate tables for users, roles and permissions. It’s easier to manage them in that way.

Have a look at the categories on the forum: https://elixirforum.com/categories you’ll surely find the right place to discuss this and other questions you might have.

Cheers,
VA

okay thanks.

I found the one line of code that was missing for me… awesome. and because of that, i will now read the whole thing :clap: :bowing_man:

1 Like

I’ve reviewed and updated the guide to Phoenix 1.5 :slight_smile:

3 Likes

Thank you for continuing to maintain this guide! I think it is very useful guide for the community. I do think it would be nice to include a note at the top of the tutorial to state that it’s been updated for Phoenix 1.5. I didn’t notice that the title of the article says Phoenix 1.5 until I saw your latest message here. Also I’ve updated the title of this topic and link to say Phoenix 1.5 (let me know if you want to edit the initial message further).

3 Likes

Thank you for sharing the tutorial. I found it really helpful.

1 Like

Thanks for the update @axelson!

The title for the tutorial on my blog states that it’s for Phoenix 1.5. :+1:

2 Likes

FYI, I updated your initial post to add the new link: Build a JSON API with Phoenix - lobo_tuerto's notes
(I left the previous link mainly so the click count would remain, 3.3k clicks is quite impressive!)

I’m not sure there’s much you need to update for Phoenix 1.6, I think the main thing is this section: Create a new API-only Phoenix application

You need to change from:
mix phx.new my-phoenix-json-api --app my_app --module MyApp \ --no-html --no-webpack --binary-id
to:
mix phx.new my-phoenix-json-api --app my_app --module MyApp \ --no-html --no-assets --binary-id

1 Like

Thanks for the update!
I’ll make the updates, and will do a full review of the content. :raised_hands:

1 Like