Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. plug

plug

NOASSERTIONElixir

A specification and toolkit for building composable web applications with functions in Elixir.

Visit WebsiteGitHubGitHub
3.0k stars610 forks0 contributors

What is plug?

Plug is a specification and adapter layer for building web applications in Elixir. It allows developers to compose web request/response pipelines using small, reusable functions called plugs, abstracting away web server details. It serves as the foundational layer for Elixir web frameworks like Phoenix, providing tools for routing, middleware, and connection handling.

Target Audience

Elixir developers building web applications, APIs, or middleware who want a lightweight, composable alternative to full-stack frameworks. It's particularly useful for those creating custom web servers, microservices, or integrating with existing Elixir systems.

Value Proposition

Developers choose Plug for its simplicity, performance, and seamless integration with the Erlang VM. Its functional, composable design allows for flexible middleware pipelines, while its web server abstraction enables running the same application on different servers without code changes.

Overview

Compose web applications with functions

Use Cases

Best For

  • Building lightweight web APIs in Elixir without a full framework
  • Creating custom middleware pipelines for HTTP request processing
  • Developing microservices that need fine-grained control over web server behavior
  • Prototyping web applications before committing to a larger framework
  • Adding web interfaces to existing Elixir/OTP applications
  • Learning how web frameworks like Phoenix work under the hood

Not Ideal For

  • Teams wanting a full-stack web framework with integrated ORM, templating, and scaffolding tools out of the box
  • Projects that prioritize rapid prototyping with pre-styled UI components and minimal configuration
  • Environments where the development team is not already proficient in Elixir and functional programming concepts

Pros & Cons

Pros

Functional Composability

Plugs are simple, chainable functions that enable flexible middleware pipelines, as demonstrated in the router examples where plugs like Plug.Logger can be inserted seamlessly.

Web Server Agnosticism

Plug abstracts web server details, allowing the same application to run on Cowboy or Bandit via connection adapters, giving developers flexibility in deployment.

High-Performance Routing

Plug.Router compiles routes into optimized tree lookups in the Erlang VM, ensuring fast request dispatching without linear overhead.

Rich Middleware Library

Includes ready-to-use plugs for common tasks like authentication, CSRF protection, and static file serving, reducing boilerplate code.

Cons

Minimalist by Design

Lacks higher-level web features such as database integration or templating engines, forcing developers to assemble additional libraries for full-stack development.

Manual Configuration Overhead

Setting up supervision trees, routing, and middleware requires more code and understanding of OTP compared to opinionated frameworks like Phoenix.

Elixir Ecosystem Dependency

Tightly coupled to Elixir and the Erlang VM, making it unsuitable for polyglot projects or teams unfamiliar with functional programming paradigms.

Frequently Asked Questions

Quick Stats

Stars3,016
Forks610
Contributors0
Open Issues3
Last commit5 days ago
CreatedSince 2013

Tags

#http-server#functional-programming#elixir#erlang-vm#web-framework#composable#web-application#router#middleware#websockets

Built With

E
Elixir
E
Erlang VM
B
Bandit
C
Cowboy

Links & Resources

Website

Included in

Microservices14.2kElixir13.1k
Auto-fetched 5 hours ago

Related Projects

surfacesurface

A server-side rendering component library for Phoenix

Stars2,135
Forks146
Last commit5 months ago
commandedcommanded

Use Commanded to build Elixir CQRS/ES applications

Stars2,030
Forks256
Last commit1 month ago
ex_adminex_admin

ExAdmin is an auto administration package for Elixir and the Phoenix Framework

Stars1,197
Forks264
Last commit6 years ago
torchtorch

A rapid admin generator for Elixir & Phoenix

Stars1,174
Forks85
Last commit4 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub