mssantosdev

mssantosdev

Phoenix Blog Post: LiveMatch: Building a Real-Time App for Soccer with Phoenix LiveView

This post is a guide on how Norba and I are building LiveMatch, a real-time app for soccer to follow multiple games in one place.

https://readyforproduction.dev/livematch-building-real-time-app-soccer-with-phoenix-liveview

Most Liked

Morzaram

Morzaram

Wow, thank you for such an in-depth article. Love the usage of the videos, diagrams, and extensive code snippets of how you implemented this. Thank you!

What do you feel was the hardest part of this?
Do you feel that there could be any best practices taken from the project?

ndrean

ndrean

Sad you forecast a final Brasil Spain…

mssantosdev

mssantosdev

Thank you, @Morzaram!

What do you feel was the hardest part of this?

The most challenging part of the project so far was the Match Transmission Engine. Building it with to match all the requirements took us some time. It was rewarding because we did it entirely using the “Elixir way” - processes, supervisors etc. Also, we can easily port the engine to other sports.

We’re still working on the Distribution piece to have it working 100%, and it’s being a complex thing to do too.

Do you feel that there could be any best practices taken from the project?

I believe there are some things:

  • Reusability in the frontend with Phoenix.Components;
  • Organizing the code in Contexts, and delegating the code to “sub-contexts” from the main module of the application;
  • Communication across processes with PubSub. This + LiveViews is basically where all the magic happens;
  • An Examples module. We don’t talk about it in the post, but we have a module in the app called LiveMatch.Examples, with the main responsibility of guiding the developers on how the app works. We have functions there that populate the database with teams and matches, start and stop matches etc. It teaches how the app works by using it, like a live documentation. We grabbed the idea from Designing Elixir Systems with OTP. The simulations happening at LiveMatch are built using the Examples module.

Maybe @norbajunior can help me with some other things regarding best-practices.

Sad you forecast a final Brasil Spain…

@ndrean, after Brazil x Cameroon, I’m not so sure about that final anymore. :melting_face:

Where Next?

Popular in Blog Posts Top

ellispritchard
Somebody was asking about Erlang OS signal handling on Slack; I’ve posted up my learnings: https://medium.com/@ellispritchard/graceful-s...
New
RudManusachi
Hi there! Recently I was playing around with extracting and updating data in the DB and for fun challenged myself to try to implement a ...
New
brainlid
Jason Stiebs shows a couple ways for a LiveView to make it easy for users to click and copy an important value to their clipboard. He sho...
New
paulanthonywilson
Whatever your Nerves project does, there’s a good chance that it can be enhanced by securely connecting to a Phoenix Server in the cloud;...
New
Paradox
Testing is an important part of any modern piece of software. But writing tests can quickly become an exercise in frustration, with tons ...
New
brainlid
Phoenix LiveView v0.20.4 offers a hidden gem with its handy little JS.toggle_class/1 feature. This addition simplifies toggling classes f...
New
psantos
Just wrote a new blog post about how to deploy a Phoenix app using Kamal 2. Check it out and let me know what do you think: https://blog...
New
rlopzc
Learn how to leverage Erlang + Elixir’s GenServer to build a robust FTP Client. https://rlopzc.com/posts/elixir-ftp-client-genserver-par...
New
Alex66
I ran Symphony through Giulia, here’s the AST analysis. Yesterday, OpenAI open-sourced Symphony — an autonomous agent orchestration fra...
New
jola
I’ve been bumping into some rough edges recently with Elixir dependencies that use app config and start their own supervision trees and I...
New

Other popular topics Top

jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
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
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

We're in Beta

About us Mission Statement