Skip to content

Latest commit

 

History

History
 
 

phoenix-liveview

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Elixir Phoenix Example Application

This is an example Phoenix LiveView application that uses Electric.Phoenix.LiveView.electric_stream/4 to sync data from Postgres into a LiveView using Phoenix Streams. This keeps the LiveView automatically in-sync with Postgres, without having to re-run queries or trigger any change handling yourself.

See the documentation for more details.

Getting started

To start your Phoenix server:

  • Run mix electric.start to start an Electric instance and associated Postgres DB.
  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

If you open two separate windows, you will see you changes happen simultaneously in both windows.

Implementation

See the Electric.PhoenixExampleWeb.TodoLive.Index module and the Electric.Phoenix documentation.