Commit Graph

10 Commits

Author SHA1 Message Date
Claude
7be84681f0 fix: login redirect with Suspense boundary + read redirect query param
- Wrap useSearchParams() in Suspense boundary (Next.js requirement)
- Read ?redirect= query param for post-login redirect to /admin
- Auto-detect admin users and redirect to /admin
- Fallback to /dashboard for regular users

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
2026-02-10 17:03:51 +00:00
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
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
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