Sign up for Hasura Newsletter
Loading...

Tables for Slack Clone

Let's get started by looking at the data model.

Users

The primary functionality of the app revolves around users and their messages.

So we have the following tables.

  • users and user_message

Workspace

Slack app has workspaces where users can join. It is managed by the owner and the admins of the workspace. The following tables takes care of this requirement.

  • workspace, workspace_member and workspace_user_type

Channel

Each workspace can have channels scoped to a specific topic of discussion having subset of members from the workspace. Members of the channel can post messages to the channel that everyone can see.

  • channel, channel_member, channel_thread and channel_thread_message

The final model roughly looks like the following with basic relational columns:

Slack Data Model

Note that it doesn't have the detailed column list, but it should give an idea of the relationships between different entities.

Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2022 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin