zenw0lf

zenw0lf

Hello all!

For those wanting to try your hands at Elixir / Phoenix, I wrote a comprehensive tutorial on doing a simple JSON API with said technologies.

Touches on everything: From language installation, app creation, schemas and endpoints, CORS configuration, simple authentication, to sessions (with cookies) and a bit of testing.

I updated it to latest Phoenix version:
Building a JSON API in Elixir with Phoenix 1.5+

Updated link: Build a JSON API with Phoenix · lobo_tuerto's notes

Any feedback is appreciated!

Showing Posts 1 to 10

drakvuf

drakvuf

Thanks! It’s a really nice tutorial.

zenw0lf

zenw0lf OP

You are welcome! :slight_smile:

AstonJ

AstonJ

I’ve also bookmarked it :003: (will go thro it when I’ve finished reading Programming Phoenix)

Thanks - we could definitely do with more tuts like this :023:

zenw0lf

zenw0lf OP

I’m thinking about writing one about building a basic GraphQL API with Phoenix and Absinthe in Elixir.
Could also touch on writing a frontend for it using Vue.js + Apollo.

Let me know if this sounds interesting to you people.

19
Post #4
gshaw

gshaw

I’d be interested an updated GraphQL tutorial.

AstonJ

AstonJ

I’d be interested in one for…

  • LiveView (when it’s out :lol:)
  • Drab
  • Texas

(can you tell I’d like to minimise JS!)

And then perhaps:

  • Vue.js
  • and maybe Bucklescript or Elm

You could start a poll btw “What kind of tutorial would you like to see?” and see what kind of response you get :003:

Nullstrike

Nullstrike

Vue.js + apollo would be great.

jswny

jswny

Great tutorial! I really appreciate your style of tutorial (I can tell you have thought it through from the introduction)! I’m glad that you went through a bit of testing, which is often neglected these days. Even including things like custom 500 error pages is really nice because these are the things people just glaze over in their tutorials.

I am actually about to start a project where I need to setup Phoenix for a JSON API and I have been wondering about how to do authentication (JWT, API keys, etc.). I’m really glad I came across your tutorial since the session based method that you use seems the most simple and straight forward to me, and it’s in line with much of the authentication I’ve done in the past for Phoenix apps with interfaces.

Thanks again, great work and I really like your blog as well :slight_smile:

zenw0lf

zenw0lf OP

Ok, I’ve thinking about the poll idea, and here is the stuff I’ve come up with:

  • GraphQL API (Phoenix + Absinthe)
  • Static site generator (markdown + frontmatter => HTML)
  • Simple game server (Phoenix) + Game client (Vue.js)
0 voters

Those are the 3 things I’ve been wanting to dabble in, and plan to get a tutorial out of them.

For the GraphQL API one, it’d be similar to the JSON API one, but you’ll have GraphQL endpoints ready for use with something like vue-apollo.

For the static site generator, I’m currently working on one, the idea is to use it for my own blog to replace Hugo , since I can’t really stand its templating language :smile:

And as for the game server, probably will go for a multiplayer Battleship game using Phoenix and WebSockets.

Let me know what y’all think. Thx.

ibarch

ibarch

Just FYI, there is a nice book about writing Battleship game using Elixir and Phoenix Channels. The game in the book is called Islands, but it’s the same thing. You would better pick a unique game to attract more readers.

Where Next? Top

Trending in Guides/Tuts Top

krasenyp
You probably already know that <span>{nil}</span> in a HEEX template produces <span> </span> when rendered. I fin...
New
c4lliope
# ~/src/livebook/.iex.exs System.cmd("xdg-open", [ LivebookWeb.Endpoint.access_url() ] ) Because Livebook requires a unique passcode on ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews