Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. maru

maru

BSD-3-ClauseElixir

A REST-like API micro-framework for Elixir, inspired by Grape, designed for building modular and structured web services.

Visit WebsiteGitHubGitHub
1.3k stars85 forks0 contributors

What is maru?

Maru is a REST-like API micro-framework for Elixir, inspired by Ruby's Grape framework. It provides a Domain-Specific Language (DSL) for building modular, versioned, and well-structured RESTful APIs with built-in features like parameter validation and error handling. The framework integrates seamlessly with the Elixir ecosystem, leveraging Plug and Cowboy for HTTP handling, making it ideal for developing scalable microservices and web applications.

Target Audience

Elixir developers building RESTful APIs, particularly those focused on creating scalable microservices or web applications that require modular organization, versioning, and robust parameter validation. It suits teams seeking a convention-over-configuration approach similar to Ruby's Grape framework.

Value Proposition

Developers choose Maru for its clean, declarative DSL that reduces boilerplate while offering powerful built-in features like parameter validation with types and constraints, modular routing for reusable endpoints, and centralized error handling. Its seamless integration with Elixir's Plug and Cowboy ensures reliability and leverages the language's concurrency and fault-tolerance strengths.

Overview

Elixir RESTful Framework

Use Cases

Best For

  • Building scalable microservices in Elixir that require modular and versioned API endpoints.
  • Developing RESTful APIs with strict parameter validation, including type checking, value ranges, and custom constraints.
  • Organizing large API codebases into reusable modules using mountable routers and namespaces.
  • Implementing centralized error handling with rescue_from macros for consistent error responses across an API.
  • Integrating Plug middleware for request/response processing or static file serving within an API framework.
  • Creating APIs that need flexible JSON configuration with support for libraries like Jason.

Not Ideal For

  • Projects requiring real-time features like WebSockets or GraphQL support out of the box
  • Teams already using Phoenix for full-stack development where API-specific frameworks add unnecessary overlap
  • Simple API prototypes where the overhead of Maru's DSL and OTP configuration isn't justified

Pros & Cons

Pros

Declarative Parameter Validation

Maru's DSL allows defining parameters with types, constraints, and custom validation, as shown in the README with examples like 'requires :age, type: Integer, values: 18..65' and 'exactly_one_of [:avatar, :avatar_url]' for complex rules.

Modular Routing System

APIs can be organized into reusable namespaces and mountable modules, enabling clean separation of concerns, demonstrated by 'namespace :user do' and 'mount Router.User' in the example code.

Centralized Error Handling

Built-in rescue_from macros allow handling exceptions consistently across the API, with examples for specific errors like 'Unauthorized' and fallbacks for all errors, reducing boilerplate.

Seamless Plug Integration

Maru leverages Elixir's Plug middleware ecosystem for request processing, as seen with 'plug Plug.Logger' and configurable parsers, making it easy to extend functionality.

Cons

Configuration Overhead

Setup requires multiple steps: adding dependencies, configuring the server in mix.exs and Application, and integrating with OTP, which can be complex compared to simpler frameworks.

Pre-1.0 Stability Risks

With version '~> 0.14', Maru is still in development, and users may face breaking changes between releases, as noted by the lack of a stable 1.0 release.

Niche Ecosystem Limitations

As a smaller framework inspired by Ruby's Grape, Maru has fewer community extensions and third-party integrations compared to Phoenix, potentially requiring more custom development for advanced features.

Frequently Asked Questions

Quick Stats

Stars1,317
Forks85
Contributors0
Open Issues15
Last commit6 years ago
CreatedSince 2014

Tags

#elixir#parameter-validation#web-services#api-framework#dsl#rest-api#microframework#cowboy#error-handling#plug

Built With

P
Plug
E
Elixir
J
Jason
C
Cowboy

Links & Resources

Website

Included in

Elixir13.1k
Auto-fetched 13 hours ago

Related Projects

SOAP clientSOAP client

SOAP client for Elixir programming language

Stars140
Forks81
Last commit1 year ago
urnaurna

REST in peace.

Stars94
Forks5
Last commit9 years ago
detergentdetergent

An emulsifying Erlang SOAP library

Stars65
Forks39
Last commit7 years ago
detergentexdetergentex

Elixir binding to Detergent erlang library used to call WSDL/SOAP Services

Stars65
Forks21
Last commit8 years 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