How wemrekurt/rails-api-boilerplate works
Project type and purpose
• This is a Rails-based API boilerplate (no built-in frontend) designed to expose RESTful endpoints for user authentication, registration, password management, token issuance (via Doorkeeper), background jobs (via Sidekiq), and real-time channels (via ActionCable).
• It uses a clean “controller → operation → contract → service → model” layering, with Swagger for API documentation and Ransack/Kaminari for searching and pagination.
File structure
• Top-level key folders:
• app/controllers (request & routing)
• app/operations + app/contracts (business orchestration & input validation)
• app/services (core business rules & integrations)
• app/models (ActiveRecord/DB mapping)
• app/jobs (Sidekiq background processing)
• app/channels (ActionCable real-time)
• config/routes, initializers (Devise, Doorkeeper, CORS, Sidekiq)
• db (PostgreSQL migrations & schema)
• Swagger docs under app/swagger_docs and docs/SWAGGER.md
• External dependencies/config:
• Redis (for Sidekiq and ActionCable pub/sub)
• PostgreSQL (primary data store)
• Puma (web server)
• Doorkeeper + Devise (OAuth2 & user auth)
• Ransack + Kaminari (search/sort/pagination)
README for insights
Request → ApplicationController → ApplicationOperation → ApplicationContract → ApplicationService → Response
• Sections reference Swagger, Service/Contract generators, and Ransack filters.
• Rectangles for synchronous layers (Controller, Operation, Service, Model)
• Rounded rectangles for background workers (Sidekiq) and real-time channels (ActionCable)
• Presentation (blue), Orchestration/Validation (yellow), Business Logic (green), Persistence (orange), Async/Real-time (purple)