Database design

In this section, we are going to look at the database design. We are going to have three collections; namely, user, thread and message. Any visitor to our forum will be able to view the threads and replies. But they cannot post a reply or create a thread or like a reply/thread till they log in. The user collection will have the following schema:

  • Name: User's full name.
  • Email: User's email address.
  • Password: User's login password.
  • Role: Will have two values, user and admin. The default value is user.

The thread collection will have the following schema:

  • Title: The title of the thread.
  • Description: The description of the thread.
  • Tags: The searchable tags for the thread.
  • Is Pinned: The boolean values that pins this thread ...

Get Google Cloud AI Services Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.