mockProfile
A pre-configured profile object representing the current user.User identifier:
"self"Display name:
"You"Phone number:
"+1 555-0100"Profile avatar URL
Status message:
"Building great products"mockChatState
A complete, seeded chat state with multiple contacts, conversations, and messages.Dictionary of chat objects, sorted by last activity (most recent first). Contains 6 pre-seeded conversations.
Dictionary of all message objects across all chats. Contains 194 total messages with varied content types, statuses, reactions, and replies.
Dictionary of contact objects. Includes 6 contacts with diverse profiles, online statuses, and metadata.
Dictionary of unsent message drafts keyed by chat ID. Empty by default.
Array of active typing indicators. Empty by default.
Array of previous search queries with timestamps. Contains 2 sample searches.
The currently active chat ID:
"chat-carlos"Included contacts
The mock data includes 6 diverse contacts with realistic profiles:ID:
Status: Online, favorite
Messages: 48 messages including 4 media attachments
About: Product designer • Rio
carlosStatus: Online, favorite
Messages: 48 messages including 4 media attachments
About: Product designer • Rio
ID:
Status: Offline, pinned
Messages: 32 messages including 6 media attachments
About: Mobile engineer • London
sofiaStatus: Offline, pinned
Messages: 32 messages including 6 media attachments
About: Mobile engineer • London
ID:
Status: Online
Messages: 16 text messages
About: Traveling in Kyoto 🇯🇵
liStatus: Online
Messages: 16 text messages
About: Traveling in Kyoto 🇯🇵
ID:
Status: Offline
Messages: 64 messages including 7 media attachments
About: Photographer • Berlin
helenaStatus: Offline
Messages: 64 messages including 7 media attachments
About: Photographer • Berlin
ID:
Status: Offline
Messages: 22 text messages
About: Running the NYC marathon 🏃
kevinStatus: Offline
Messages: 22 text messages
About: Running the NYC marathon 🏃
ID:
Status: Online
Messages: 12 text messages
About: Where experiments happen
teamStatus: Online
Messages: 12 text messages
About: Where experiments happen
Message characteristics
The seeded messages include realistic conversation patterns:- Content types: Text and image messages
- Statuses: Read, delivered, sent, and sending states
- Timestamps: Realistic time progression using
date-fnsfor date arithmetic - Reactions: ~10% of messages include emoji reactions (👍)
- Replies: ~8% of messages are replies to previous messages
- Forwarded: ~2% of messages are marked as forwarded
- Media captions: Image messages include contextual captions
- Alternating authors: Messages alternate between the contact and the user profile
Usage patterns
Development server
Use mock data to develop UI components without a backend:Testing
Use mock data as fixtures in unit and integration tests:Prototyping
Quickly build prototypes with realistic data:The mock data uses a seeded random number generator (
seed: 1337) to ensure consistent output across runs. All timestamps are based on 2024-05-18T16:42:00Z with relative offsets.Deterministic generation
The mock data is generated deterministically using:- Base timestamp:
2024-05-18T16:42:00Z - Seeded RNG: Consistent random values with seed
1337 - ID counter: Sequential IDs starting from 1