Files
loki/package.json
T
g-butandClaude Sonnet 4.6 70d1d6def4 feat(packaging): self-hosted distribution foundation
First-run flow:
- /setup page + /api/setup: creates first user with hashed password
  (Node crypto scrypt, no new deps). POST rejects if users already exist.
- Landing page redirects to /setup when DB has no users
- middleware.ts: protects app routes, passes public pages through

Auth:
- passwordHash column added to users schema (drizzle-kit push applied)
- src/lib/password.ts: hashPassword/verifyPassword via Node scrypt
- auth.ts Credentials: env var takes priority, falls back to DB hash
  so packaged installs work without LOCAL_AUTH_PASSWORD

Multi-tenancy groundwork:
- Replaced DEFAULT_USER_ID with getCurrentUserId() across all 12 API
  route files (people, subscriptions, events, goals, projects, commitments)

Docker:
- Dockerfile: multi-stage Node 22 alpine, standalone output
- docker-compose.yml: postgres + migrate + app services
- .dockerignore, .env.example with documented required vars
- next.config.ts: output: standalone
- package.json: added migrate script (drizzle-kit push)
- tsconfig.json: scope to src/ only, exclude .next generated files

Install: clone → cp .env.example .env.local → docker-compose up
First visit → /setup → create account → sign in → done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:46:07 +02:00

49 lines
1.2 KiB
JSON

{
"name": "cockpit",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"migrate": "drizzle-kit push",
"lint": "eslint",
"smoke": "bash scripts/smoke.sh",
"prepare": "husky"
},
"dependencies": {
"@auth/drizzle-adapter": "^1.11.2",
"@base-ui/react": "^1.3.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"drizzle-orm": "^0.45.2",
"lucide-react": "^1.7.0",
"next": "16.2.4",
"next-auth": "^5.0.0-beta.31",
"next-themes": "^0.4.6",
"postgres": "^3.4.8",
"react": "19.2.4",
"react-dom": "19.2.4",
"shadcn": "^4.1.2",
"tailwind-merge": "^3.5.0",
"tw-animate-css": "^1.4.0",
"zod": "^4.3.6"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"better-sqlite3": "^12.8.0",
"drizzle-kit": "^0.31.10",
"eslint": "^9",
"eslint-config-next": "16.2.4",
"husky": "^9.1.7",
"tailwindcss": "^4",
"tsx": "^4.21.0",
"typescript": "^5"
}
}