diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff378b --- /dev/null +++ b/.gitignore @@ -0,0 +1,47 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# Environment variables (secrets) +.env +.env.* diff --git a/lib/core/constants/supabase_constants.dart b/lib/core/constants/supabase_constants.dart new file mode 100644 index 0000000..d1e8d2c --- /dev/null +++ b/lib/core/constants/supabase_constants.dart @@ -0,0 +1,25 @@ +import 'package:flutter_dotenv/flutter_dotenv.dart'; + +/// Supabase configuration constants +/// Environment variables are loaded securely from .env file +class SupabaseConstants { + SupabaseConstants._(); + + static late final String supabaseUrl; + static late final String supabaseAnonKey; + + /// Initialize Supabase constants from environment variables + static Future initialize() async { + await dotenv.load(fileName: '.env'); + + supabaseUrl = dotenv.env['SUPABASE_URL'] ?? ''; + supabaseAnonKey = dotenv.env['SUPABASE_ANON_KEY'] ?? ''; + + if (supabaseUrl.isEmpty || supabaseAnonKey.isEmpty) { + throw Exception( + 'SUPABASE_URL and SUPABASE_ANON_KEY must be set in .env file\n' + 'Get these values from Supabase Dashboard → Settings → API', + ); + } + } +} \ No newline at end of file