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
139 lines
4.8 KiB
Markdown
139 lines
4.8 KiB
Markdown
---
|
|
phase: 01-authentication
|
|
plan: 01
|
|
type: execute
|
|
wave: 1
|
|
depends_on: []
|
|
files_modified: ["pubspec.yaml", "lib/main.dart", "lib/core/constants/supabase_constants.dart", ".env"]
|
|
autonomous: true
|
|
user_setup:
|
|
- service: supabase
|
|
why: "Authentication backend and database"
|
|
env_vars:
|
|
- name: SUPABASE_URL
|
|
source: "Supabase Dashboard → Settings → API → Project URL"
|
|
- name: SUPABASE_ANON_KEY
|
|
source: "Supabase Dashboard → Settings → API → anon/public key"
|
|
dashboard_config:
|
|
- task: "Configure redirect URLs for password reset"
|
|
location: "Supabase Dashboard → Authentication → URL Configuration"
|
|
|
|
must_haves:
|
|
truths:
|
|
- "Flutter project initializes with Supabase client"
|
|
- "Environment variables are loaded securely"
|
|
- "Supabase connection is established without errors"
|
|
artifacts:
|
|
- path: "pubspec.yaml"
|
|
provides: "Flutter project dependencies"
|
|
contains: "supabase_flutter"
|
|
- path: "lib/main.dart"
|
|
provides: "Supabase initialization"
|
|
min_lines: 15
|
|
- path: "lib/core/constants/supabase_constants.dart"
|
|
provides: "Supabase configuration constants"
|
|
min_lines: 10
|
|
- path: ".env"
|
|
provides: "Environment variables"
|
|
contains: "SUPABASE_URL"
|
|
key_links:
|
|
- from: "lib/main.dart"
|
|
to: "Supabase.initialize"
|
|
via: "main() function"
|
|
pattern: "Supabase\\.initialize"
|
|
- from: "lib/core/constants/supabase_constants.dart"
|
|
to: ".env"
|
|
via: "environment variable loading"
|
|
pattern: "String.fromEnvironment|dotenv"
|
|
---
|
|
|
|
<objective>
|
|
Create Flutter project foundation with Supabase integration and secure configuration.
|
|
|
|
Purpose: Establish the technical foundation required for all authentication features in Sage.
|
|
Output: Working Flutter app that can communicate with Supabase backend using secure configuration.
|
|
</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>Initialize Flutter project with Supabase dependencies</name>
|
|
<files>pubspec.yaml</files>
|
|
<action>
|
|
Create Flutter project if it doesn't exist. Add required dependencies to pubspec.yaml:
|
|
- supabase_flutter: ^2.12.0
|
|
- flutter_dotenv: ^5.1.0
|
|
- go_router: ^13.0.0
|
|
- riverpod: ^2.5.0
|
|
- flutter_secure_storage: ^9.0.0
|
|
|
|
Run `flutter pub get` to install dependencies.
|
|
</action>
|
|
<verify>flutter pub get completes successfully and all dependencies resolve</verify>
|
|
<done>Flutter project exists with all required Supabase dependencies installed</done>
|
|
</task>
|
|
|
|
<task type="auto">
|
|
<name>Create secure Supabase configuration</name>
|
|
<files>lib/core/constants/supabase_constants.dart, .env</files>
|
|
<action>
|
|
Create environment configuration:
|
|
1. Create .env file with SUPABASE_URL and SUPABASE_ANON_KEY placeholders
|
|
2. Create lib/core/constants/supabase_constants.dart that loads environment variables using flutter_dotenv
|
|
3. Add .env to .gitignore to prevent committing secrets
|
|
4. Provide clear instructions in comments about where to get the values
|
|
|
|
Constants file should export:
|
|
- supabaseUrl
|
|
- supabaseAnonKey
|
|
</action>
|
|
<verify>Environment variables load correctly without exposing sensitive data in version control</verify>
|
|
<done>Secure configuration system exists with placeholder values ready for user setup</done>
|
|
</task>
|
|
|
|
<task type="auto">
|
|
<name>Initialize Supabase in main.dart</name>
|
|
<files>lib/main.dart</files>
|
|
<action>
|
|
Update lib/main.dart to:
|
|
1. Import required packages (supabase_flutter, flutter_dotenv)
|
|
2. Load environment variables using dotenv.load()
|
|
3. Initialize Supabase in main() before runApp()
|
|
4. Use SharedPreferencesLocalStorage for session persistence (default, secure enough for v1)
|
|
5. Handle initialization errors gracefully
|
|
6. Create basic MyApp widget structure
|
|
|
|
Follow the PKCE flow pattern from research.
|
|
</action>
|
|
<verify>flutter run starts without Supabase initialization errors</verify>
|
|
<done>Flutter app initializes Supabase client successfully on startup</done>
|
|
</task>
|
|
|
|
</tasks>
|
|
|
|
<verification>
|
|
1. Flutter project runs without errors (`flutter run`)
|
|
2. Supabase client initializes without throwing exceptions
|
|
3. Environment variables are loaded securely (not hardcoded)
|
|
4. Project structure follows recommended architecture from research
|
|
</verification>
|
|
|
|
<success_criteria>
|
|
Flutter app starts successfully, Supabase client is initialized and ready to handle authentication operations, and configuration is secure and maintainable.
|
|
</success_criteria>
|
|
|
|
<output>
|
|
After completion, create `.planning/phases/01-authentication/01-01-SUMMARY.md`
|
|
</output> |