57 Commits

Author SHA1 Message Date
Michele
9eb0786bcc Fix: Google button hover text visibility
- Add btn-outline CSS class with explicit hover state
- Button outline variant now properly shows cream text on hover
- Add text-cream utility class

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:35:25 +01:00
Michele
933440f327 docs: Add design system and basePath troubleshooting to CLAUDE.md
- Document Editorial Fresh design system (fonts, colors, classes)
- Add basePath gotchas for middleware and email redirect
- Update phase 1 status with design system note

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:13:32 +01:00
Michele
afdec23a84 Redesign: Editorial Fresh design system
Complete visual overhaul with distinctive editorial aesthetic:

Design System:
- New fonts: Fraunces (display) + DM Sans (body)
- Color palette: Cream background, ink text, coral accents
- Custom CSS variables and utility classes
- Sharp edges (no rounded corners) for editorial feel

Components:
- Updated Button with new variants and colors
- Updated Input with editorial styling
- New card-editorial class with accent bar

Pages:
- Homepage: Full redesign with hero, features, CTA
- Auth layout: Split screen with branding side
- Login/Register: Editorial styling with tags
- Dashboard: Cards with accent bars
- Subscription: Clean feature comparison table

Typography:
- Fraunces for all headings (serif, characterful)
- DM Sans for body text (clean, readable)
- Editorial tags (uppercase, accent color)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 16:27:23 +01:00
Michele
09d1c39ec0 Fix metadata: title, description, lang
- Change title from 'Create Next App' to 'Leopost'
- Add proper Italian description
- Set html lang to 'it'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:04:29 +01:00
Michele
94ddfad909 Fix email confirmation redirect missing basePath
- Use NEXT_PUBLIC_APP_URL instead of window.location.origin
- Ensures email confirmation redirects to /leopost/auth/callback/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:23:16 +01:00
Michele
eb5b2cd42c Update UAT: all Phase 1 tests passing
- Test 6 (middleware redirect) now passes after fix
- 12/12 tests passing
- Phase 1 UAT complete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:03:51 +01:00
Michele
44fcd37366 Fix middleware redirect URLs missing basePath
- Use request.nextUrl.clone() instead of new URL() for redirects
- This preserves the /leopost basePath in redirect URLs
- Fixes 404 error when unauthenticated user visits /dashboard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:02:01 +01:00
Michele
2c2238548a test(01): complete UAT - 11 passed, 1 issue
Issue found:
- Middleware redirect missing basePath (redirects to /login/ instead of /leopost/login/)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:00:36 +01:00
Michele
64a4a5fcbc Add project documentation with deployment lessons learned
- Document nginx buffer configuration for Supabase Auth OAuth
- Document Next.js basePath/trailingSlash configuration
- Document middleware matcher best practices
- Add useful commands and current phase status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:13:25 +01:00
Michele
af3b007a3e Make OAuth URLs production-ready using NEXT_PUBLIC_APP_URL
- Remove hardcoded /leopost path from Google OAuth redirect
- Use environment variable for flexible deployment URL
- Fallback to window.location.origin for local development

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:46:06 +01:00
Michele
c561299ebd Fix OAuth callback: remove from middleware, fix redirect URLs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:39:52 +01:00
Michele
ccc509fac6 Fix Google OAuth redirect URL to include basePath
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:32:27 +01:00
Michele
1f6e0d8356 Fix middleware: only run on auth-related routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:25:30 +01:00
Michele
14ff7739e9 Fix middleware: skip homepage to prevent empty response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:22:05 +01:00
Michele
6d1c08dce4 Temporarily disable middleware for debugging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:19:52 +01:00
Michele
47e1682d44 Simplify homepage to static (debug SSR issue)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:16:37 +01:00
Michele
79f9d73af0 Fix redirect loop: add trailingSlash config
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:01:25 +01:00
Michele
73fa80da7c Add basePath for proper subpath deployment with nginx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:51:49 +01:00
Michele
9d4c13a13b Revert basePath - conflicts with nginx proxy strip
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:49:23 +01:00
Michele
fd1409dca7 Fix: add basePath for /leopost/ subpath deployment
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:47:00 +01:00
Michele
53407df43e Update config: deployment completed with Supabase
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:33:53 +01:00
Michele
7e38ce3c1c Increase memory limit to 1GB for Next.js build
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:31:21 +01:00
Michele
a1148a0a47 Fix: include devDependencies for TypeScript build
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:28:31 +01:00
Michele
8b84fae379 chore: add deployment configuration
- docker-compose.yml for VPS deployment
- deploy.sh for auto-updates
- Fixed package.json name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:25:01 +01:00
Michele
e58a79fd2c docs(phase-1): complete Foundation & Auth phase
- All 6 plans executed (4 waves)
- Verification: 5/5 must-haves verified
- Requirements AUTH-01, AUTH-02, AUTH-03 marked complete
- Phase 1 complete, ready for Phase 2

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-01-31 13:51:08 +01:00
Michele
04347bc9e8 docs(01-06): complete subscription management plan
Tasks completed: 3/3
- Task 1: Plan utilities and types
- Task 2: Plan card component and switch action
- Task 3: Subscription management page

PHASE 1 COMPLETE - Foundation & Auth finished
SUMMARY: .planning/phases/01-foundation-auth/01-06-SUMMARY.md
2026-01-31 13:44:40 +01:00
Michele
e4e04fa784 feat(01-06): add subscription management page
- Display all plans (Free, Creator, Pro) in card grid
- Highlight current plan with 'Piano attuale' badge
- Add feature comparison table
- Include FAQ section
- Show payment deferral notice
- All text in Italian
2026-01-31 13:43:29 +01:00
Michele
8789f26b36 feat(01-06): add plan card component and switch action
- Create switchPlan server action for plan changes
- Create getCurrentPlan utility function
- Build PlanCard component with feature display
- Handle plan switching with loading state
- Revalidate dashboard and subscription pages on change
2026-01-31 13:42:45 +01:00
Michele
7bdc6d3d0a feat(01-06): add plan types and utilities
- Add Plan and PlanFeatures TypeScript interfaces
- Add Profile type with plan relationship
- Create plan utility functions with Italian labels
- Add formatPrice, formatFeatureValue, getPlanBadgeColor helpers
2026-01-31 13:41:45 +01:00
Michele
8319679f7d docs(01-05): complete session middleware and dashboard plan
Tasks completed: 3/3
- Create middleware helper and main middleware
- Create protected dashboard layout and page
- Update home page to redirect appropriately

SUMMARY: .planning/phases/01-foundation-auth/01-05-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:39:30 +01:00
Michele
4c6ff1ab0f feat(01-05): update home page with auth-aware redirect
- Redirect authenticated users to dashboard
- Show landing page with value proposition for visitors
- Add clear CTAs for register and login
- Italian copy reflecting core product value

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:37:59 +01:00
Michele
af17f90d44 feat(01-05): add protected dashboard layout and page
- Create UserNav component with logout functionality
- Add dashboard layout with header, navigation, and user info
- Create dashboard page displaying plan info and onboarding steps
- All text in Italian for target audience

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:37:29 +01:00
Michele
6cfe58e96d feat(01-05): add middleware for session refresh and route protection
- Create updateSession helper for Supabase session management
- Add main middleware with protected and auth route handling
- Configure matcher to exclude static files for performance
- Session refresh on every request prevents random logouts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:36:36 +01:00
Michele
d5a69fd8c4 docs(01-03): document parallel execution completion
Email/password auth was implemented by 01-04 during parallel wave execution.
All must-haves verified present in codebase.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-01-31 13:33:57 +01:00
Michele
af1f5d6fc6 feat(01-03): add auth callback route for code exchange
- Handle OAuth and email verification callback
- Exchange code for session using Supabase SSR
- Redirect to next param or /dashboard on success
- Redirect to /login with error on failure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 06:16:07 +01:00
Michele
fc5e799212 docs(01-04): complete Google OAuth plan
Tasks completed: 3/3
- Create Google Sign-In button component
- Add Google button to login and register pages
- Document Google OAuth setup process

