<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>elixir on Washington Botelho</title><link>http://www.wbotelhos.com/tags/elixir/</link><description>Recent content in elixir on Washington Botelho</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 17 Jul 2023 00:00:00 -0300</lastBuildDate><atom:link href="http://www.wbotelhos.com/tags/elixir/index.xml" rel="self" type="application/rss+xml"/><item><title>How To Create a HTTP Server With Elixir</title><link>http://www.wbotelhos.com/how-to-create-a-http-server-with-elixir/</link><pubDate>Mon, 17 Jul 2023 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/how-to-create-a-http-server-with-elixir/</guid><description>A HTTP server receives a resquest and gives you a response. It happens through a URL plus a port like https://www.wbotelhos.com:443, when you make a request to it, it gives you my blog home page as the response. So, how can I do it using Elixir?
Goal Create a HTTP Server that listen for a request and returns a response.
The gen_tcp Module Erlang has a module called gen_tcp that makes the hard work for you.</description></item><item><title>OAuth Login with Phoenix and Ueberauth</title><link>http://www.wbotelhos.com/oauth-login-with-phoenix-and-ueberauth/</link><pubDate>Sat, 12 Feb 2022 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/oauth-login-with-phoenix-and-ueberauth/</guid><description>Rarely an application doesn&amp;rsquo;t need login logic. It&amp;rsquo;s important when you want to restrict some areas of your applications and identify how is using it. We can create a password logic or we can use OAuth to connect the user through some provider like Google, Facebook, Github, Twitter, and others. Of course, Phoenix already has some plugs to facilitate it for you.
Goal Implement an OAuth Google logic to control the login in a Phoenix application.</description></item><item><title>From Stateful Process to GenServer in Elixir</title><link>http://www.wbotelhos.com/from-stateful-process-to-genserver-in-elixir/</link><pubDate>Mon, 10 Jan 2022 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/from-stateful-process-to-genserver-in-elixir/</guid><description>When we talk about Functional Languages like Elixir we&amp;rsquo;re talking about our functions being pure where the same input gives you the same output. We&amp;rsquo;re talking about not depending on keeping state receiving different mutations. So if you need to keep the state in Elixir, how can it be done? Well, GenServer does, but we&amp;rsquo;ll get there.
Goal We&amp;rsquo;ll create a stateful process and refactor it until gets the GenServer implementation, in this way you can learn how the state works and how GenServer encapsulates it.</description></item><item><title>GraphQL with Absinthe on Phoenix - Authentication</title><link>http://www.wbotelhos.com/graphql-with-absinthe-on-phoenix-authentication/</link><pubDate>Tue, 24 Aug 2021 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/graphql-with-absinthe-on-phoenix-authentication/</guid><description>Updated at: Jul 24, 2023 In the last article about Mutation, we learned how to create records in an easy way, so now we have searches and insertions but we still do not control how the user access that API. For security reasons or just for control of access we need to implement the API Authentication where only logged users can access it.
Goal Authenticate the user and restrict the API to only the logged ones.</description></item><item><title>GraphQL with Absinthe on Phoenix - Mutation</title><link>http://www.wbotelhos.com/graphql-with-absinthe-on-phoenix-mutation/</link><pubDate>Sun, 08 Aug 2021 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/graphql-with-absinthe-on-phoenix-mutation/</guid><description>Updated at: Jul 23, 2023 In the last article about GraphQL, we learned how to create a Query and how to avoid N + 1. The systems need to fetch data but the most of time we need to create these data too and GraphQL has a mechanism called Mutation to do this job.
Goal Create a Mutation to save a book using the code of the last article
Mutation The Mutation works very similar to Query, it queries the data in the same way, but after creating the record, and as expected we receive the input data as a parameter, like in Query, but instead it be used as a filter it&amp;rsquo;s used as a parameter to be inserted into the database.</description></item><item><title>GraphQL with Absinthe on Phoenix - Query and Dataloader</title><link>http://www.wbotelhos.com/graphql-with-absinthe-on-phoenix-query-and-dataloader/</link><pubDate>Tue, 03 Aug 2021 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/graphql-with-absinthe-on-phoenix-query-and-dataloader/</guid><description>Updated at: Jul 23, 2023 One thing is true, GraphQL is here to stay. This query language is very useful since you can just declare the fields you can have, but choose what you want in each request. It&amp;rsquo;ll avoid you to create combinations of logic that return fields for different purposes.
Goal We&amp;rsquo;ll learn how to use GraphQL on Phoenix with the help of Absinthe and how to deal with Queries and how to avoid N + 1 with the help of Dataloader.</description></item><item><title>I18n With Phoenix</title><link>http://www.wbotelhos.com/i18n-with-phoenix/</link><pubDate>Thu, 29 Jul 2021 00:00:00 -0300</pubDate><guid>http://www.wbotelhos.com/i18n-with-phoenix/</guid><description>It&amp;rsquo;s a good idea to translate your texts, even if you&amp;rsquo;ll display your site only in one language. With this technique, the texts will be centralized in only one place and you can separate them by domains. Phoenix uses gettext to do the translation and we&amp;rsquo;ll see how to do that.
Goal Translate and understand how translation in Phoenix works.
Setup Let&amp;rsquo;s create a Phoenix project:
mix phx.new i18n_with_phoenix cd i18n_with_phoenix mix deps.</description></item></channel></rss>