Lets Think what Entities can be present in Twitter from first principle

image.png

Don’t Think about attributes we will add it later

Every Entity will Have CreatedAt and UpdatedAt Field

Every App starts with User who sign up and create account so we will create user entity

image.png

model Users {
  id         String   @id @default(uuid())
  createdAt  DateTime @default(now())
  updatedAt  DateTime @default(now())
}

Every User will also have Profile where he puts his bio and all things

image.png

model Profile {
  id              String          @id @default(uuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now())
}

I See there is one notification section here so in our database notification of users should also exist

image.png

model Notifications {
  id        String            @id @default(uuid())
  createdAt DateTime          @default(now())
  updatedAt DateTime          @default(now())
}

User will also chat and will have messages