Skip to content

25microsaas/daily-affirmations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Daily Affirmations Chrome Extension

A mindful new tab experience that transforms your daily browsing with inspirational affirmations, beautiful backgrounds, and productivity features.

πŸš€ Quick Start

  1. Development Setup
# Install dependencies
npm install

# Build the extension
npm run build

# Watch for changes during development
npm run watch
  1. Load in Chrome
  • Open Chrome and go to chrome://extensions/
  • Enable "Developer mode" in the top right
  • Click "Load unpacked"
  • Select the chrome-extension directory

πŸ“ Project Structure

chrome-extension/
β”œβ”€β”€ js/                    # JavaScript modules
β”‚   β”œβ”€β”€ actions/          # User interaction handlers
β”‚   β”œβ”€β”€ components/       # UI components
β”‚   β”œβ”€β”€ modules/          # Core modules
β”‚   β”œβ”€β”€ services/         # Feature services
β”‚   └── utils/            # Utility functions
β”œβ”€β”€ css/                  # Stylesheets
β”‚   β”œβ”€β”€ fonts.css        # Font definitions
β”‚   β”œβ”€β”€ styles.css       # Main styles
β”‚   └── premium.css      # Premium feature styles
β”œβ”€β”€ fonts/               # Local font files
β”œβ”€β”€ images/              # Extension icons and assets
β”œβ”€β”€ newtab.html         # New tab page
β”œβ”€β”€ manifest.json       # Extension manifest
└── build.js           # Build script

πŸ› οΈ Features

Core Features

  • Daily Affirmations: Fresh inspirational quotes on each new tab
  • Weather Widget: Current weather with detailed information
  • Clock Widget: Time and date display
  • Focus Mode: Distraction-free interface
  • Theme Customization: Background themes and card styles

Premium Features

  • Custom Affirmations: Create and manage personal affirmations
  • Daily Reminders: Customizable notification schedules
  • Cloud Sync: Backup and sync across devices
  • Premium Backgrounds: Access to premium background collection
  • Advanced Focus Mode: Enhanced focus features

πŸ”§ Development

Building the Extension

The extension uses a custom build process:

# Production build
npm run build

# Development build with watch
npm run watch

Key Files

  • newtab.html: The main new tab page
  • js/app.js: Main application logic
  • js/services/: Individual feature services
  • manifest.json: Extension configuration

Adding New Features

  1. Create a new service in js/services/
  2. Add UI components in js/components/
  3. Register in app.js
  4. Update manifest if needed

πŸ”’ Security

  • API keys are managed securely through backend services
  • Sensitive data is encrypted before storage
  • Premium features are validated server-side

πŸ“¦ Building for Production

  1. Update version in manifest.json
  2. Build the extension:
npm run build
  1. ZIP the contents:
npm run package

πŸ§ͺ Testing

# Run all tests
npm test

# Run specific test suite
npm test -- --suite=premium

πŸ”„ State Management

The extension uses a custom state management system:

// Example state update
stateManager.updateSettings({
    showWeather: true,
    backgroundTheme: 'nature'
});

🎨 Styling

  • Uses CSS variables for theming
  • Supports multiple card styles (glass, solid, minimal)
  • Responsive design for different screen sizes

πŸ“ API Documentation

State Manager

stateManager.getSettings()
stateManager.updateSettings(newSettings)
stateManager.loadState()

Weather Service

weatherService.update()
weatherService.getWeather()

Background Service

backgroundService.update()
backgroundService.saveBackground()

πŸ› Debugging

  1. Open Chrome DevTools in the new tab
  2. Access debug console:
window.app.serviceStatus  // Check service status
window.app.cleanup       // Manual cleanup

πŸ“± Chrome API Usage

  • chrome.storage for data persistence
  • chrome.notifications for reminders
  • chrome.permissions for feature access

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details

πŸ†˜ Support

For issues and feature requests:

Releases

No releases published

Packages

 
 
 

Contributors