/* @component-map * App — Main container, tab navigation [app.jsx] * HabitList — Habit management and daily check-offs [components/HabitList.jsx] * Heatmap — GitHub-style heatmap calendar [components/Heatmap.jsx] * StreakStats — Current and longest streak display [components/StreakStats.jsx] * AddHabitModal — Modal for adding/editing habits [components/AddHabitModal.jsx] * @end-component-map */ // DEPLOY_CONFIG: {"cron": [{"name": "habit_completion_notification_check", "schedule": "0 20 * * *", "action": "event", "config": {"event_type": "check_habit_completions_for_notifications"}}, {"name": "weekly_habit_encouragement_generation", "schedule": "0 9 * * 1", "action": "event", "config": {"event_type": "generate_weekly_habit_encouragement"}}], "triggers": [{"name": "store_habit_notification_on_missed_completion", "on": "collection.add", "collection": "habit_notifications", "actions": [{"type": "broadcast", "channel": "habit_notifications", "event": "notification_created"}]}, {"name": "deliver_weekly_habit_encouragement_email", "on": "collection.add", "collection": "weekly_habit_encouragements", "actions": [{"type": "email", "to": "{{data.user_email}}", "subject": "Your weekly habit encouragement", "body": "{{data.email_body}}"}, {"type": "broadcast", "channel": "weekly_habit_encouragements", "event": "encouragement_created"}]}], "secrets": {"ai_provider_api_key": "SET_IN_DEPLOY_ENV", "ai_provider_base_url": "SET_IN_DEPLOY_ENV", "email_provider_api_key": "SET_IN_DEPLOY_ENV", "email_from_address": "SET_IN_DEPLOY_ENV"}} import { useEffect, useState } from 'react'; import { useAuth, useCollection } from '@deplixo/sdk'; import { HabitList } from './components/HabitList.jsx'; import { Heatmap } from './components/Heatmap.jsx'; import { StreakStats } from './components/StreakStats.jsx'; import { AddHabitModal } from './components/AddHabitModal.jsx'; function App() { const { user, loading, login, logout } = useAuth(); const [activeTab, setActiveTab] = useState('today'); const [showAddModal, setShowAddModal] = useState(false); const [selectedHabitId, setSelectedHabitId] = useState(null); const habits = useCollection('habits', { personal: true }); const completions = useCollection('completions', { personal: true }); useEffect(() => { if (!loading && user && !selectedHabitId && habits.items?.length) { setSelectedHabitId(habits.items[0].id); } }, [loading, user, habits.items, selectedHabitId]); if (loading) { return
; } if (!user) { return (

Habit Forge

Shape your days, one habit at a time

Sign in to access your personal habits

Use Google authentication to save and sync your habits, streaks, and heatmap across devices.

); } const tabs = [ { id: 'today', label: 'Today', icon: '✓' }, { id: 'heatmap', label: 'Heatmap', icon: '🟩' }, { id: 'streaks', label: 'Streaks', icon: '🔥' } ]; return (

Habit Forge

Shape your days, one habit at a time

{user.avatar ? {user.name} :
{user.name?.[0] || 'U'}
}
{user.name} {user.email}
{activeTab === 'today' && setShowAddModal(true)} onSelectHabit={setSelectedHabitId} />} {activeTab === 'heatmap' && } {activeTab === 'streaks' && }
{showAddModal && setShowAddModal(false)} />}
); } ReactDOM.createRoot(document.getElementById('root')).render();