All Projects → bradpotts → multi-tenancy-devise

bradpotts / multi-tenancy-devise

Licence: MIT license
mtdevise adds basecamp style user logins to your ruby on rails application.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to multi-tenancy-devise

Stitches
Create a Microservice in Rails with minimal ceremony
Stars: ✭ 371 (+1274.07%)
Mutual labels:  ruby-gem, gem, rails-engine
Motion
Reactive frontend UI components for Rails in pure Ruby
Stars: ✭ 498 (+1744.44%)
Mutual labels:  ruby-gem, gem
Devise masquerade
Extension for devise, enable login as functionality. Add link to the masquerade_path(resource) and use it.
Stars: ✭ 380 (+1307.41%)
Mutual labels:  ruby-gem, gem
memo wise
The wise choice for Ruby memoization
Stars: ✭ 486 (+1700%)
Mutual labels:  ruby-gem, gem
rspec n
A ruby gem that runs RSpec N times.
Stars: ✭ 37 (+37.04%)
Mutual labels:  ruby-gem, gem
log-symbols
A ruby 💎gem💎 for generating log symbols
Stars: ✭ 14 (-48.15%)
Mutual labels:  ruby-gem, gem
Api Fuzzer
API Fuzzer which allows to fuzz request attributes using common pentesting techniques and lists vulnerabilities
Stars: ✭ 238 (+781.48%)
Mutual labels:  ruby-gem, gem
make model searchable
Adds simlpe search functionality to models
Stars: ✭ 27 (+0%)
Mutual labels:  ruby-gem, gem
pixitar
🧝 Pixitar is an avatar generation library written in Ruby.
Stars: ✭ 20 (-25.93%)
Mutual labels:  ruby-gem, gem
grape-jwt-authentication
A reusable Grape JWT authentication concern
Stars: ✭ 31 (+14.81%)
Mutual labels:  ruby-gem, gem
exception hunter
Crash reporting engine to hunt down bugs 🐞
Stars: ✭ 78 (+188.89%)
Mutual labels:  gem, rails-engine
filtered
Filters ActiveRecord queries in a nice way
Stars: ✭ 28 (+3.7%)
Mutual labels:  ruby-gem, gem
rails cursor pagination
Add cursor pagination to your ActiveRecord backed application
Stars: ✭ 21 (-22.22%)
Mutual labels:  ruby-gem, gem
syobocal
Simle gem for Syboi Calendar
Stars: ✭ 13 (-51.85%)
Mutual labels:  ruby-gem, gem
jsonapi-serializer-formats
💎 Gem to enrich jsonapi-serializer with multiple formats
Stars: ✭ 20 (-25.93%)
Mutual labels:  ruby-gem, gem
Unimidi
Realtime MIDI IO for Ruby
Stars: ✭ 229 (+748.15%)
Mutual labels:  ruby-gem, gem
Material icons
A simple Rails wrapper for Google Material Icons
Stars: ✭ 266 (+885.19%)
Mutual labels:  gem, rails-engine
Tabler Rubygem
Rubygem for https://tabler.github.io
Stars: ✭ 77 (+185.19%)
Mutual labels:  gem, rails-engine
slackify
Build Slackbot on Rails using Slack Event API
Stars: ✭ 20 (-25.93%)
Mutual labels:  gem, rails-engine
churnalizer
Analyze your Ruby app for Churn vs Complexity
Stars: ✭ 17 (-37.04%)
Mutual labels:  ruby-gem, gem

security Code Climate Gem Version License: MIT

MTDevise Rails 5.1 Multi-Tenancy Engine Documentation

PHC MTDevise Rails 5.1 engine adds multi-tenant and account management features to rails Devise gem. Plataformatec Devise and required custom Bootstrap Devise views included.

  • Multi-tenancy using subdomain scoping and account_id column.
  • Adds basecamp style logins to devise authentication gem.
  • Welcome, Dashboard with custom Devise views included.
  • Highly customizable views and layouts using standard bootstrap 3 code.
  • Central login screen for all tenants (users) or logins through a subdomain.
  • Mis-Spelling and redirect to welcome screen if subdomain none-existent.
  • Compatible with postgre, mysql and sqlite (for dev environments).

Step 1 - Add user model to your app (Must be Done First!!)

Generate a user.rb file in your mainapp and add the code below

rails g model User
include Mtdevise::UserStorage

Step 2 - Add Mtdevise to your gemfile and run command

gem 'mtdevise', '~> 16.0'
bundle exec install

Step 3 - Add and migrate mtdevise database tables

rake railties:install:migrations
rake db:migrate

Step 4 - Configure ActionMailer

  • Mailer functions are required in order for mtdevise to operate.
  • Mailer is used for confirmation and password reset functions.

Step 5 - Mount the Engine in your Routes File

Add this line at the end of the routes file.

mount Mtdevise::Engine, :at => '/'

Step 6 - Constrain the routs you want secured

All the routes you want to have multi-tenacy login functions goes in between the constraints block.

constraints(Mtdevise::Constraints::SubdomainRequired) do
	# Routes Requiring Security & Multi-Tenancy Routes  
end

Step 7 - Modifications to MainApp Controllers & Database

Your app needs modification to controllers (example)
Any corresponding db database tables must have an accounts_id column

accounts_id

Step 8 - Add mtdevise extension to models

Add the mtdevise extension to the top of all models for the routes configured in the previous step.

def self.scoped_to(account)
	where(:account_id => account.id)
end

Step 9 - Configure scopes in your controller

Scope your controllers. Examples on github wiki or multi-tenant starter app.

.scoped_to(current_account)

Step 10 - Environment (ENV) Variables

Set a sent from email address for confirmation and password reset emails more info here. .

PHC_MTDEVISE_SENDER = [email protected]

Additional Information

Views - Mtdevise Views Can be Customized

Once installed views can be generated and customized to your apps needs.

rails generate mtdevise:views
rake assets:clobber
rake assets:precompile

Additional Documentation

Multi-Tenant Starter App
Documentation (Github Wiki)
Environment Variables
Issues & Bug Reports
Past Security Patch Notes
Managed by PHCNetworks

Circle CI

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].