GoWithMeOrg / go-with-me

Social traveling and meet-ups
https://whale-app-o9nhh.ondigitalocean.app/
0 stars 1 forks source link

Datatypes #2

Closed sergey-platonov closed 10 months ago

sergey-platonov commented 10 months ago

We need well defined data types for the user, location, event, etc.

sergey-platonov commented 10 months ago

First iteration

  1. User Collection:

    • _id: ObjectId
    • username: String
    • email: String
    • passwordHash: String
    • profilePic: String (URL or base64 encoded data)
    • bio: String
    • dateJoined: Date
  2. Trip/Event Collection:

    • _id: ObjectId
    • tripName: String
    • description: String
    • startDate: Date
    • endDate: Date
    • location: Array of Embedded Documents (see below for structure)
    • isPrivate: Boolean
    • organizerId: ObjectId (reference to User's _id)
    • bannerImage: String (URL or base64 encoded data)
  3. Location Embedded Document (within Trip/Event Collection):

    • type: Enum (City, Attraction, Venue)
    • name: String
    • address: String (optional)
    • coordinates: Embedded Document
      • latitude: Number
      • longitude: Number
  4. Invitations Collection:

    • _id: ObjectId
    • tripId: ObjectId (reference to Trip's _id)
    • inviteeId: ObjectId (reference to User's _id)
    • status: Enum (Pending, Accepted, Declined)
    • dateInvited: Date
  5. Attendees/Participants Collection:

    • _id: ObjectId
    • tripId: ObjectId (reference to Trip's _id)
    • userId: ObjectId (reference to User's _id)
    • joinDate: Date
  6. Comments/Feedback Collection:

    • _id: ObjectId
    • tripId: ObjectId (reference to Trip's _id)
    • userId: ObjectId (reference to User's _id)
    • content: String
    • datePosted: Date
  7. Notifications Collection:

    • _id: ObjectId
    • recipientId: ObjectId (reference to User's _id)
    • content: String
    • dateSent: Date
    • isRead: Boolean