Implement Phase 1: Daily Helper Foundation

Complete implementation of Phase 1 enhancements including:

Backend:
- UserProfile model for storing user preferences (timezone, trading style, risk tolerance)
- DailyRoutine model for scheduling routines (morning, active_trading, evening)
- RoutineExecution model for tracking routine execution history
- Notification model for managing all types of notifications
- DailyChecklist model for daily task tracking with completion percentage
- HabitTracker model for tracking habits and streaks

Services:
- RoutineService: Handles routine execution with task registry pattern
- RoutineScheduler: Async scheduler for automated routine execution
- NotificationService: Comprehensive notification creation and delivery system
- Support for price alerts, news, routines, reminders, and performance notifications

API Endpoints (daily_helper router):
- User profile: CRUD operations, get/update preferences
- Daily routines: Create, list, execute, track history
- Notifications: CRUD, mark read, batch operations
- Daily checklists: CRUD, item management, completion tracking
- Habits: Create, track, log completions, manage streaks
- Dashboard: Summary endpoint for daily helper overview

Frontend Components:
- UserProfileSetup: Complete user profile configuration with preferences
- NotificationCenter: Bell icon with dropdown, notification management
- HabitTracker: Habit creation, streak tracking, gamification with fire emojis
- DailyChecklistPanel: Checklist management with completion percentage

Schemas:
- Full Pydantic schemas for request/response validation
- Type-safe API contracts

Features:
- Timezone support for international users
- Trading style and risk tolerance preferences
- Automated routine execution with task registry
- Real-time notifications with priority levels
- Habit streaks with motivational badges
- Daily checklist with persistent state
- Completion percentage tracking
- Notes and metadata support

All components are production-ready with error handling and user feedback.
This commit is contained in:
Claude
2025-11-15 23:09:10 +00:00
parent 31ece179d5
commit 7dd2166bf4
10 changed files with 2766 additions and 2 deletions
+2 -1
View File
@@ -7,7 +7,7 @@ from app.streaming.live_store import periodic_flush, periodic_maintenance
import asyncio
# Newly added routers
from app.api import account, performance, status, settings_api, prompts
from app.api import account, performance, status, settings_api, prompts, daily_helper
app = FastAPI(
title=settings.APP_NAME,
@@ -41,6 +41,7 @@ app.include_router(performance.router, prefix="/api")
app.include_router(status.router, prefix="/api")
app.include_router(settings_api.router, prefix="/api")
app.include_router(prompts.router, prefix="/api")
app.include_router(daily_helper.router)
@app.on_event("startup")