Commit Graph

45 Commits

Author SHA1 Message Date
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
Michele
6a969bccc8 docs(phase-1): research authentication and multi-tenancy domain
Phase 1: Foundation & Auth
- Standard stack identified (Supabase Auth + @supabase/ssr)
- Architecture patterns documented (dual-client, RLS, middleware)
- Subscription schema researched (plans table + JSONB features)
- 7 common pitfalls catalogued (missing RLS, session expiry, etc.)
- Code examples verified from official Supabase docs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-31 02:57:28 +01:00
Michele
619353d9da docs(01): capture phase context
Phase 01: Foundation & Auth
- Email verification mandatory
- Password: medium strength (8+, 1 num, 1 upper)
- Specific error messages (not generic)
- New device login notification
- Password reset via email link

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 02:46:16 +01:00
Michele
7c1ca40047 docs: create roadmap (10 phases)
Phases:
1. Foundation & Auth: AUTH-01, AUTH-02, AUTH-03
2. Social Platform Integration: AUTH-04
3. Onboarding & Context: ONBR-01, ONBR-02
4. AI Chat Interface: CHAT-01, CHAT-02, CHAT-03
5. Content Generation: CONT-01, CONT-02
6. Scheduling Foundation: SCHD-01, SCHD-02
7. Automation & Calendar: SCHD-03, SCHD-04
8. AI Learning: CHAT-04
9. Editorial Planning: CONT-03
10. Messaging Integration: MSGN-01, MSGN-02

All 19 v1 requirements mapped to phases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 02:29:57 +01:00
Michele
52caabc9cc docs: define v1 requirements
19 requirements across 6 categories
7 requirements deferred to v2

Categories:
- Authentication (4)
- Onboarding (2)
- AI Chat (4)
- Content Generation (3)
- Scheduling & Publishing (4)
- Messaging Integration (2)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 02:23:16 +01:00
Michele
dc3ea1cf58 docs: complete domain research
Research dimensions:
- STACK.md: Technology stack recommendations (Next.js 15, Supabase, Vercel AI SDK, BullMQ)
- FEATURES.md: Feature landscape analysis (table stakes vs differentiators)
- ARCHITECTURE.md: System architecture design (headless, multi-tenant, job queue)
- PITFALLS.md: Common mistakes to avoid (rate limits, AI slop, cost control)
- SUMMARY.md: Synthesized findings with roadmap implications

Key findings:
- Stack: Next.js 15 + Supabase Cloud + Vercel AI SDK (multi-provider)
- Architecture: Modular monolith → microservices, headless pattern
- Critical pitfall: API rate limits (Meta reduced by 96%), AI cost explosion

Phase recommendations:
1. Core Scheduling Foundation (6-8 weeks)
2. Reliability & Differentiation (4-6 weeks)
3. Advanced Innovation (8-12 weeks)
4. Scale & Polish (ongoing)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-31 02:08:10 +01:00
Michele
a2f5dc2b97 chore: add project config
Mode: yolo
Depth: comprehensive
Parallelization: enabled
Workflow agents: research=on, plan_check=on, verifier=on

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 01:56:22 +01:00
Michele
1ccb092469 docs: initialize project
Leopost - micro-SaaS di social media management AI per freelance italiani

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