docs(01): create phase 1 authentication plans
Phase 1: Authentication & Account Basics - 7 plans in 4 waves - Covers AUTH-01 through AUTH-05 requirements - Foundation for household features in Phase 2 - Ready for execution
This commit is contained in:
166
.planning/phases/01-authentication/01-07-PLAN.md
Normal file
166
.planning/phases/01-authentication/01-07-PLAN.md
Normal file
@@ -0,0 +1,166 @@
|
||||
---
|
||||
phase: 01-authentication
|
||||
plan: 07
|
||||
type: execute
|
||||
wave: 4
|
||||
depends_on: ["01-01", "01-02", "01-03", "01-04", "01-05", "01-06"]
|
||||
files_modified: ["lib/presentation/pages/home_page.dart", "lib/main.dart", "test/integration_test/auth_flow_test.dart"]
|
||||
autonomous: false
|
||||
user_setup: []
|
||||
|
||||
must_haves:
|
||||
truths:
|
||||
- "User can complete full auth flow in under 3 seconds"
|
||||
- "Session persists across app restarts"
|
||||
- "User can logout from any screen"
|
||||
- "All 5 success criteria are demonstrable"
|
||||
- "No authentication errors in clean flow"
|
||||
artifacts:
|
||||
- path: "lib/presentation/pages/home_page.dart"
|
||||
provides: "Authenticated user destination"
|
||||
min_lines: 25
|
||||
- path: "test/integration_test/auth_flow_test.dart"
|
||||
provides: "Authentication flow verification"
|
||||
min_lines: 40
|
||||
- path: "lib/main.dart"
|
||||
provides: "Complete app initialization"
|
||||
min_lines: 30
|
||||
key_links:
|
||||
- from: "lib/presentation/pages/home_page.dart"
|
||||
to: "lib/providers/auth_provider.dart"
|
||||
via: "logout functionality"
|
||||
pattern: "signOut|logout"
|
||||
- from: "test/integration_test/auth_flow_test.dart"
|
||||
to: "all auth pages"
|
||||
via: "integration testing"
|
||||
pattern: "testWidgets|integrationTest"
|
||||
---
|
||||
|
||||
<objective>
|
||||
Complete authentication system with logout functionality and verify all success criteria.
|
||||
|
||||
Purpose: Finalize Phase 1 by adding logout capability and confirming all authentication requirements are met.
|
||||
Output: Fully functional authentication system ready for household features in Phase 2.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.opencode/get-shit-done/workflows/execute-plan.md
|
||||
@~/.opencode/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/01-authentication/01-RESEARCH.md
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Create home page with logout functionality</name>
|
||||
<files>lib/presentation/pages/home_page.dart</files>
|
||||
<action>
|
||||
Create HomePage that:
|
||||
1. Shows user email and basic user info
|
||||
2. Has logout button in app bar or menu
|
||||
3. Uses AuthProvider signOut() method
|
||||
4. Shows loading state during logout
|
||||
5. Navigates to login page after successful logout
|
||||
6. Handles logout errors gracefully
|
||||
7. Includes confirmation dialog for logout
|
||||
8. Has proper accessibility labels
|
||||
9. Responsive design for different screen sizes
|
||||
10. Placeholder content for future inventory features
|
||||
11. Welcome message for authenticated user
|
||||
12. Basic UI structure following Material Design
|
||||
</action>
|
||||
<verify>Home page displays user info, logout button works correctly, and navigation flow is smooth</verify>
|
||||
<done>Complete authenticated user home page with logout functionality</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Finalize app integration and routing</name>
|
||||
<files>lib/main.dart</files>
|
||||
<action>
|
||||
Complete main.dart integration:
|
||||
1. Ensure all providers are properly configured
|
||||
2. Complete router configuration with all auth routes
|
||||
3. Add proper error boundaries for auth failures
|
||||
4. Configure app theme and localization if needed
|
||||
5. Ensure proper initialization order:
|
||||
- Environment loading
|
||||
- Supabase initialization
|
||||
- Provider setup
|
||||
- Router configuration
|
||||
6. Add debugging tools in debug mode
|
||||
7. Configure logging for auth operations
|
||||
8. Handle deep linking for password reset
|
||||
9. Ensure proper disposal of resources
|
||||
10. Add performance optimizations if needed
|
||||
</action>
|
||||
<verify>App starts correctly, auth flow works end-to-end, and no initialization errors occur</verify>
|
||||
<done>Complete app initialization with all authentication systems integrated</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Create authentication flow integration tests</name>
|
||||
<files>test/integration_test/auth_flow_test.dart</files>
|
||||
<action>
|
||||
Create comprehensive integration tests that:
|
||||
1. Test signup flow with valid credentials
|
||||
2. Test login flow with existing credentials
|
||||
3. Test logout functionality
|
||||
4. Test session persistence (simulate app restart)
|
||||
5. Test password reset flow
|
||||
6. Test error scenarios for each flow
|
||||
7. Verify <3 second signup/login timing requirement
|
||||
8. Test navigation redirects based on auth state
|
||||
9. Verify all 5 success criteria programmatically
|
||||
10. Include cleanup to avoid test pollution
|
||||
11. Use pumpAndSettle for async operations
|
||||
12. Mock network conditions if needed
|
||||
</action>
|
||||
<verify>Integration tests pass and verify all authentication requirements</verify>
|
||||
<done>Comprehensive test suite covering all authentication flows and success criteria</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<task type="checkpoint:human-verify" gate="blocking">
|
||||
<what-built>Complete authentication system with signup, login, logout, password reset, error handling, and session persistence</what-built>
|
||||
<how-to-verify>
|
||||
1. Run the app (`flutter run`) on device or emulator
|
||||
2. Test signup flow: Create account with valid email/password - should complete in <3 seconds
|
||||
3. Test login flow: Login with created credentials - should complete in <3 seconds
|
||||
4. Test session persistence: Restart app - should stay logged in
|
||||
5. Test password reset: Request reset email, receive email within 1 minute, update password
|
||||
6. Test logout: Logout from home page - should return to login screen
|
||||
7. Test error messages: Try invalid login - should see specific error (invalid password vs account not found)
|
||||
8. Run integration tests: `flutter test integration_test/auth_flow_test.dart`
|
||||
9. Verify all 5 success criteria from ROADMAP.md are met
|
||||
</how-to-verify>
|
||||
<resume-signal>Type "approved" to confirm all success criteria are met, or describe issues found</resume-signal>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
1. All 5 success criteria from Phase 1 are demonstrable and working
|
||||
2. Authentication operations complete within 3 seconds as required
|
||||
3. Session persists across app restarts
|
||||
4. Password reset email arrives within 1 minute
|
||||
5. Clear error messages distinguish invalid password vs account not found
|
||||
6. Logout works from any authenticated screen
|
||||
7. Integration tests pass for all authentication flows
|
||||
8. No unhandled exceptions or crashes in auth flows
|
||||
9. Navigation properly protects routes and redirects based on auth state
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
Phase 1 Authentication & Account Basics is complete with all requirements implemented and verified. System is ready for Phase 2 household features.
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/01-authentication/01-07-SUMMARY.md`
|
||||
</output>
|
||||
Reference in New Issue
Block a user