v0.1.1: System default AI config, configurable URLs, single .env, website refactor

This commit is contained in:
lotherk
2026-03-27 13:51:15 +00:00
parent 749a913309
commit f6c4da1da3
23 changed files with 486 additions and 180 deletions

View File

@@ -78,6 +78,12 @@ id, userId, date, type, content, mediaPath, metadata, latitude, longitude, place
- Location is captured automatically from browser geolocation when creating events
- Reverse geocoding via OpenStreetMap Nominatim API provides place names
### Settings Model
```
userId, aiProvider, aiApiKey, aiModel, aiBaseUrl, journalPrompt, language, timezone, providerSettings, journalContextDays, useSystemDefault
```
- `useSystemDefault`: When true, user uses system-default AI settings from environment variables
## API Design
All endpoints return: `{ data: T | null, error: { code, message } | null }`
@@ -146,6 +152,18 @@ AI is configured to return JSON with `response_format: { type: "json_object" }`
### Provider Settings Storage
Settings stored as `providerSettings: { "groq": { apiKey, model, baseUrl }, ... }` with `aiProvider` determining which is active.
### System Default AI Configuration
Administrators can configure default AI settings via environment variables that apply to all new users:
```
BACKEND_DEFAULT_AI_PROVIDER="groq"
BACKEND_DEFAULT_AI_MODEL="llama-3.3-70b-versatile"
BACKEND_DEFAULT_AI_API_KEY=""
BACKEND_DEFAULT_AI_BASE_URL=""
```
- New users automatically use system defaults (`useSystemDefault: true`)
- Users can override with their own settings by unchecking "Use system default settings"
- When `useSystemDefault` is true, the system ignores user's individual AI settings and uses env defaults
## Coding Guidelines
### TypeScript
@@ -206,6 +224,7 @@ bun run test:server
Tests require the server running. The test script starts the server, runs tests, then stops it.
## Version History
- 0.1.1: System default AI configuration via env vars, "Use system default" checkbox in settings
- 0.1.0: Automatic geolocation capture, Starlight documentation site
- 0.0.6: Automatic geolocation capture on event creation, reverse geocoding to place names
- 0.0.5: Export/Import feature with version checking