Understanding Contexts - does this seem ok?

I feel like I am getting close to ‘grokking’ context’s (although I could just also be completely wrong) but just wanted to see if the hypothetical app below would could be implemented this way:

Let’s say you were making a YouTube Clone.

Here’s how I was thinking it COULD look using contexts:

Main Contexts

  • Registration/Onboarding -> Pretty self explanatory
  • Accounts -> authentication, profile/account settings + notification settings etc.
  • Videos -> deal with uploading, editing and tagging videso
  • interacting -> Dealing with the commenting, liking sharing etc. of a video

Generally, I like to split each context up like this:

|– lib
|–––– DB/
|––––––– repo.ex
|––––––– schemas/
|––––––––––––––––user.ex
|––––––––––––––––credentials.ex
|–––– Contexts/
|––––––– Accounts/
|––––––––––––––––accounts.ex
|––––––––––––––––interfaces/
|–––––––––––––––––––––––––auth.ex
|–––––––––––––––––––––––––token.ex
|–––––––––––––––––––––––––settings.ex
|–––––––––––––––––––––––––user.ex
|––––––––––––––––changesets/
|–––––––––––––––––––––––––update_user.ex
|–––––––––––––––––––––––––update_credentials.ex

At a basic level how does this look?

1 Like

Looks nice to me … this could then be extended with context for things like channels (multiple accounts can access, multiple videos / playlists in a channel, analytics, …), …

1 Like