64 Commits

Author SHA1 Message Date
Claude
9ae7dd2d2d feat: add admin setup page and login redirect for admins
- Add /setup-admin page for first-time admin account creation
- Add /api/admin/setup route (only works when no admin exists)
- Update login to redirect admins to /admin instead of /dashboard
- Setup page creates auth user + profile with is_admin=true

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-10 13:33:52 +00:00
Claude
1d0bd349fd feat: secure admin panel with Supabase auth + course management CRUD
- Replace ADMIN_SECRET query param with proper Supabase auth + is_admin flag
- Add admin layout with auth check (redirects non-admin to /)
- Add AdminShell component with sidebar navigation (Dashboard, Candidatures, Cours)
- Add admin dashboard with stats (candidatures, users, modules)
- Add admin candidatures page with filters and approve/reject
- Add admin course management page (create, edit, delete, publish/unpublish)
- Add API routes: GET/POST /api/admin/modules, GET/PUT/DELETE /api/admin/modules/[id]
- Add verifyAdmin() helper for API route protection
- Update database types with is_admin on profiles

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-10 13:25:58 +00:00
Claude
c4934f5669 feat: add admin panel to manage candidatures and approve with Stripe link
- /admin page with secret-key authentication
- List all candidatures with details (expandable cards)
- Approve: updates status + generates Stripe checkout URL + sends email
- Reject: updates status
- Checkout URL displayed on screen for manual copy if Resend not configured
- Protected by ADMIN_SECRET env var

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-09 19:39:33 +00:00
Claude
db51e21075 fix: configure admin client with service role options and better error logging
- Add auth options (autoRefreshToken: false, persistSession: false) to
  createAdminClient so service role key works correctly with supabase-js
- Return actual Supabase error message in candidature API for debugging

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-09 18:52:45 +00:00
Claude
231667c2c6 feat: fix accents, improve candidature API, add legal pages
- Fix all missing French accents across 16 files (é, è, ê, à, ô, ç)
- Improve candidature API error handling: check env vars, better messages
- Add Mentions légales page (/mentions-legales)
- Add CGV page (/cgv)
- Add Politique de confidentialité page (/confidentialite)
- Business info: Enguerrand Ozano, SIREN 994538932, TVA FR16994538932

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 20:49:54 +00:00
Claude
dd6ec0816b fix: add vercel.json to force Next.js framework detection
Vercel may not be detecting the Next.js framework correctly,
causing 404 on all routes. Explicit configuration should fix this.

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 20:26:41 +00:00
Claude
5ffb4fe32e fix: remove @supabase/ssr entirely to fix MIDDLEWARE_INVOCATION_FAILED
@supabase/ssr uses __dirname internally which crashes in Vercel's Edge
runtime, causing MIDDLEWARE_INVOCATION_FAILED even without a middleware
file. Replaced with @supabase/supabase-js directly:
- Server client: manual cookie-based session restoration
- Browser client: direct createClient from supabase-js
- Admin client: already using supabase-js

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 19:30:07 +00:00
Claude
ee6870d73e fix: resolve __dirname error by forcing Node.js runtime on all server routes
- Add serverExternalPackages for @supabase/ssr in next.config.ts
- Add export const runtime = 'nodejs' to all pages/routes using Supabase
- Replace createAdminClient to use @supabase/supabase-js directly (no SSR)
- Prevents @supabase/ssr from running in Edge runtime on Vercel

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 19:08:32 +00:00
Claude
d713f7f5ef fix: downgrade Next.js 16 to 15 for Vercel deployment compatibility
Next.js 16.1.6 is not yet fully supported by Vercel's build system,
causing 404 on all routes. Downgraded to Next.js 15.5.12 + React 18,
fixed ESLint config, TypeScript config, and lint errors.

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 14:28:57 +00:00
Claude
5514af9555 fix: remove middleware and route groups to fix Vercel deployment
- Remove middleware.ts entirely (caused __dirname ReferenceError in Edge)
- Auth protection handled by dashboard layout.tsx (server-side redirect)
- Move pages out of (marketing) and (auth) route groups to fix 404 on /
- Keep (protected) route group for dashboard/formations/profil shared layout

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 14:17:09 +00:00
Claude
7a5871d344 fix: add error handling to middleware to prevent INVOCATION_FAILED
- Check if Supabase env vars are configured before using them
- Wrap Supabase auth call in try/catch to prevent 500 crashes
- Graceful fallback: pass through on error instead of crashing

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 14:06:42 +00:00
Claude
c9ff180959 fix: inline Supabase middleware to fix Vercel Edge resolution
The @/ path alias was not resolved in Vercel's Edge Function bundler,
causing "unsupported modules" error. Inlined the middleware logic
directly to avoid the import.

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 14:01:32 +00:00
Claude
41e686c560 feat: complete HookLab MVP - TikTok Shop coaching platform
Full-stack Next.js 15 application with:
- Landing page with marketing components (Hero, Testimonials, Pricing, FAQ)
- Multi-step candidature form with API route
- Stripe Checkout integration (subscription + webhooks)
- Supabase Auth (login/register) with middleware protection
- Dashboard with progress tracking and module system
- Formations pages with completion tracking
- Profile management with password change
- Database schema with RLS policies
- Resend email integration for transactional emails

Stack: Next.js 15, TypeScript, Tailwind CSS v4, Supabase, Stripe, Resend

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-08 12:39:18 +00:00
240b10b2d7 Initial commit 2026-02-08 10:45:15 +01:00