Always ensure unified Supabase client usage across the entire application
- AuthProvider was using
@supabase/supabase-js(localStorage-based) - Rest of app was using
@supabase/ssr(cookie-based SSR-optimized) - This caused session state conflicts leading to 401 authentication errors
-
Standardize on SSR Client: All components MUST import from
@nextsaas/supabase// ✅ Correct - Use this everywhere import { getSupabaseBrowserClient } from '@nextsaas/supabase' // ❌ Wrong - Never use direct supabase imports import { createClient } from '@supabase/supabase-js'
-
Path Alias Configuration: Ensure tsconfig.json has correct path mapping
"paths": { "@/*": ["./src/*"] // ✅ Points to src directory }
-
Route Configuration: Use consistent route names
// ✅ Correct routes in AuthProvider and middleware redirectTo = '/auth/sign-in' // Not '/auth/login'
- Always add
@nextsaas/supabaseas external dependency in package build configs - Build supabase package before auth package
- Rebuild auth package after any route or client changes
- Never create separate Supabase client instances
- Always use the unified client from
@nextsaas/supabase - Test authentication on every major feature to catch session conflicts early
- Created comprehensive testing documentation:
./FEATURE_TESTING_REQUIREMENTS.md./FEATURE_TESTING_CHECKLIST.md- Updated main
README.mdwith testing guidelines
- 80% minimum coverage across all metrics
- Comprehensive testing of:
- Component variants
- Component states
- Component interactions
- Error handling
- Edge cases
- Implemented accessibility testing
- Validate API integration points
- Test multi-tenant scenarios
- Verify authentication flows
- Confirm component composition
- Complete user journey testing
- Cross-browser compatibility
- Visual regression tests
- Performance benchmarks
- Missing unit tests
- Coverage below 80%
- No integration tests for API calls
- No E2E tests for user flows
- Accessibility violations
- Visual regressions
- Breaking existing tests
- CI/CD Pipeline blocks incomplete tests
- Mandatory code review process
- Staging test requirements before production
- Jest + React Testing Library
- Playwright for E2E and visual testing
- jest-axe for accessibility
- 92.5% UI component test coverage
- Cross-browser testing configured
- Visual regression testing implemented
- Comprehensive unit tests
- Integration tests for workflows
- End-to-end user journey tests
- Accessibility verification
- Performance assessment
- Cross-browser compatibility