Skip to content

Abdullah-l/wheel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheel 🛞

A Rails engine for managing dynamic configuration and feature flags with conditional rules.

It's time for you to take the wheel.

Features

  • Dynamic Configuration Storage

    • Store and manage configuration values with type safety
    • Supported types: string, integer, float, boolean, and JSON
    • In-memory caching for fast access
    • Real-time configuration updates
  • Conditional Rules

    • Define rules based on context attributes
    • Supported operators: equals, not_equals, in, not_in, matches, greater_than, less_than
    • Multiple conditions per configuration
    • Context-based evaluation
  • Web Interface

    • Modern UI for managing configurations
    • Create and edit configuration values
    • Define conditional rules
    • Type-safe value editing

Installation

  1. Add to your Gemfile:
gem 'wheel'
  1. Install:
$ bundle install
  1. Run the installer:
$ rails generate wheel:install
$ rails db:migrate
  1. Mount the engine in config/routes.rb:
Rails.application.routes.draw do
  mount Wheel::Engine => "/wheel"
end

Usage

Basic Configuration

# Get a configuration value
value = Wheel["feature.enabled"]

# Get a configuration with context
value = Wheel["pricing.tier", user_id: "123"]

Using with Context

You can define default context attributes:

# config/initializers/wheel.rb
Wheel.configure do |config|
  config.attributes = {
    user_id: {
      name: 'User ID',
      description: 'The unique identifier of the user'
    }
  }
end

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Create a Pull Request

License

This project is licensed under the MIT License.

About

A feature flag and config management system

Resources

License

Stars

Watchers

Forks

Packages

No packages published