Repository navigation
Database ‐ Data Model
Enoch Olayemi edited this page Jul 8, 2026
·
2 revisions
This page gives a high-level view of the current MongoDB document relationships used by Tapitude Creator Hub.
The app uses MongoDB through Mongoose. This is not a traditional relational ERD, but the documents do reference each other by id.
erDiagram
USERS ||--o| CREATOR_PROFILES : "has profile"
USERS ||--o{ CONTENT_PAGES : "owns"
CONTENT_PAGES ||--o| FILES : "references media by fileKey"
CREATOR_PROFILES ||--o| FILES : "references profile image by fileKey"
USERS ||--o{ AUDIT_LOGS : "may perform"
USERS {
ObjectId _id
string name
string email
string passwordHash
string role
string status
Date createdAt
Date updatedAt
}
CREATOR_PROFILES {
ObjectId _id
ObjectId userId
string creatorSlug
string displayName
string brandName
string brandColor
string bio
string profileImageKey
number totalViews
number totalLikes
Date createdAt
Date updatedAt
}
CONTENT_PAGES {
ObjectId _id
ObjectId creatorId
string fileKey
string body
Date publishDate
number likes
string[] viewedBy
boolean preserveAspectRatio
Date createdAt
Date updatedAt
}
FILES {
ObjectId _id
string fileKey
string originalName
string contentType
number fileSize
string ownerId
boolean isActive
Date createdAt
}
AUDIT_LOGS {
ObjectId _id
ObjectId actorUserId
string action
string targetType
ObjectId targetId
object metadata
Date createdAt
Date updatedAt
}
- A
Usercan be an admin or creator. - A creator
Userhas oneCreatorProfile. - A creator
Userowns manyContentPagedocuments. - A
ContentPagecan reference one uploaded file throughfileKey. - A
CreatorProfilecan reference one profile image throughprofileImageKey. - Uploaded file metadata is stored in
Filedocuments. - Physical uploaded files are stored in the local
storage/folder during development.
The current app stores basic analytics directly on existing documents:
CreatorProfile.totalViewsCreatorProfile.totalLikesContentPage.likesContentPage.viewedBy
Older wiki references to an analytics_events collection should be treated as future planning, not current implementation.
Review and reconcile ContentPage.status.
Current controllers and views reference status, while the inspected ContentPage schema is centered on publishDate. This should be resolved before the app is considered final.