-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,31 @@ | ||
# [Teams should be an MVP feature!](https://blog.bullettrain.co/teams-should-be-an-mvp-feature/) | ||
|
||
### Rails 8 Multitenancy Boilerplate | ||
|
||
 | ||
|
||
Row-level route-based multitenancy in Ruby on Rails | ||
|
||
<a href="https://www.youtube.com/watch?v=KMonLTvWR5g"><img src="https://i3.ytimg.com/vi/KMonLTvWR5g/maxresdefault.jpg" title="Row-level route-based multitenancy in Ruby on Rails" width="50%" /><a> | ||
|
||
[Watch Screencast](https://www.youtube.com/watch?v=KMonLTvWR5g) | ||
|
||
### Inspiration | ||
|
||
- trello | ||
- discord | ||
- slack | ||
- https://circle.so/ | ||
# Rails 8 Multitenancy Boilerplate | ||
|
||
### Core features | ||
|
||
- ✅ Registrations & Authentication (Devise + Devise invitable, but is quite easy to switch) | ||
- ✅ Create Organizations (aka Teams, Organizations, Workspaces, Tenants) | ||
- ✅ Invite Users to Organization & assign role (admin, member) | ||
- ✅ Create Organizations (aka Teams, Accounts, Workspaces, Tenants) | ||
- ✅ Invite Users to Organization & assign role (admin, member). | ||
- ✅ Organization admin can manage organization & members | ||
- ✅ Authorization | ||
- ✅ Complete test coverage | ||
- ✅ Basic UI design | ||
- ✅ Nested scaffold generators for fast development (/organizations/projects) | ||
|
||
 | ||
|
||
### About Row-level route-based multitenancy in Ruby on Rails | ||
|
||
[Teams should be an MVP feature!](https://blog.bullettrain.co/teams-should-be-an-mvp-feature/) | ||
|
||
[Watch Screencast](https://www.youtube.com/watch?v=KMonLTvWR5g): | ||
<a href="https://www.youtube.com/watch?v=KMonLTvWR5g"><img src="https://i3.ytimg.com/vi/KMonLTvWR5g/maxresdefault.jpg" title="Row-level route-based multitenancy in Ruby on Rails" width="50%" /><a> | ||
|
||
### Why route-based multitenancy? | ||
|
||
- ✅ Easy to switch between organizations | ||
- ✅ Keep multiple organizations open in different tabs | ||
- ✅ No hassle configuring subdomains | ||
|
||
For example in Trello, you can have 2 unrelated boards open in 2 tabs. | ||
|
||
### Why deep nested routes? | ||
|
||
Yes, this can generate an "long" url like `/organizations/344/projects/4532/tasks/24342342/edit`, but it preserves the logical **hierarchy**. | ||
|
@@ -50,6 +42,40 @@ end | |
|
||
I [tried using `OrganizationMiddlewhare`](https://github.com/yshmarov/askvote/pull/24/files#diff-44009a2f9efdafcc7cd44e1cb5e03151a74aa760c54af5c16e2cc7095ff3b0ffR7) like JumpstartPro does, but it felt too much of an **unconventional** approach. | ||
|
||
### Design inspiration | ||
|
||
- trello | ||
- discord | ||
- slack | ||
- https://circle.so/ | ||
|
||
For example in Trello, you can have 2 unrelated boards open in 2 tabs. | ||
|
||
## Development | ||
|
||
### Getting started | ||
|
||
1. Clone the template repository: | ||
``` | ||
git clone [email protected]:yshmarov/moneygun.git your_new_project_name | ||
``` | ||
|
||
2. Enter the project directory: | ||
``` | ||
cd your_new_project_name | ||
``` | ||
|
||
3. Run the configuration and setup scripts: | ||
``` | ||
bundle install | ||
rails db:create db:migrate | ||
``` | ||
|
||
4. Start your application: | ||
``` | ||
bin/dev | ||
``` | ||
|
||
### Resource assignments and references should be to Membership and not User! | ||
|
||
🚫 Bad | ||
|