High-Level Architecture
Meelio is a fully offline-first productivity application built as a Turborepo monorepo. All data is stored locally in the browser, ensuring privacy and functionality without internet connectivity.
Monorepo Structure
Meelio uses Turborepo with pnpm workspaces to manage a monorepo containing multiple apps and shared packages.The monorepo structure enables code sharing between the web app and extension while maintaining clear boundaries and independent deployment.
Apps
Web Application
Location:apps/web/
Tech Stack:
- React 18.3.1 - UI library
- Vite 5.4.11 - Build tool and dev server
- React Router 6.16.0 - Client-side routing
- TypeScript 5.3.3 - Type safety
- Runs on port 4000 (
apps/web/package.json:6) - Vite with React SWC plugin for fast refresh
- PWA support via
vite-plugin-pwa - Compression and static file handling
Browser Extension
Location:apps/extension/
Tech Stack:
- Plasmo 0.90.5 - Extension framework
- React 18.3.1 - UI library
- Manifest V3 - Chrome extension manifest version
- Chrome
- Edge
- Firefox
- Opera
- Safari
- Brave
- Custom new tab page
- Site blocker
- Tab stash functionality
- Bookmarks management
- Background workers
apps/extension/package.json:120):
storage- Local data storagenotifications- Push notificationstabs(optional) - Tab managementtabGroups(optional) - Tab groupingbookmarks(optional) - Bookmark access
Shared Packages
@repo/shared
The core package containing all business logic shared between apps. Package Structure (packages/shared/src/):
packages/shared/src/stores/):
app.store.ts- Global app stateauth.store.ts- Authentication statebackground.store.ts- Background managementbookmarks.store.ts- Bookmarks statebreathing.store.ts- Breathing exercise statecalendar.store.ts- Calendar statecategory.store.ts- Category managementdock.store.ts- Dock configurationgreetings.store.ts- Greeting messagesnote.store.ts- Notes managementonboarding.store.ts- Onboarding flowquotes.store.ts- Quote of the daysearch.store.ts- Search functionalitysettings.store.ts- User settingssite-blocker.store.ts- Site blocking rulessoundscapes.store.ts- Ambient soundssoundscapes-timer-integration.ts- Sound/timer synctab-stash.store.ts- Tab stashingtask.store.ts- Task managementtimer.store.ts- Pomodoro timer
The
@repo/shared package uses TypeScript path exports (defined in package.json:51-63) to allow importing from specific subdirectories:@repo/ui
Component library based on shadcn/ui and Radix UI. Core Dependencies:@radix-ui/*- Headless UI primitiveslucide-react- Icon librarytailwindcss- Stylingclass-variance-authority- Variant managementtailwind-merge- Utility class merging
packages/ui/package.json:53-63):
State Management
Zustand
Meelio uses Zustand 5.x for state management across all stores. Why Zustand?- Minimal boilerplate
- TypeScript-first design
- No provider wrapper needed
- Easy to integrate with React
- Excellent DevTools support
Data Storage
IndexedDB via Dexie
Meelio uses Dexie 4.0.9 as a wrapper around IndexedDB for efficient local storage. Database Schema (packages/shared/src/lib/db/meelio.dexie.ts):
tasks- Todo items with categories, due dates, and completion statusfocusSessions- Pomodoro session historyfocusStats- Daily focus statisticsnotes- User notes with categoriessounds- Cached ambient soundscapes for offline playbackcategories- Custom task/note categoriessiteBlocker- Blocked website rulestabStashes- Saved tab groupsbookmarks- Cached browser bookmarksweather- Cached weather data
localStorage
Used for preferences and settings that don’t require complex querying:- User preferences
- Theme settings
- Onboarding state
- UI configurations
Offline-First Design
Meelio is designed to work completely offline:Local Data Storage
All user data is stored in IndexedDB and localStorage. No remote database required.
Technology Choices
Core Stack
React 18.3.1
Modern React with Concurrent Features, Suspense, and automatic batching
TypeScript 5.3.3
Full type safety across the entire codebase
Vite 5.4.11
Lightning-fast dev server and optimized production builds
Tailwind CSS 3.3.3
Utility-first CSS framework with custom configuration
State & Data
- Zustand 5.x - Lightweight state management
- Dexie 4.0.9 - IndexedDB wrapper for complex queries
- React Hook Form 7.47.0 - Form state management
- Zod 3.22.4+ - Schema validation
UI Components
- shadcn/ui - Headless component library
- Radix UI - Accessible primitives
- Lucide React 0.454.0 - Icon system
- Framer Motion 11.11.9 - Animations
- Recharts 2.13.0 - Data visualization
Build & Tooling
- Turborepo 2.4.2 - Monorepo build system
- pnpm 9.15.4 - Fast, disk-efficient package manager
- Plasmo 0.90.5 - Browser extension framework
- ESLint - Code linting
- Prettier - Code formatting
Extension-Specific
- @plasmohq/storage - Cross-browser storage API
- Chrome APIs - Browser extension APIs
Additional Libraries
- date-fns 4.1.0 - Date manipulation
- i18next 23.10.1+ - Internationalization
- axios 1.5.0 - HTTP client (for optional features)
- ical.js 2.2.1 - Calendar ICS parsing
- canvas-confetti 1.9.1 - Celebration animations
Build Pipeline
Turborepo orchestrates the build pipeline defined inturbo.json:
- Configuration packages (TypeScript, ESLint, Tailwind, Prettier)
- Shared packages (
@repo/ui,@repo/shared,@repo/logger) - Applications (
web,extension)
Turborepo uses content-based hashing to cache build outputs. Only changed packages are rebuilt.
Development Patterns
Component Structure
Store Pattern
Database Queries
Next Steps
Setup Guide
Set up your local development environment
Contributing
Learn how to contribute to Meelio
Components Overview
Explore component architecture
Core Features
Learn about core features
Features
Learn about Meelio’s features