Skip to content

This is my attempt to learn and use phoenix liveview along with tailwindcss and alpinejs in a web app.

License

Notifications You must be signed in to change notification settings

braynm/phoenix-liveview-example-usage

Repository files navigation

LiveViewExampleUsage

This is my attempt to learn LiveView by building a web app component.

Quick Start

  • Elixir version 1.12.2; OTP version 23.3.2
  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with npm install inside the assets directory
  • Start Phoenix endpoint with mix phx.server or app inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Setup

Requirements

  • Elixir 1.12.2
  • Phoenix 1.15.9
  • Nodejs 12.13.0

Pagination (Infinite Scroll)

We used photos from Unsplash website via Unsplash API. We need to setup from here.

  1. Create Unsplash application in order to use Unsplash API
  2. Add this to config/dev.exs:
config :live_view_example_usage, :unsplash_credentials,
  client_id: <CLIENT_ID>,
  client_secret: <CLIENT_SECRET>
  1. Run iex- S mix phx.server

Pagination Example

Chat Example

Example Usage

  • Pagination (Infinite Scroll)
  • Chat
  • OTP Login (WIP)

Live Demo (No pun intended)

I deployed the demo to fly.io. The deployment process is surprisingly easy.

Demo

Observer

Resources

Credits

  • Happy\ Bunch\ -\ Astronaut.png image is from blush.design check it out! they have awesome illustrations!

TODO