LifeRPG_v2.0/modern/docs/hooks.md
TLimoges33 7fe4ae5365
🧙‍♂️ Transform LifeRPG into The Wizard's Grimoire - Production-Ready Application
 Major Features Added:
- Complete magical theming and rebranding from LifeRPG to The Wizard's Grimoire
- Production-grade React frontend with Tailwind CSS v4 and magical aesthetics
- Comprehensive analytics dashboard with Recharts integration (ScryingPortal)
- Push notifications system with PWA service worker support
- Drag & drop functionality using @dnd-kit for habit reordering
- Social features with friends system and leaderboards
- Performance optimization tools and monitoring
- Mobile app enhancement with PWA installation support

🏗️ Technical Infrastructure:
- Advanced service worker with offline support and background sync
- Zustand state management for scalable application state
- Production-ready UI component system with enhanced Button, Card, Input
- Progressive Web App (PWA) with manifest and app installation
- FastAPI backend with comprehensive API endpoints
- Docker containerization and CI/CD pipeline setup

📱 Progressive Web App Features:
- Offline functionality with intelligent caching
- Push notification support for habit reminders
- App installation on mobile and desktop platforms
- Background sync for offline data management
- Performance monitoring and optimization tools

🎨 User Experience:
- Magical wizard/grimoire theming throughout application
- Responsive design optimized for all device sizes
- Drag & drop habit management with smooth animations
- Interactive analytics with multiple chart types
- Social connectivity with friends and competitive features
- Comprehensive notification and performance settings

🔧 Developer Experience:
- Modern development stack with Vite and React
- Comprehensive testing setup and CI/CD pipelines
- Code quality tools with pre-commit hooks
- Docker development environment
- Detailed documentation and implementation guides

This represents a complete transformation from prototype to production-ready application with enterprise-grade features and magical user experience.
2025-08-30 17:32:42 +00:00

1.5 KiB

Hooks configuration

You can configure pre- and post-sync hooks per integration via Integration.config.hooks.

Config shape (stored as JSON in integrations.config):

{
  "hooks": {
    "pre_sync": [
      { "type": "slack", "text": "Sync starting for {provider}" },
      { "type": "webhook", "url": "https://example.com/hook", "template": "{provider} sync started" }
    ],
    "post_sync": [
      { "type": "slack", "on": "success" },
      { "type": "slack", "on": "fail" },
      { "type": "email", "to": "ops@example.com", "subject": "Sync {event}", "body": "{provider} finished with count={count}" },
      { "type": "webhook", "url": "https://example.com/notify", "headers": {"X-Token": "abc"}, "template": "{provider} done: {count}" }
    ]
  }
}

Notes:

  • pre_sync runs before adapter execution.
  • post_sync supports on: success, fail, or always (default).
  • Slack hook reuses the Slack notifier. Add a Slack integration with an incoming webhook for messages to deliver.
  • Webhook hook posts JSON to the given url. If template is provided, {context} values are formatted into a text field.
  • Email hook uses the notifier email transport. See docs/email.md.

Context variables available to templates:

  • provider: provider name (e.g., todoist)
  • count: items processed (when available)

Caveats:

  • Hooks execute best-effort. Failures are logged and do not block the sync.
  • Keep templates simple; invalid placeholders are ignored and the raw context is sent.