Data Models
TypeScript interfaces used throughout the STORM DAY frontend application.
User
Represents a user account in the system.
interface User {
id: string // UUID, primary identifier
username: string // Unique username for @mentions
display_name: string // Display name shown in UI
email: string // Email address for auth
avatar_url?: string // Optional profile picture URL
}idstringUUID primary identifier assigned on registration
usernamestringUnique username used for @mentions and search
display_namestringUser's display name shown in chat bubbles and lists
emailstringEmail address used for authentication
avatar_urlstring?Optional URL to user's profile picture
Conversation
Represents a chat conversation (private or group).
interface Conversation {
id: string // UUID, conversation identifier
name: string // Conversation name (group name or other user's name)
preview: string // Last message preview text
time: string // Formatted time of last activity
unread: number // Count of unread messages
}idstringUUID used in room names and API calls
namestringFor groups: group name. For DMs: other user's display name
previewstringTruncated text of the most recent message
timestringHuman-readable timestamp (e.g., '2m ago', 'Yesterday')
unreadnumberNumber of unread messages in this conversation
Message
Represents a chat message with all metadata.
interface Message {
id: string // UUID, message identifier
author: string // Display name of sender
text: string // Message content
time: string // Formatted time (e.g., "10:30 AM")
rawTime: string // ISO timestamp for sorting
side: 'left' | 'right' // UI positioning (left=received, right=sent)
status?: 'sending' | 'sent' | 'delivered' | 'seen'
replyTo?: { // Present if replying to another message
id: string
author: string
text: string
}
forwardFrom?: { // Present if forwarded from another message
id: string
author: string
text: string
}
isForwarded?: boolean // True if this message was forwarded
modified?: boolean // True if message was edited
attachment?: string // URL to attached file/media
seenBy?: { // Array of users who have seen the message
id: string
displayName: string
}[]
}idstringUUID identifier, initially temp UUID then replaced by server
authorstringDisplay name of the message sender
textstringThe message content/body
timestringFormatted time string for display
rawTimestringISO 8601 timestamp for sorting and calculations
side'left' | 'right'Determines bubble alignment in chat UI
statusenum?Message delivery status: sending → sent → delivered → seen
replyToobject?Reference to the message being replied to
forwardFromobject?Reference to the original forwarded message
isForwardedboolean?Flag indicating this is a forwarded message
modifiedboolean?Flag indicating the message was edited
attachmentstring?URL to attached file or media
seenByarray?List of users who have seen this message (groups)
ChatUser
Represents a user within a conversation context (member).
interface ChatUser {
id: string // UUID, user identifier
username: string // Unique username
displayName: string // Display name (camelCase in frontend)
avatarUrl?: string // Optional profile picture URL
}idstringUUID of the conversation member
usernamestringUsername for mentions and identification
displayNamestringDisplay name shown in member lists
avatarUrlstring?Profile picture URL for avatars
Additional Types
TypingUser
interface TypingUser {
id: string
username: string
timestamp: number // Used to auto-clear after 3s
}MessageOptions
interface MessageOptions {
replyToId?: string // ID of message being replied to
forwardFromId?: string // ID of message being forwarded
attachment?: string // URL of attached file
}RegisterData
interface RegisterData {
username: string
display_name: string
email: string
password: string
}ApiResponse
interface ApiResponse<T> {
ok: boolean
data?: T
error?: {
code: string
message: string
}
}WebSocketFrame
interface WebSocketFrame {
action: string
room?: string
user?: string
username?: string
content?: string
message_id?: string
reply_to?: { id: string; author: string; text: string }
forward_from?: { id: string; author: string; text: string }
seen_user_id?: string
seen_display_name?: string
}