- Next.js 16.2 with App Router
- React 19.2 / React DOM 19.2
- TypeScript ~5.9
- Tailwind CSS 4.x with
@tailwindcss/postcss - Drizzle ORM + Drizzle Kit, using SQLite through better-sqlite3 or PostgreSQL through pg depending on the environment
- Redis 7.0
- Radix UI, Zod, react-hook-form, jose for JWT, and bcryptjs
- Local development: Node.js 20+
- Package manager: this repository primarily uses pnpm. npm or yarn may also work, but pnpm is the expected path.
- Optional: Docker. The image is based on Node.js 22; see the root
Dockerfile.
pnpm install
pnpm devOpen http://localhost:3000 in your browser.
To use activity reporting, pair this project with Waken-Wa-Reporter.
Copy .env.example to .env or .env.local, then fill in the values you need. Common variables:
DATABASE_URL— defaults to SQLite, for examplefile:./data/dev.db; usepostgres://orpostgresql://for production PostgreSQL.JWT_SECRET— signs admin sessions. If unset, it is generated automatically. In Docker, an empty value creates a persistent secret file at/app/data/.jwt_secret.NEXT_PUBLIC_BASE_URL— public site URL, useful behind a reverse proxy or in production.STEAM_API_KEY— optional Steam Web API key. It can also be configured from the admin panel under site settings.HCAPTCHA_*— optional site access lock configuration.
Avatar, nickname, bio, and related profile fields are configured from /admin site settings or during first-time setup.
Site settings have two storage layers:
- Legacy row:
site_configindrizzle/schema.sqlite.tsanddrizzle/schema.pg.ts. This exists for setup, old deployments, and compatibility reads. - Migrated/v2 storage:
site_config_v2_entriesfor core key/value settings, plus split tables for theme, schedule, and rule settings. Admin category routes write throughlib/site-settings-write.ts, and reads are composed inlib/site-settings-read.ts.
When adding a new site setting key:
- If the key is only meant for migrated settings, do not add a column to legacy
site_config. - Give old data a runtime default in
lib/site-config-normalize.ts, the admin form initial state, and the frontend consumer. - Add the key to
prepareSiteConfigValuesFromPayload()inlib/llm-site-config.tsso/api/admin/settings/corecan persist it. - If the key must not be editable before migration, add it to
SITE_SETTINGS_MIGRATED_CORE_KEYSinlib/site-settings-constants.ts;persistCoreSettingsFromPrepared()will reject it until migration is complete. - Keep import/export and API docs in sync when the setting is user-facing.
Only change both Drizzle schemas when adding real database structure or a field that must be persisted by the legacy table before migration.
pnpm build
pnpm start- Interactive API reference:
/api-reference - OpenAPI JSON:
/api/openapi.json - Device integration guide:
docs/activity-reporting.md - Inspiration integration guide:
docs/inspiration-integration.md