phoenix-framework

spjoshis's avatarfrom spjoshis

Master Phoenix framework with LiveView, channels, contexts, Ecto, and real-time web applications with Elixir.

⭐1stars🔀0forks📁View on GitHub🕐Updated Dec 30, 2025

When & Why to Use This Skill

This Claude skill empowers developers to master the Phoenix Framework and Elixir for building high-performance, real-time web applications. It provides expert guidance on implementing LiveView for interactive UIs, managing data with Ecto, and leveraging Elixir's concurrent architecture to create scalable, low-latency systems.

Use Cases

  • Case 1: Rapidly generating boilerplate for Phoenix LiveView components to create rich, interactive user interfaces without writing complex JavaScript.
  • Case 2: Architecting maintainable Elixir applications by implementing domain-driven design patterns using Phoenix Contexts.
  • Case 3: Streamlining database management and data validation workflows using Ecto changesets and repository patterns.
  • Case 4: Building real-time communication features such as live dashboards, chat systems, and instant notifications using Phoenix Channels.
namephoenix-framework
descriptionMaster Phoenix framework with LiveView, channels, contexts, Ecto, and real-time web applications with Elixir.

Phoenix Framework

Build real-time web applications with Phoenix, LiveView, channels, and Elixir's concurrent architecture.

Core Patterns

LiveView

defmodule MyAppWeb.UserLive.Index do
  use MyAppWeb, :live_view

  alias MyApp.Accounts

  def mount(_params, _session, socket) do
    {:ok, assign(socket, users: Accounts.list_users())}
  end

  def handle_event("delete", %{"id" => id}, socket) do
    user = Accounts.get_user!(id)
    {:ok, _} = Accounts.delete_user(user)

    {:noreply, assign(socket, users: Accounts.list_users())}
  end
end

Controller

defmodule MyAppWeb.UserController do
  use MyAppWeb, :controller

  alias MyApp.Accounts

  def index(conn, _params) do
    users = Accounts.list_users()
    render(conn, :index, users: users)
  end

  def create(conn, %{"user" => user_params}) do
    case Accounts.create_user(user_params) do
      {:ok, user} ->
        conn
        |> put_status(:created)
        |> render(:show, user: user)

      {:error, changeset} ->
        conn
        |> put_status(:unprocessable_entity)
        |> render(:error, changeset: changeset)
    end
  end
end

Context

defmodule MyApp.Accounts do
  alias MyApp.Accounts.User
  alias MyApp.Repo

  def list_users do
    Repo.all(User)
  end

  def create_user(attrs) do
    %User{}
    |> User.changeset(attrs)
    |> Repo.insert()
  end
end

Best Practices

  1. Use contexts for domain logic
  2. Leverage LiveView for interactivity
  3. Use Ecto changesets for validation
  4. Implement proper error handling
  5. Use channels for real-time features
  6. Write ExUnit tests
  7. Use telemetry for monitoring

Resources