New App? Separate Users From Accounts (from DAY ONE)
Вставка
- Опубліковано 23 лип 2024
- This week I'm building a new app (with a client) and I want to talk about a best practice - an exception to a best practice - that I think is really important:
When architecting a new app, I always separate Users from Accounts-even if our V1 scope doesn't call for this. I unpack why this matters.
What do you think?
00:00 - Separate Users From Accounts
0:15 - Avoid overbuilding
2:00 - Our V1 requirements
2:42 - The exception
4:05 - See the app
4:54 - Simple join table
6:56 - Demonstration
8:02 - Waiting on building UI
Got a new product to ship? Let's work together: instrumentalproducts.com
Hi Brian, do you scope everything to the user account from the beginning, like for example @posts = current_account.posts instead of @posts = current_user.posts
Depends on each app. But typically I scope things to the account. Accounts “own” things. Users “access” things.
Keep in mind a user might access things (posts etc) that are owned by multiple accounts.