Data Model & Entity Relationships
Entity Hierarchy
User
└── ArtistSpace (owns)
└── Project (contains)
└── Track (contains)
└── File (versions)
└── Comment (feedback)Core Entities
User
The authenticated individual using the platform.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
email | String | Unique, required |
username | String | Display name |
password | String | Hashed |
image | String | Profile picture URL (CDN) |
profilePicture | String | Legacy field |
subscription | Ref → Subscription | Current plan |
authMethod | Enum | email, google, apple |
isVerified | Boolean | Email verified |
createdAt | Date | Registration date |
updatedAt | Date | Last modification |
ArtistSpace
Top-level container representing an artist, band, or label.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
shortId | String | Auto-generated 6-char identifier (nanoid) |
slug | String | User-customizable URL slug (premium) |
slugType | Enum | auto or premium |
name | String | Artist/band name |
image | String | Artist image (CDN) |
owner | Ref → User | Creator |
collaborators | Array | [{userId, role, addedAt}] |
projects | Ref[] → Project | Child projects |
createdAt | Date | |
updatedAt | Date |
Project
Album, EP, single, or creative project.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
shortId | String | Auto-generated 6-char identifier (nanoid) |
slug | String | User-customizable URL slug (premium) |
slugType | Enum | auto or premium |
name | String | Project title |
image | String | Cover art (CDN) |
description | String | Optional notes |
artistSpace | Ref → ArtistSpace | Parent |
owner | Ref → User | Creator |
collaborators | Array | [{userId, role}] |
tracks | Ref[] → Track | Child tracks |
status | Enum | draft, in_progress, review, completed |
createdAt | Date | |
updatedAt | Date |
Track
Individual song with multiple file versions.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
shortId | String | Auto-generated 6-char identifier (nanoid) |
slug | String | User-customizable URL slug (premium) |
slugType | Enum | auto or premium |
title | String | Song title |
project | Ref → Project | Parent |
artistSpace | Ref → ArtistSpace | Grandparent |
owner | Ref → User | Creator |
collaborators | Array | [{userId, role}] |
files | Ref[] → File | Version history |
latestFile | Ref → File | Current version |
status | Enum | draft, review, approved, published |
isPublic | Boolean | Shareable via link |
createdAt | Date | |
updatedAt | Date |
File
Versioned audio/image asset.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
name | String | Original filename |
blobUrl | String | Azure Blob Storage URL |
thumbnailUrl | String | Image thumb (CDN) |
mediumUrl | String | Image medium (CDN) |
type | Enum | audio, image, video, document |
contentType | String | MIME type |
size | Number | Bytes |
version | Number | Auto-increment per track |
isFinalVersion | Boolean | Approved version |
owner | Ref → User | Uploader |
artistSpace | String | Parent ID |
project | String | Parent ID |
track | String | Parent ID |
comments | Ref[] → Comment | Attached feedback |
metadata | Object | Duration, waveform, etc. |
createdAt | Date |
Comment
Time-synced feedback on audio/video.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
content | String | Comment text |
owner | Ref → User | Author |
file | Ref → File | Attached to |
track | Ref → Track | Parent track |
timeStart | Number | Seconds (audio position) |
timeEnd | Number | Seconds (range end) |
isResolved | Boolean | Marked complete |
likes | ObjectId[] | User IDs who liked |
responses | Ref[] → Comment | Replies |
createdAt | Date |
Notification
In-app alerts.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
sender | Ref → User | Who triggered |
recipient | Ref → User | Who receives |
title | String | Message text |
type | Enum | See NotificationEvents |
slug | String | Deep link URL |
pointerId | String | Related entity ID |
img | String | Thumbnail |
isRead | Boolean | Read status |
createdAt | Date |
Subscription
User billing tier.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
user | Ref → User | Subscriber |
plan | Enum | free, pro, team, enterprise |
storage | Object | {used, limit} in bytes |
status | Enum | active, cancelled, past_due |
billingCycle | Enum | monthly, yearly |
currentPeriodEnd | Date | Next billing |
createdAt | Date |
Link
Shareable collaboration invite.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Primary key |
owner | Ref → User | Creator |
resourceId | ObjectId | Target entity |
resourceType | Enum | artistSpace, project, track |
role | Enum | admin, editor, viewer |
shortCode | String | URL slug |
expiresAt | Date | Optional expiry |
usedBy | Ref[] → User | Who joined |
createdAt | Date |
Enums
Role
typescript
enum Role {
OWNER = 'owner',
ADMIN = 'admin',
EDITOR = 'editor',
VIEWER = 'viewer',
}FileType
typescript
enum FileType {
AUDIO = 'audio',
IMAGE = 'image',
VIDEO = 'video',
DOCUMENT = 'document',
}NotificationEvents
typescript
enum NotificationEvents {
NEW_COMMENT_CREATED = 'newCommentCreated',
RESPONSE_TO_COMMENT = 'responseToComment',
LIKE_TO_COMMENT = 'likeToComment',
COMMENT_COMPLETED = 'commentCompleted',
NEW_INVITE = 'newInvite',
INVITE_ACCEPTED = 'inviteAccepted',
COLLABORATOR_REMOVED = 'collaboratorRemoved',
FILE_UPLOADED = 'fileUploaded',
VERSION_APPROVED = 'versionApproved',
}Entity Relationship Diagram
mermaid
erDiagram
User ||--o{ ArtistSpace : owns
User ||--o{ Subscription : has
User ||--o{ Notification : receives
ArtistSpace ||--o{ Project : contains
ArtistSpace ||--o{ Collaborator : has
Project ||--o{ Track : contains
Project ||--o{ Collaborator : has
Track ||--o{ File : versions
Track ||--o{ Collaborator : has
File ||--o{ Comment : has
Comment ||--o{ Comment : replies
Link }o--|| ArtistSpace : targets
Link }o--|| Project : targets
Link }o--|| Track : targetsAccess Control Matrix
| Actor | ArtistSpace | Project | Track | File | Comment |
|---|---|---|---|---|---|
| Owner | CRUD | CRUD | CRUD | CRUD | CRUD |
| Admin | RU | CRUD | CRUD | CRUD | CRUD |
| Editor | R | R | RU | CRU | CRUD |
| Viewer | R | R | R | R | CR |
C=Create, R=Read, U=Update, D=Delete
Future Entities (Roadmap)
TimeLog
Creator work session tracking.
| Field | Type | Description |
|---|---|---|
user | Ref → User | Who worked |
resource | ObjectId | Track/Project |
resourceType | Enum | track, project |
startTime | Date | Session start |
endTime | Date | Session end |
duration | Number | Minutes |
description | String | Work notes |
Contract
Agreement between collaborators.
| Field | Type | Description |
|---|---|---|
parties | Ref[] → User | Signatories |
resource | ObjectId | Related project/track |
type | Enum | split, work_for_hire, license |
terms | Object | Contract details |
status | Enum | draft, pending, signed, expired |
signatures | Array | [{userId, signedAt}] |
RoyaltySplit
Revenue distribution agreement.
| Field | Type | Description |
|---|---|---|
track | Ref → Track | Related track |
splits | Array | [{userId, percentage, type}] |
effectiveDate | Date | When splits apply |