- ✅ Registrations & Authentication (Devise + Devise invitable, but is quite easy to switch)
- ✅ 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)
Teams should be an MVP feature!
- ✅ Easy to switch between organizations
- ✅ Keep multiple organizations open in different tabs
- ✅ No hassle configuring subdomains
Yes, this can generate an "long" url like /organizations/344/projects/4532/tasks/24342342/edit
, but it preserves the logical hierarchy.
resources :organizations do
resources :memberships
resources :projects do
resources :tasks do
end
end
end
I tried using OrganizationMiddlewhare
like JumpstartPro does, but it felt too much of an unconventional approach.
- trello
- discord
- slack
- https://circle.so/
For example in Trello, you can have 2 unrelated boards open in 2 tabs.
- Clone the template repository:
git clone [email protected]:yshmarov/moneygun.git your_new_project_name
- Enter the project directory:
cd your_new_project_name
- Run the configuration and setup scripts:
bundle install
rails db:create db:migrate
- Start your application:
bin/dev
🚫 Bad
# models/project.rb
belongs_to :organization
belongs_to :user
✅ Good
# models/project.rb
belongs_to :organization
belongs_to :membership
I recommend scoping downstream models to organization
too. This way you can query them more easily.
# models/task.rb
belongs_to :organization # <- THIS
belongs_to :project
Inbox
is an example of a well-integrated resource scoped to an organization
. With pundit authorization and tests. Use it as an inspiration.
To quickly generate nested resources you can use gem nested_scaffold
rails generate nested_scaffold organization/project name
Generate a pundit policy:
rails g pundit:policy project
I did not focus on system tests, because the frontend can evolve a lot.
There are quite a lot of tests covering authentication, authorization, and multitenancy.
# run all tests
rails test:all
bundle exec erb_lint --lint-all -a
bundle exec rubocop -A
Feel free to raise an Issue or open a Pull Request!