State Management
Meelio uses Zustand for state management, providing a lightweight, hook-based approach to global state.Store Location
All stores are located in:Available Stores
Meelio includes 18 specialized stores for different features:Timer Store
Timer Store
File:
timer.store.tsManages Pomodoro timer state, sessions, and statistics.State Shape
Key Actions
Start the timer for the current stage
Pause the running timer
Reset timer to initial focus state
Skip to a specific timer stage
Update focus and/or break durations
Toggle notification settings
Toggle completion sound settings
Toggle soundscapes integration
Mark current stage as complete and transition to next
Usage Example
The timer store includes platform-specific implementations for web and extension environments, managed through a store registry pattern.
Task Store
Task Store
File:
task.store.tsManages tasks, lists, and task categories.State Shape
Key Actions
Create a new task
Toggle task completion status
Pin/unpin a task (only one task can be pinned at a time)
Soft delete a task
Get the currently pinned incomplete task
Usage Example
Note Store
Note Store
File:
note.store.tsManages user notes with local storage persistence.State Shape
Key Actions
Create a new note (max 500 notes, 10,000 chars per note)
Update note properties
Pin/unpin a note (only one note can be pinned)
Soft delete a note
Toggle typing sound effects
Usage Example
Soundscapes Store
Soundscapes Store
File:
soundscapes.store.tsManages ambient soundscapes, combos, and audio playback.State Shape
Key Actions
Start playing a sound
Pause a playing sound
Toggle sound play/pause state
Set volume for a specific sound
Set master volume for all sounds
Toggle volume oscillation effect
Play all sounds in a category
Play 2-4 random sounds
Save a sound combination
Play a saved combo
Usage Example
Background Store
Background Store
File:
background.store.tsManages wallpapers and background images/videos.State Shape
Key Actions
Set the active wallpaper
Remove a custom wallpaper
Reset to default wallpaper (date-based selection)
Get current wallpaper (handles hydration state)
App Store
App Store
File:
app.store.tsGlobal application settings and configuration.State Shape
Key Actions
Set the current platform
Enable/disable daily mantra rotation
Enable/disable daily wallpaper rotation
Toggle 12/24 hour clock format
Toggle confetti on task completion
Other Stores
Auth Store
auth.store.ts - User authentication and session managementBookmarks Store
bookmarks.store.ts - Bookmark managementBreathing Store
breathing.store.ts - Breathing exercise stateCalendar Store
calendar.store.ts - Calendar integrationCategory Store
category.store.ts - Task/note categoriesDock Store
dock.store.ts - Dock UI stateGreetings Store
greetings.store.ts - Personalized greetingsOnboarding Store
onboarding.store.ts - First-time user experienceQuotes Store
quotes.store.ts - Inspirational quotesSearch Store
search.store.ts - Search functionalitySettings Store
settings.store.ts - Application settingsSite Blocker Store
site-blocker.store.ts - Website blockingTab Stash Store
tab-stash.store.ts - Browser tab managementStore Patterns
Persistence
Most stores use Zustand’spersist middleware for localStorage persistence:
Selectors with subscribeWithSelector
Some stores usesubscribeWithSelector middleware for fine-grained subscriptions:
Database Integration
Stores integrate with Dexie.js for IndexedDB storage:All stores follow a consistent pattern:
- State interface definition
- Store creation with Zustand
- Actions that update state
- Optional persistence configuration
- Database synchronization where needed
Next Steps
Component Overview
Learn about component architecture
Custom Hooks
Explore reusable hooks