Code Examples and App Ideas for learning OTP

Hello all,

I am going to be getting into more of the OTPish side of Elixir very soon and was curious what people would recommend for small to medium sized applications (toy or not) to better grasp the fundamentals of OTP (Agents, Tasks, Supervisors, Processes, GenServers…oh my!). I would be looking for ideas that are “vanilla” Elixir apps (no Phoenix involved) I learn best by building and tinkering around so I thought I would pose the question to the community.

Many thanks for your recommendations and happy coding to everyone!

4 Likes

Some type of chat app type thing is kind of dead centre of what Elixir really excels at. That might end up being a board game server or whatever. Essentially something that pairs two entities and lets them talk independent of a central lookup table as would be common in other languages.

Here’s one I did for a coding test that is along these lines for reference.

2 Likes

I’d suggest writing an app that concurrently downloads multiple resources from the web: a web scraper or some API consumer. Try adding progress reporting and retrying errors.

2 Likes

The book Concurrent Data Processing in Elixir: Fast, Resilient Applications with OTP, GenStage, Flow, and Broadway by Svilen Gospodinov provides instruction on building this type of project with OTP (at least a toy version), and then implementing improvements with Flow, GenStage, and Broadway.

5 Likes

@APB9785 thanks for noting that book it’s been sitting in my cart for a while now. I’ll have to buy it!

thanks for sharing :pray: