Add multiple entries per day, user management, reminders, and AI reflections

- Multiple entries per day: Home page now starts fresh, Save & New button
- Admin user management: Add/delete users, reset passwords, toggle admin
- Daily reminders: Browser notifications at configurable time
- AI reflections: Generate insights from entries using Claude API
- Remove cloud sync placeholder (already have user accounts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gemini Agent
2026-01-24 12:05:39 +00:00
parent bd6703b24b
commit 504f07a106
21 changed files with 2104 additions and 96 deletions

View File

@@ -11,6 +11,7 @@ export interface AuthUser {
id: string;
email: string;
name: string | null;
isAdmin: boolean;
}
export async function hashPassword(password: string): Promise<string> {
@@ -68,6 +69,7 @@ export async function getSession(): Promise<AuthUser | null> {
userId: schema.users.id,
email: schema.users.email,
name: schema.users.name,
isAdmin: schema.users.isAdmin,
expiresAt: schema.sessions.expiresAt,
})
.from(schema.sessions)
@@ -83,6 +85,7 @@ export async function getSession(): Promise<AuthUser | null> {
id: result[0].userId,
email: result[0].email,
name: result[0].name,
isAdmin: result[0].isAdmin === 1,
};
}
@@ -122,6 +125,7 @@ export async function registerUser(
id: userId,
email: email.toLowerCase(),
name: name || null,
isAdmin: false,
},
};
}
@@ -154,6 +158,7 @@ export async function loginUser(
id: user.id,
email: user.email,
name: user.name,
isAdmin: user.isAdmin === 1,
},
sessionId,
};