Rails Api Template

screenshot of Rails Api Template

A Rails 5 JSON API template

Overview

The Rails-API-Template is a Ruby on Rails API application template that provides various features for building a JSON API server. It includes standard components such as JSON API Resources, UUID for IDs, has_secure_password for user password storage, and role-based authorization with Rolify. It also integrates additional features like Pundit for authorization of REST actions, JSON API Authorization, memcached for caching, and has_secure_tokens with JSON Web Tokens for managing and verifying user tokens. The template includes various controllers and configurations for authentication, testing, exception monitoring, and application monitoring. It can be extended to add support for Excel, PDF, background jobs, scheduling, email, networking tools, reporting tools, and ISO-compliant countries and exchange-rates information. The template requires Ruby, PostgreSQL, and Memcached for usage.

Features

  • Standard JSON API server: Utilizes JSON API Resources to create a standard JSON API server.
  • UUID instead of integer IDs: Uses UUID as the default for IDs in migrations.
  • has_secure_password extension: Implements the standard has_secure_password extension for storing user passwords securely.
  • Multiple roles per user and Rolify: Provides support for multiple roles per user and includes the Rolify library for role-based authorization.
  • Pundit and JSON API Authorization: Integrates the Pundit library for authorization of REST actions and includes JSON API Authorization.
  • Caching with memcached: Uses memcached as the underlying cache store to improve performance and reduce database hits.
  • has_secure_tokens extension and JSON Web Tokens: Implements a custom has_secure_tokens extension combined with JSON Web Tokens for managing and verifying user tokens.
  • Authentication and Authorization Controllers: Includes an authorization controller concern, a sessions_controller for JWT authentication and authorization, and a registrations_controller for user registrations.
  • Production-ready configuration: Provides a production-ready Puma configuration for deployment.
  • Testing support with Rspec and FactoryBot: Includes Rspec and FactoryBot for testing the application.
  • Exception monitoring with Rollbar: Provides a template for integrating Rollbar exception monitoring, recommended for use in production.
  • Application monitoring with New Relic: Includes a template for integrating New Relic application monitoring.
  • Support for optional features: Allows for the inclusion of additional features such as Excel, PDF, background jobs, scheduling, email, networking tools, reporting tools, and ISO-compliant countries and exchange-rates information.

Summary

The Rails-API-Template is a comprehensive Ruby on Rails API application template that provides a wide range of features for building JSON API servers. It includes standard components like JSON API Resources, UUID for IDs, and has_secure_password for user password storage. It also integrates additional libraries like Pundit and JSON API Authorization for authorization, memcached for caching, and has_secure_tokens with JSON Web Tokens for managing and verifying user tokens. The template includes various controllers and configurations for authentication, testing, exception monitoring, and application monitoring. It can be further customized to add additional features such as Excel, PDF, background jobs, email, networking tools, reporting tools, and ISO-compliant countries and exchange-rates information. The template requires Ruby, PostgreSQL, and Memcached for installation and usage.

fullstack
Fullstack

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.