de6ce0c350
- Added support for encrypted coach chats with a new `coach_chats` collection in the Appwrite database. - Updated `.env.example` to include `OLLAMA_API_KEY`, `OLLAMA_MODEL`, and `APPWRITE_API_KEY` for server-side configurations. - Introduced a setup script in `package.json` for initializing Appwrite database tables. - Enhanced the Vite configuration to proxy requests to the Ollama API. - Updated the main application structure to accommodate new chat features and improved theme management. - Refined CSS styles for better UI consistency and added new components for chat functionality.
77 lines
1.4 KiB
TypeScript
77 lines
1.4 KiB
TypeScript
export type BuiltInSize = 250 | 355 | 473;
|
|
|
|
export type RedBullEntry = {
|
|
id: string;
|
|
userId: string;
|
|
cans: number;
|
|
flavour: string;
|
|
flavourAccent: string;
|
|
sizeMl: number;
|
|
pricePerCan: number;
|
|
dateTime: string;
|
|
notes?: string;
|
|
store?: string;
|
|
sugarFree: boolean;
|
|
caffeineMgPerCan?: number;
|
|
importKey: string;
|
|
source: "manual" | "quick-add" | "excel" | "json";
|
|
createdAt?: string;
|
|
updatedAt?: string;
|
|
};
|
|
|
|
export type Flavour = {
|
|
name: string;
|
|
accent: string;
|
|
sugarFree?: boolean;
|
|
};
|
|
|
|
export type DateFilter = "all" | "today" | "week" | "month" | "custom";
|
|
|
|
export type EntryDraft = Omit<
|
|
RedBullEntry,
|
|
"id" | "userId" | "importKey" | "source" | "createdAt" | "updatedAt"
|
|
> & {
|
|
source?: RedBullEntry["source"];
|
|
};
|
|
|
|
export type Filters = {
|
|
flavour: string;
|
|
dateRange: DateFilter;
|
|
store: string;
|
|
from: string;
|
|
to: string;
|
|
};
|
|
|
|
export type ImportPreviewRow = {
|
|
rowNumber: number;
|
|
entry?: EntryDraft;
|
|
errors: string[];
|
|
duplicate: boolean;
|
|
duplicateReason?: string;
|
|
};
|
|
|
|
export type ImportPreview = {
|
|
fileName: string;
|
|
rows: ImportPreviewRow[];
|
|
};
|
|
|
|
export type ChatRole = "user" | "assistant";
|
|
|
|
export type CoachMessage = {
|
|
id: string;
|
|
role: ChatRole;
|
|
content: string;
|
|
thinking?: string;
|
|
pending?: boolean;
|
|
stopped?: boolean;
|
|
};
|
|
|
|
export type CoachChat = {
|
|
id: string;
|
|
userId: string;
|
|
title: string;
|
|
messages: CoachMessage[];
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
};
|