Project Overview
Better Home is a Chrome extension built with modern web technologies, designed to replace the default new tab page with a minimal, customizable experience featuring tasks, quick links, and a mood calendar.Tech Stack
React 19
UI framework with latest concurrent features
TypeScript 5.9
Type-safe development with strict mode enabled
Vite 7
Lightning-fast bundler with HMR support
Tailwind CSS 4
Utility-first styling with custom design system
shadcn/ui
Accessible, composable UI components
Motion
Smooth animations (v12)
Tabler Icons
Crisp, consistent iconography
Bun
Ultra-fast package manager and runtime
Project Structure
Core Architecture
Application Entry
The extension has two entry points:index.html→src/main.tsx→src/app.tsx- The main new tab pagepopup.html→src/popup.tsx- The extension popup (settings)
vite.config.ts:
vite.config.ts
Component Organization
Components are organized into three categories:- Feature Components
- UI Components
- Layout Components
Located in
src/components/, these implement the core widgets:todo-list.tsx- Task management widgetquick-links.tsx- Bookmarks with faviconsinteractive-calendar.tsx- Mood calendar with year/quadrimester viewsmonth-grid.tsx- Calendar month renderingmood-selector.tsx- Mood selection UIdate-popover.tsx- Date detail popover with notestheme-provider.tsx- Dark/light theme managementmode-toggle.tsx- Theme switcher component
State Management
Better Home uses localStorage for all state persistence, avoiding external state management libraries.better-home-widget-settings- Widget visibility preferencesbetter-home-todos- Task list databetter-home-links- Quick links databetter-home-calendar-2026- Mood calendar entriesvite-ui-theme- Theme preference (light/dark/system)
Type System
All data structures are strictly typed:src/types/widget-settings.ts
src/types/todo.ts
src/types/calendar.ts
Path Aliases
The project uses@/ as a path alias for the src/ directory:
tsconfig.json and vite.config.ts for consistency.
Build Process
Development Build
Runningbun run dev starts the Vite dev server:
- Loads React with Fast Refresh via
@vitejs/plugin-react-swc - Processes Tailwind CSS via
@tailwindcss/vite - Resolves
@/path aliases - Serves on
http://localhost:5173
Production Build
Runningbun run build creates an optimized production bundle:
- Type checking:
tsc -bvalidates all TypeScript - Bundling: Vite bundles JavaScript, CSS, and assets
- Code splitting: Separates main and popup entry points
- Minification: Minifies JavaScript and CSS
- Asset optimization: Optimizes images and fonts
- Output: Generates
dist/folder ready for browser loading
Extension Manifest
Thepublic/manifest.json defines the extension structure:
Styling System
Tailwind CSS
Better Home uses Tailwind CSS 4 with a custom design system:- CSS variables for theme colors (light/dark mode)
- Utility classes for all styling
- Custom animations via
tw-animate-css - Motion animations for smooth transitions
Theme System
Themes are managed via theThemeProvider component:
- Supports light, dark, and system preferences
- Persists choice in localStorage
- Syncs across popup and main page via Chrome messaging
- Uses CSS class toggling (
light/darkon<html>)
Animation Strategy
Animations use the Motion library (formerly Framer Motion):- List item reordering with layout animations
- Smooth fade-in/out for modals and popovers
- Calendar mood transitions
- Today highlight pulse effect
Data Flow
- User interacts with a component (e.g., adds a task)
- Component calls hook’s setter (e.g.,
setTodos) - Hook updates localStorage and local state
- Storage event fires for cross-tab synchronization
- Other tabs/popup receive update and re-render