Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yshmarov committed Nov 3, 2024
1 parent a58ebb3 commit 2195914
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions README.md
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

![Moneygun features](https://i.imgur.com/QUmTexS.png)

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)

![Moneygun features](https://i.imgur.com/QUmTexS.png)

### 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**.
Expand All @@ -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
Expand Down

0 comments on commit 2195914

Please sign in to comment.