SuperAdmin
A modern, flexible administration engine for Rails applications
SuperAdmin is a mountable Rails engine that provides a full-featured administration interface inspired by Administrate and ActiveAdmin, built for modern Rails 7+ applications with Hotwire, Turbo, and Tailwind CSS.
Quick Links: 📖 Documentation • ⚡ Features • 🚀 Quick Start • 🤝 Contributing
Why SuperAdmin?
- Built for Rails 7+ - Takes full advantage of Hotwire, Turbo, and modern Rails features
- ⚡ Fast by Default - Turbo-powered interactions without writing JavaScript
- Beautiful UI - Modern, responsive design with Tailwind CSS
- Easy to Customize - Simple DSL that doesn't get in your way
- Batteries Included - Audit logging, CSV exports, and authorization built-in
- Quick Setup - Get a full admin panel running in under 5 minutes
Status
In Active Development - This gem is currently in active development. APIs may change between versions. Production use is not recommended until v1.0 release.
Requirements
- Ruby >= 3.2
- Rails >= 7.1
- ImportMap Rails (default in Rails 8+)
Installation
1. Add the Gem
gem "super_admin", "~> 0.2.0"Then run:
bundle install2. Install SuperAdmin
rails generate super_admin:install
rails db:migrate3. Mount the Engine
Add to your config/routes.rb:
mount SuperAdmin::Engine => '/super_admin'4. Generate Dashboards
# Generate dashboards for all models
rails generate super_admin:dashboard
# Or for a specific model
rails generate super_admin:dashboard User5. Start Your Server
bin/devVisit /super_admin and you're done! 🎉
Quick Start
Customize a Dashboard
Edit the generated dashboard to control which attributes are displayed:
# app/dashboards/super_admin/user_dashboard.rb
module SuperAdmin
class UserDashboard < BaseDashboard
# Attributes shown in the table view
def collection_attributes
%i[id email name created_at]
end
# Attributes shown in the detail view
def show_attributes
%i[id email name role created_at updated_at posts]
end
# Attributes shown in the form
def form_attributes
%i[email name role bio]
end
end
endConfigure Authorization
In config/initializers/super_admin.rb:
SuperAdmin.configure do |config|
# Use Pundit
config.authorization_adapter = :pundit
# Or custom authorization
config.authorize_with do
redirect_to root_path unless current_user&.admin?
end
# Number of records per page
config.records_per_page = 20
# Maximum nested depth for associations
config.max_nested_depth = 3
endKey Features
- Full CRUD Operations - Create, read, update, delete with minimal configuration
- Advanced Filtering - Search, filter, and sort with dynamic UI
- CSV Exports - Background job processing with status tracking
- Audit Logging - Track all admin activities automatically
- Nested Associations - Smart form builder with configurable depth
- Authorization - Pundit, CanCanCan, or custom authorization
- Turbo Streams - Real-time updates without page reloads
- Accessibility - WCAG 2.1 compliant with ARIA labels and keyboard navigation
Documentation
- Features - Complete feature list
- Architecture - Technical architecture and patterns
- Contributing - How to contribute
- Code of Conduct - Community guidelines
Development
Setup
git clone https://github.com/ThibautBaissac/super_admin.git
cd super_admin
bundle installRunning Tests
bin/rails testCode Quality
bin/rubocopTesting with a Rails App
cd test/dummy
bin/rails db:seed
bin/dev
# Visit http://localhost:3000/super_admin/Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create your feature branch (
git checkout -b feat/my-feature) - Write tests for your changes
- Run tests and linter (
bin/rails test && bin/rubocop) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feat/my-feature) - Create a Pull Request
License
SuperAdmin is released under the MIT License.
Support
Acknowledgments
SuperAdmin is inspired by:
- Administrate - Thoughtbot's admin framework
- ActiveAdmin - The Ruby on Rails framework for creating elegant backends
Made with ❤️ by Thibaut Baissac
