|
@@ -4,13 +4,14 @@ A SvelteKit 5 + Tailwind frontend with i18n (Paraglide) and dark mode enabled by
|
|
|
|
|
|
|
|
## Project Overview
|
|
## Project Overview
|
|
|
|
|
|
|
|
-- **Framework**: SvelteKit 2.63.0 with Svelte 5 (runes mode, mandatory)
|
|
|
|
|
-- **Build Tool**: Vite 8.0.16
|
|
|
|
|
|
|
+- **Framework**: SvelteKit 2.68.0 with Svelte 5.56.4 (runes mode, mandatory)
|
|
|
|
|
+- **Build Tool**: Vite 8.1.2
|
|
|
- **Styling**: Tailwind CSS 4.3.0 (via `@tailwindcss/vite`, no separate config)
|
|
- **Styling**: Tailwind CSS 4.3.0 (via `@tailwindcss/vite`, no separate config)
|
|
|
- **Components**: Flowbite Svelte 1.33.1 + Flowbite Icons
|
|
- **Components**: Flowbite Svelte 1.33.1 + Flowbite Icons
|
|
|
- **i18n**: Paraglide JS (English + Spanish, auto-localized routes)
|
|
- **i18n**: Paraglide JS (English + Spanish, auto-localized routes)
|
|
|
- **Adapter**: `@sveltejs/adapter-node` (Node.js deployments)
|
|
- **Adapter**: `@sveltejs/adapter-node` (Node.js deployments)
|
|
|
-- **Package Manager**: pnpm
|
|
|
|
|
|
|
+- **Package Manager**: pnpm (>=11.9 required)
|
|
|
|
|
+- **Node**: >=24.14 required
|
|
|
- **Type System**: JavaScript (JSConfig, no TypeScript enforcement)
|
|
- **Type System**: JavaScript (JSConfig, no TypeScript enforcement)
|
|
|
|
|
|
|
|
## Critical Commands
|
|
## Critical Commands
|
|
@@ -128,8 +129,8 @@ runes: ({ filename }) =>
|
|
|
## Git & Workflow
|
|
## Git & Workflow
|
|
|
|
|
|
|
|
- **Branch**: master
|
|
- **Branch**: master
|
|
|
-- **Recent commits**: 14 commits total (backend infrastructure: SQLite3, Argon2id, config management, graceful shutdown)
|
|
|
|
|
-- **Current state**: 6 files staged for commit (crypto, database setup, config changes)
|
|
|
|
|
|
|
+- **Recent commits**: 15 commits total (backend infrastructure: SQLite3, Argon2id, config management, graceful shutdown, Docker support)
|
|
|
|
|
+- **Current state**: 3 files modified/untracked (Dockerfile, .dockerignore, README.md updates)
|
|
|
|
|
|
|
|
**Convention**: Clear, atomic commits. Prefix context: "feat:", "fix:", "docs:", "refactor:" when possible.
|
|
**Convention**: Clear, atomic commits. Prefix context: "feat:", "fix:", "docs:", "refactor:" when possible.
|
|
|
|
|
|
|
@@ -143,6 +144,8 @@ runes: ({ filename }) =>
|
|
|
|
|
|
|
|
4. **Config must exist**: Application crashes at startup if `config.json` is missing. Always ensure it's copied from `config.json.example` before running dev/build.
|
|
4. **Config must exist**: Application crashes at startup if `config.json` is missing. Always ensure it's copied from `config.json.example` before running dev/build.
|
|
|
|
|
|
|
|
|
|
+5. **pnpm-workspace.yaml native builds**: Specifies which native packages can be built (esbuild, Tailwind Oxide, better-sqlite3 enabled; argon2 disabled). If native deps fail to build, check this file first.
|
|
|
|
|
+
|
|
|
## Common Agent Tasks & Gotchas
|
|
## Common Agent Tasks & Gotchas
|
|
|
|
|
|
|
|
### Adding Components
|
|
### Adding Components
|
|
@@ -186,7 +189,8 @@ cp config.json.example config.json
|
|
|
- **Lazy initialization**: Database is created on first `getSqlite3()` call
|
|
- **Lazy initialization**: Database is created on first `getSqlite3()` call
|
|
|
- **Schema**: `users` table auto-created with `id`, `email`, `password`, `created_at`, `updated_at`
|
|
- **Schema**: `users` table auto-created with `id`, `email`, `password`, `created_at`, `updated_at`
|
|
|
- **Admin seeding**: If no users exist, `admin@delete.me` / `deleteme` is inserted (hashed with Argon2id)
|
|
- **Admin seeding**: If no users exist, `admin@delete.me` / `deleteme` is inserted (hashed with Argon2id)
|
|
|
-- **Path**: `/data/app.db` (relative to project root, directory auto-created if missing)
|
|
|
|
|
|
|
+- **Path**: `data/app.db` (relative to project root, constructed from config.json `filename` + `PROJECT_ROOT/data/`, directory auto-created if missing)
|
|
|
|
|
+- **WAL Mode**: Enabled by default in config for better concurrency
|
|
|
|
|
|
|
|
**Idempotent**: Safe to call multiple times; schema and admin user only created once.
|
|
**Idempotent**: Safe to call multiple times; schema and admin user only created once.
|
|
|
|
|
|
|
@@ -218,6 +222,18 @@ Database connection is properly closed on process termination (SIGTERM, SIGINT)
|
|
|
- **Tailwind CSS**: https://tailwindcss.com/docs
|
|
- **Tailwind CSS**: https://tailwindcss.com/docs
|
|
|
- **Svelte 5 Runes**: https://svelte.dev/docs/svelte/what-are-runes
|
|
- **Svelte 5 Runes**: https://svelte.dev/docs/svelte/what-are-runes
|
|
|
|
|
|
|
|
|
|
+## Docker & Deployment Quirks
|
|
|
|
|
+
|
|
|
|
|
+### Database Path in Docker
|
|
|
|
|
+
|
|
|
|
|
+When using `docker run` or `docker-compose`, the config is mounted at `/opt/app/server/config.json`. The database path `data/app.db` is then resolved **relative to the working directory inside the container**, which is typically `/opt/app/`. Ensure volume mounts for `./data` are in place to persist the database across restarts.
|
|
|
|
|
+
|
|
|
|
|
+### Native Dependencies in Docker
|
|
|
|
|
+
|
|
|
|
|
+The Dockerfile uses Node.js 24 Alpine. Native packages (better-sqlite3, argon2) must build in the Alpine environment. If builds fail, check:
|
|
|
|
|
+- Alpine headers are installed (usually handled in Dockerfile)
|
|
|
|
|
+- `pnpm-workspace.yaml` allowlist is current
|
|
|
|
|
+
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
-**Last Updated**: Verified against current project state (14 commits, backend infrastructure added, i18n enabled, clean build)
|
|
|
|
|
|
|
+**Last Updated**: Verified against current project state (15 commits, Docker support added, SvelteKit 2.68.0, Vite 8.1.2, pnpm-workspace.yaml quirks documented)
|