Elixir for applications providing and consuming APIs over network

Hello Community,

I’m Elixir, but not a functional programming, beginner (read Elixir in Action already once but still here :).

Is Elixir and BEAM/OTP platform suitable for applications providing and consuming APIs over network?

My use case would be an application implementing a OpenAPI specification based (request-reply) APIs. The application logic would be mainly to query data from other network APIs and (relational) databases and transform the (JSON) data in arbitrary ways. Also Kafka connectivity is required.

Any hints for a beginner for suitable libraries/frameworks/existing tutorials covering this scenario? I’m a bit confused about the ecosystem atm and I’m assuming vanilla Elixir is not enough, right?

Sure,

It certainly is, See: YouTube videos depicting its usage!!

Vanilla Elixir is great, if you want to go that route, but it will take a while.

However since you are beginner, I would suggest you use something like Phoenix Framework, along with some libraries mentioned below:

Phoenix Framework can generate API endpoints, using generators. See: mix phx.gen.json & Views and Templates


You can use a beginner friendly, yet powerful HTTP client:


For Kafka connection, you can use:


To generate OpenAPI docs:


Tutorials:

Generate API Documentation Effortlessly from your Phoenix/Elixir code

https://fullstackphoenix.com/tutorials/create-swagger-compatible-custom-phoenix-json-generator

4 Likes

Thanks a lot!

So Phoenix is also the way to go to build “api-only backends”. I somehow missed that as I see Phoenix main page actively promotes “interactive web applications”-only. Now when I know what to look for I see e.g. https://itnext.io/building-apis-with-phoenix-framework-a7e280b7fa4a

Broadway looks very useful for what I’m planning to do.

Thanks again!