SUMMARY: .planning/phases/01-foundation-auth/01-04-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:25:40 +01:00
Michele
d1156c7a03 feat(01-03): add validation schemas and server actions
- Add Zod validation schemas for auth operations
- Add server actions for register, login, reset, update password
- Add clsx and tailwind-merge for class utilities
- Password validation: 8+ chars, 1 number, 1 uppercase
- Error messages in Italian per user requirement
- Specific error messages (not generic 'invalid credentials')

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:10:33 +01:00
Michele
bd0df408a5 docs(01-04): document Google OAuth setup process
- Step-by-step Google Cloud Console configuration
- Supabase Dashboard provider setup instructions
- Environment variables section
- Test integration checklist
- Troubleshooting guide for common errors
- Security notes and best practices
- Local vs production comparison table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:08:03 +01:00
Michele
dcbd7e8b46 feat(01-04): add Google button to login and register pages
- Add auth layout with centered card design
- Add Input component for form fields
- Add LoginForm component with email/password and validation
- Add RegisterForm component with password requirements
- Add login page with Google button + 'oppure' divider + email form
- Add register page with Google button + 'oppure' divider + email form
- Italian text throughout (Accedi, Registrati, oppure)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:07:24 +01:00
Michele
1d454d2fcb feat(01-04): create Google Sign-In button component
- Add cn() utility function for class name merging
- Add Button component with default/outline/ghost variants
- Add Card component with Header, Title, Description, Content, Footer
- Add GoogleSignInButton with signInWithOAuth for Google provider
- Italian text: 'Accedi con Google'
- Redirects to /auth/callback after consent

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:05:44 +01:00
Michele
0ef0e825a7 docs(01-01): complete Project Setup plan
Tasks completed: 3/3
- Task 1: Initialize Next.js 16 project with TypeScript and Tailwind
- Task 2: Configure environment variables for Supabase
- Task 3: Create dual Supabase client pattern

SUMMARY: .planning/phases/01-foundation-auth/01-01-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:01:32 +01:00
Michele
c5b22420ac feat(01-01): create dual Supabase client pattern for App Router
- src/lib/supabase/client.ts: Browser client for Client Components
  - Uses createBrowserClient from @supabase/ssr
  - Reads NEXT_PUBLIC_* env vars

- src/lib/supabase/server.ts: Server client for SSR/Actions
  - Uses createServerClient from @supabase/ssr
  - Async cookies() for Next.js 15+ compatibility
  - Cookie handlers for session management
  - Try/catch in setAll for Server Component safety

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:32:14 +01:00
Michele
ce0f4e37b4 feat(01-01): configure environment variables for Supabase
- .env.example template for required variables
- .env.local with placeholders (gitignored)
- NEXT_PUBLIC_SUPABASE_URL for API endpoint
- NEXT_PUBLIC_SUPABASE_ANON_KEY for client-side auth
- SUPABASE_SERVICE_ROLE_KEY for server-side operations
- NEXT_PUBLIC_APP_URL for callback URLs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:31:32 +01:00
Michele
32d234df62 feat(01-01): initialize Next.js 16 project with TypeScript and Tailwind
- Next.js 16.1.6 with App Router and src/ directory
- TypeScript configuration with path aliases (@/*)
- Tailwind CSS v4 with PostCSS setup
- ESLint with Next.js config
- Supabase packages: @supabase/supabase-js, @supabase/ssr
- Form packages: zod, react-hook-form
- Simple Leopost placeholder page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:31:01 +01:00
Michele
17ee4b4ccb docs(01-02): complete database schema plan
Tasks completed: 3/3
- Create database migration with plans and profiles
- Create seed file for development
- Document database schema

SUMMARY: .planning/phases/01-foundation-auth/01-02-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:29:35 +01:00
Michele
fd56b120b8 docs(01-02): document database schema and security
- Document plans and profiles tables with all columns
- Document RLS policies and performance notes
- Document helper functions with TypeScript examples
- Document triggers and migration options
- Include security notes and best practices

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:27:04 +01:00
Michele
16b3053aaf feat(01-02): add seed file for development verification
- Verify plans exist before seeding
- Log seed completion with NOTICE
- Minimal seed - plans created in migration, profiles via trigger

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:26:11 +01:00
Michele
f271d7fe7f feat(01-02): create database migration with plans and profiles
- Create plans table with Free, Creator, Pro tiers
- Create profiles table with tenant_id for multi-tenant isolation
- Enable RLS on both tables (security critical)
- Add auto-profile trigger on auth.users insert
- Add helper functions: get_user_plan_features, get_user_plan_name
- Add performance indexes on tenant_id, plan_id, email

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:25:48 +01:00
Michele
bfc5133683 docs(01): update roadmap with phase 1 plan details
- Added 6 plan checkboxes to Phase 1 section
- Updated progress table: 0/6 Planned
- Plans structured in 4 execution waves

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:13:19 +01:00
Michele
bd3e1074a8 docs(01): create phase 1 plans - Foundation & Auth
Phase 01: Foundation & Auth
- 6 plans in 4 execution waves
- Wave 1: Project setup (01) + Database schema (02) [parallel]
- Wave 2: Email/password auth (03) + Google OAuth (04) [parallel]
- Wave 3: Middleware & route protection (05)
- Wave 4: Subscription management UI (06)

Requirements covered: AUTH-01, AUTH-02, AUTH-03
Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:12:38 +01:00