Guy14

Guy14

(p)repair project – JSON:API specification integration

Hello,

Long abstract

I made a first post 10 months ago about my project, and my beginnings in programming.

So I’m creating a project from scratch (since about 10 months, with 3 months dedicated on totally other stuff).

I am accompanied by my brother, who is a master full-stack developer (in my eyes, but not only). But he doesn’t get much time, since he is already full-time working for a company, and already have a great professional investment with them.

He guides me on the app architecture, then I write code, push commits and merge requests that he verifies, send me questions and comments back, and so we advance like that.

So we chose Elixir as a programming language, with Phoenix as a framework for the backend. And because the projects turns to be a (native) mobile app at first, we chose FlutterFlow to design and get the frontend quickly working. Then we will be able to get all the generated Dart code from this low-code tool, and to polish the frontend regarding our needs. But it’s not at all a priority for now, as we can get things working fine in a simpler and (most importantly) faster way.

We’ve advanced on backend code, and I learned a lot (and still have a loooooot to learn) about programming.

To be honest, programming is still not a passion (as it is for my brother), but a mean to achieve my vision through a concrete project. But I also admit it can be pleasant to code when you find solutions to problems you encounters, and learning new things everyday is a pleasant journey (but it don’t makes you live, nor makes the world turns better).

Short abstract

We’ve creating a project with:

  • a backend using Elixir - Phoenix
  • a frontend using Dart - Flutter (currently FlutterFlow to gain time)

The frontend communicates with the backend and receives responses through a JSON REST API.

As it is painful to modify API calls on the frontend (even more in a low-code tool I guess, because a lot of actions are done with clics on an interface, so you can’t easily search/replace), we want to stabilize the API.

After researches with my brother, we decided to rely on the JSON:API specification, which looks very complete, to avoid too much thinking on what we need now and should need in the medium-term.

It is also important for us to have a good API documentation for 3 reasons:

  • it is faaaaar easier to integrate API call definitions to FlutterFlow with an OpenApi / Swagger file than without (OpenApi 3.0 required)
  • it is a good mean for us to visualize the current features of our API
  • it would be useful in the future if we want to share our API with third parties

After other researches, we found tools that may be useful to our project:

Questions

What do you think about our API strategy?

Do you have experience / feedbacks on currently using one or many of these libraries?

Do you have other experiences to share on using JSON:API specification on Phoenix?

If we go this way (with these libraries), does some of you already updated PhoenixSwagger to generate OpenApi 3.0 documents instead of 2.0?

EDIT: I’ve just seen this post OpenApiSpex - OpenAPI / Swagger 3.0 for Plug APIs that I haven’t seen in my previous researches. I start to read it. All feedbacks on my case are still very welcomed :slight_smile:

Most Liked

dimitarvp

dimitarvp

Have you considered GraphQL? Absinthe is a very mature library.

zachdaniel

zachdaniel

Creator of Ash

JSON:API is a good spec. Not a great spec, but AFAIK it’s the best option out there at the moment. Ash users get the benefits automatically through AshJsonApi, which mitigates most of the cost of supporting the spec, but I think even if I was going to hand-write against the spec it would be better than nothing.

zachdaniel

zachdaniel

Creator of Ash

Yes, that’s one of the primary benefits of Ash is that you design the application once and the APIs come for free, graphql or json api.

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

We're in Beta

About us Mission Statement