feat: guided light meditation + Edge TTS neural voice audio
- Add continuous guided light-body-scan meditation (16 segments, 97% coverage) - Edge TTS API endpoint with Xiaoxiao neural voice at -40% rate - Pre-generated chime WAVs and guidance MP3s in public/audio/ - Mute toggle in practice page, sequenced non-overlapping audio - Fix middleware to serve /audio and /api/audio/tts without auth - All LLM output localized to Chinese; fix blank home/settings pages - DeepSeek API compat: json_object, increased max_tokens - Analytics, cron reminders, onboarding flow fixes Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
00db3f6c96
commit
6530b20172
@@ -0,0 +1,21 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
type EventName = "session_completed" | "task_generated" | "onboarding_completed";
|
||||
|
||||
export async function logEvent(
|
||||
userId: string,
|
||||
event: EventName,
|
||||
metadata: Record<string, unknown> = {}
|
||||
): Promise<void> {
|
||||
try {
|
||||
await prisma.analyticsEvent.create({
|
||||
data: {
|
||||
userId,
|
||||
event,
|
||||
metadata: JSON.stringify(metadata),
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("[analytics] Failed to log event:", event, err);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user