mix phx.new counter --no-ecto cd into the project #start server mix phx.server https://www.youtube.com/watch?v=U_Pe8Ru06fM #Use github LiveView installation guide https://github.com/phoenixframework/phoenix_live_view/blob/master/guides/introduction/installation.md atom . minimises content size in your code editor Add routing route lib>views>router.ex live "/counter", CounterLive #Create CounterLive module #Create new directory under counter_web (call it live) #Create new file under live dir called counter_live.ex defmodule CounterWeb.CounterLive do use Phoenix.LiveView def mount(_session,socket) do socket = assign(socket, :count, 0) {:ok, socket} //this is the return value end def render(assigns) do ~L """ <h1>Count: <%= @count %></h1> <button phx-click="increament" >+</button> <button phx-click="decreament">-</button> """ end def handle_event("increament",_, socket) do count = socket.assigns.count + 1 socket = assign (socket, :count, count) {:nonreply, socket} end def handle_event("decreament",_, socket) do count = socket.assigns.count - 1 socket = assign (socket, :count, count) {:nonreply, socket} end end mix phx.new my-app --live mix deps.get