Commit Graph

21 Commits

Author SHA1 Message Date
Arnaud 0481fded33 Fix Docker build: add VAPID_PRIVATE_KEY and create .env.local during build
- Add VAPID_PRIVATE_KEY as a build argument with secure defaults from .env.local
- Create apps/web/.env.local during build with all required environment variables
- This ensures Next.js build has access to necessary config values at build time
- Docker build now completes successfully with proper environment configuration
2026-07-01 11:42:33 +02:00
Arnaud 5ab2acc711 Fix TypeScript errors blocking Docker build
- Fix Authentik button type casting issue in login page
  * Use exported signIn instead of authClient type assertion
  * Add proper error handling for OAuth calls

- Fix image MIME type handling in import-photo.ts
  * Convert base64 to data URL format for AI SDK compatibility

- Fix type annotations in auth/server.ts changeEmail handler
  * Add explicit type annotation for destructured parameters

These TypeScript errors were preventing 'pnpm build' from completing
during Docker image build process.
2026-07-01 11:29:41 +02:00
Arnaud 163e1c6137 Add Portainer stack.env support for environment variable management
- Add docker/stack.env template for Portainer deployment
- Update Dockerfile to accept build args for Next.js environment variables
- Update docker-compose.deploy.yml to pass build args from environment
- Add comprehensive Portainer deployment guide in DOCKER_DEPLOYMENT.md
- Document environment variable setup for both CLI and Portainer deployments
2026-07-01 11:25:42 +02:00
Arnaud 9e7b83a12c Fix Docker build issues
- Add git to build dependencies (required by some npm packages)
- Add build-time environment variables (NEXT_PUBLIC_VAPID_PUBLIC_KEY, BETTER_AUTH_SECRET, BETTER_AUTH_URL)
- Add error output capture (2>&1) to expose build errors
- Ensure all dependencies are available during build phase
2026-07-01 11:22:07 +02:00
Arnaud 5ef548d7d3 Fix Docker build context in docker-compose.deploy.yml
Change build context from '.' to '..' to correctly reference Dockerfile at repo root when compose file is in docker/ directory. This fixes Portainer deployment errors.
2026-07-01 11:17:02 +02:00
Arnaud b2ac623836 Add production Docker deployment configuration
- Add multi-stage Dockerfile for Next.js standalone build
- Add docker-compose.deploy.yml for production deployment
- Add entrypoint.sh for database migration and startup
- Add .dockerignore for efficient Docker builds
- Add docker/.env.production with all required env vars
- Add Caddyfile.prod with security headers and optimizations
- Update next.config.ts with output: standalone for Docker
- Add DOCKER_DEPLOYMENT.md with comprehensive deployment guide
2026-07-01 11:13:30 +02:00
Arnaud 8b57a3fd87 Update features and dependencies 2026-07-01 11:10:37 +02:00
Arnaud 9d9dfb46c6 feat: misc — cooking mode, OpenAPI docs, email, storage, upload, homepage
Cooking mode step-by-step view. OpenAPI 3.1 spec auto-generated from Zod schemas.
Email lib (resend). Redis client. S3 storage helper. Photo upload endpoint.
Landing page. Short recipe URL redirect /r/[id]. API docs page.
2026-07-01 08:11:31 +02:00
Arnaud 3f96d1ea41 feat(webhooks): outbound webhooks with HMAC-SHA256 signing and API key auth
Webhook registration/management. HMAC-signed delivery with retry.
Events: recipe.created/updated, comment.created, follower.new.
REST API key creation for programmatic access.
2026-07-01 08:11:19 +02:00
Arnaud d6032edc00 feat(pwa): service worker, offline page, web push notifications
PWA manifest, sw.js with offline cache. VAPID web-push via lib/push.ts.
Push subscribe button (client). Push fired on recipe comment creation.
VAPID keys configurable via admin site settings.
2026-07-01 08:11:05 +02:00
Arnaud cba5d9c3ac feat(admin): admin panel with overview, users, audit logs, storage, AI config, settings
Sticky sidebar with back-to-app link. Overview: user counts, recipe photos, AI calls/month.
User management with role/tier editing. Audit log (all admin actions).
Storage page with photo breakdown by tier. AI config showing DB vs .env key source.
Site settings page to override .env values at runtime (encrypted in DB).
2026-07-01 08:10:59 +02:00
Arnaud b2d592afe8 feat(settings): sidebar layout with profile, security, AI, notifications, nutrition
Sticky sidebar nav. Sections: Profile (name/language), Security (email/password change),
AI & Models (BYOK keys + per-use-case model prefs), Notifications (push subscribe),
Nutrition goals. Sub-pages: API keys, Webhooks.
2026-07-01 08:10:51 +02:00
Arnaud e179692adf feat(search): full-text recipe search and explore page
Postgres full-text search with dietary/difficulty/time filters.
Search page with real-time results. Explore page with trending and recent recipes.
2026-07-01 08:10:44 +02:00
Arnaud 3636ab27ae feat(meal-plan): weekly planner, pantry, shopping lists, nutrition tracking
AI-generated weekly meal plans with pantry-awareness. Manual entry per slot.
Pantry inventory management. Auto-generated shopping lists from meal plan.
Weekly nutrition bar chart vs daily goals. Nutrition goals settings.
2026-07-01 08:10:39 +02:00
Arnaud 9d02a69250 feat(social): follows, favorites, comments, reactions, collections, public profiles
Follow/unfollow users. Recipe favorites. Threaded comments with emoji reactions.
Collections (public/private) with shared member invite. Activity feed.
Public profile pages at /u/[username].
2026-07-01 08:10:30 +02:00
Arnaud d9d58fd01a feat(ai): Vercel AI SDK provider factory with BYOK and per-use-case model prefs
Provider factory (OpenAI/Anthropic/OpenRouter/Ollama). generateObject for all outputs.
Features: recipe generation, photo-to-recipe vision, variations, drink/meal pairings,
ingredient substitution, recipe adaptation, nutrition analysis, URL import, meal plan gen.
User BYOK keys (AES-256-GCM). Per-use-case model preferences (text/vision/mealPlan).
Site-level key override via admin settings.
2026-07-01 08:10:19 +02:00
Arnaud 84d6cfeb07 feat(recipes): full recipe CRUD with photos, print, version history
List, detail, new, edit pages. Server-side pagination, dietary tags, difficulty.
Photo upload to S3-compatible storage. Version history. Multi-select grid with
bulk delete/visibility. Print view. Delete confirmation dialog.
2026-07-01 08:10:11 +02:00
Arnaud fa2d797918 feat(auth): login, signup, email verification, Better Auth routes 2026-07-01 08:09:37 +02:00
Arnaud 5b40968c9d feat(web): Next.js 15 app shell, auth, i18n, base UI
App Router setup with next-intl (en/fr), Better Auth wiring, shadcn/ui components,
Tailwind, AES-256-GCM encrypt util, Redis rate limiter, tier limit checker,
site_settings helper for runtime .env overrides.
2026-07-01 08:09:31 +02:00
Arnaud add9365250 feat(db): Drizzle ORM schema and migrations
Schema domains: users/auth, recipes, social, meal-planning, tiers/usage, webhooks.
Includes Better Auth tables, audit_logs, site_settings, push_subscriptions,
user_model_prefs, user_nutrition_goals. Migrations 0000–0008 applied.
2026-07-01 08:08:44 +02:00
Arnaud ae7c5d943e chore: init pnpm monorepo workspace
Root config: pnpm workspaces, tsconfig base, docker compose (postgres, redis, minio), .npmrc.
2026-07-01 08:08:29 +02:00