bobmatnyc avatar

Phoenix Api Channels

This gets you up to speed on building JSON APIs and real-time features with Phoenix on the BEAM. It covers the full stack: controllers with plugs and versioned routes, Ecto contexts for data ownership, WebSocket Channels for chat and notifications, Presence for tracking who's online, and PubSub for fan-out broadcasts. The guide is opinionated about keeping controllers thin and letting contexts own business logic, which matches idiomatic Phoenix. You'll want this when you need both REST endpoints and WebSocket bidirectionality in the same app, or when you're adding collaborative features that need fault-tolerant concurrency. It includes auth patterns, testing helpers, and telemetry setup. The coverage is practical without rehashing basic Elixir syntax.

skills.sh installs
348
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill phoenix-api-channels --agent claude-code

Installs into .claude/skills of the current project.

Files

Phoenix APIs, Channels, and Presence (Elixir/BEAM)

Phoenix excels at REST/JSON APIs and WebSocket Channels with minimal boilerplate, leveraging the BEAM for fault tolerance, lightweight processes, and supervised PubSub/Presence.

Core pillars

  • Controllers for JSON APIs with plugs, pipelines, and versioning.
  • Contexts own data (Ecto schemas + queries) and expose a narrow API to controllers/channels.
  • Channels + PubSub for fan-out real-time updates; Presence for tracking users/devices.
  • Auth via plugs (session/cookie for browser, token/Bearer for APIs), with signed params.

Project Setup

mix phx.new my_api --no-html --no-live
cd my_api
mix deps.get
mix ecto.create
mix phx.server

Key files:

  • lib/my_api_web/endpoint.ex — plugs, sockets, instrumentation
  • lib/my_api_web/router.ex — pipelines, scopes, versioning, sockets
  • lib/my_api_web/controllers/* — REST/JSON controllers
  • lib/my_api/* — contexts + Ecto schemas (ownership of data logic)
  • lib/my_api_web/channels/* — Channel modules

Routing and Pipelines

Separate browser vs API pipelines; version APIs with scopes.

defmodule MyApiWeb.Router do
  use MyApiWeb, :router

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Category
Backend & APIs
First seen
Jun 3, 2026

More from bobmatnyc/claude-mpm-skills

All 158
1vercel avatarrouting-middlewarevercel/vercel-pluginrouting middleware338skills.sh installs
2incept5 avatareve-auth-and-secretsincept5/eve-skillpacksAuthenticate with Eve, manage project secrets, and add SSO login to Eve-deployed apps.332skills.sh installs
3vercel avatarauthvercel/vercel-pluginauth326skills.sh installs
4sickn33 avatardotnet-backendsickn33/antigravity-awesome-skillsdotnet backend323skills.sh installs
5davila7 avataruspto-databasedavila7/claude-code-templatesAccess USPTO APIs for patent/trademark searches, examination history (PEDS), assignments, citations, office actions, TSDR, for IP analysis and prior art searche318skills.sh installs
6alinaqi avatarnodejs-backendalinaqi/claude-bootstrapnodejs backend316skills.sh installs