Aug 31, 2020
LiveView With Phoenix
My experience with Phoenix and the wonderful world of backend development.
Author


Book a call
If you want to learn more about what Elixir is, check out this video.
It was a different world altogether for me and I liked my stay there, so the next obvious thing was to have a look at Phoenix.
What is Phoenix, you may ask?
I had an experience of backend development with Ruby on Rails and I heard a lot about Phoenix in the RoR community, so I took a chance with it.
RoR vs Phoenix
From what I gathered, the major difference is the style of programming. Ruby is object-oriented, which in this case means everything is an object. You can send messages to objects via methods which can change the internal state of the object or return some values.
Elixir is "functional", which means that you end up calling functions and passing them data to operate on, which return a new changed version of whatever you wanted to modify. The entire language is optimized around this, so you get things in pipelines format.
Now, after all this, I came across with something called Phoenix LiveView.
Let's directly jump into this.
Phoenix LiveView
If you are from a Laravel background, Laravel Live wire was inspired by Phoenix LiveView. As explained in Livewire's documentation on state management, the state is either stored in a back-end service like Redis or re-sent to the server with each request, depending on the type of property. With LiveView, a persistent WebSocket connection is used, and the state is stored in memory in an Erlang process.
Basically, LiveView enables you to enable the interactive, real-time app, without touching any JavaScript, as the application logic lives on the server.

For more details, you can read this article.
Now let's start with creating a new project:
mix phx.new demo --live
phx.new command with the --live flag will create a new project with LiveView installed and configured. Now let's start by building a CRUD application.
mix phx.gen.live Timeline Post posts username body likes_count:integer reposts_count:integer
We will also create a table called posts like this:
lib/:- A context module in
lib/demo/timeline.exfor the accounts API - A schema in
lib/demo/timeline/post.ex, with anuserstable - A view in
lib/demo_web/views/post_view.ex - A LiveView in
lib/demo_web/live/post_live/show_live.ex - A LiveView in
lib/demo_web/live/post_live/index_live.ex - A LiveComponent in
lib/demo_web/live/post_live/form_component.ex - A LiveComponent in
lib/demo_web/live/modal_component.ex - A helpers modules in
lib/demo_web/live/live_helpers.ex
router.ex file. Now, before running the app, run the mix ecto.create command which will create the database and migration files for you.localhost/4000/posts and you will have all the basic functionality and templates for your CRUD application.
Cheers and keep experimenting.
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Jun 27, 2026
Building a Resilient Hybrid-Cloud Network with WireGuard HA, Route-Based Failover, and Deep Observability

Jun 19, 2026
We Built a 114-Second AWS-to-Azure Failover. Here’s What We Learned

Jun 12, 2026
Cloud-Native and Cloud-Agnostic Are Not Ideologies; They Are Business-Stage Decisions

Jun 8, 2026
Geeklego: The Open-Source Design System Built to Work With AI

May 18, 2026
Your Vibe Code Has No Memory. DESIGN.md Fixes That.

May 14, 2026