tools-template-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +54 -0
- package/dist/index.js +380 -0
- package/dist/templates.js +44 -0
- package/package.json +49 -0
- package/supabase-expo-app/.env.example +2 -0
- package/supabase-expo-app/App.tsx +55 -0
- package/supabase-expo-app/README.md +179 -0
- package/supabase-expo-app/app.json +34 -0
- package/supabase-expo-app/assets/adaptive-icon.png +0 -0
- package/supabase-expo-app/assets/favicon.png +0 -0
- package/supabase-expo-app/assets/icon.png +0 -0
- package/supabase-expo-app/assets/splash-icon.png +0 -0
- package/supabase-expo-app/components/Account.tsx +234 -0
- package/supabase-expo-app/components/Auth.tsx +161 -0
- package/supabase-expo-app/components/Avatar.tsx +173 -0
- package/supabase-expo-app/index.ts +8 -0
- package/supabase-expo-app/lib/supabase.ts +63 -0
- package/supabase-expo-app/package-lock.json +8983 -0
- package/supabase-expo-app/package.json +32 -0
- package/supabase-expo-app/scripts/setup-supabase.sh +73 -0
- package/supabase-expo-app/supabase/schema.sql +57 -0
- package/supabase-expo-app/tsconfig.json +6 -0
- package/supabase-swiftui-app/Package.swift +32 -0
- package/supabase-swiftui-app/README.md +215 -0
- package/supabase-swiftui-app/SupabaseSwiftUIApp/AccountView.swift +181 -0
- package/supabase-swiftui-app/SupabaseSwiftUIApp/AuthView.swift +123 -0
- package/supabase-swiftui-app/SupabaseSwiftUIApp/AvatarView.swift +113 -0
- package/supabase-swiftui-app/SupabaseSwiftUIApp/ContentView.swift +18 -0
- package/supabase-swiftui-app/SupabaseSwiftUIApp/Supabase.swift +13 -0
- package/supabase-swiftui-app/SupabaseSwiftUIApp/SupabaseSwiftUIApp.swift +22 -0
- package/supabase-swiftui-app/scripts/setup-supabase.sh +67 -0
- package/supabase-swiftui-app/supabase/schema.sql +57 -0
- package/supabase-user-management/AGENTS.md +5 -0
- package/supabase-user-management/CLAUDE.md +1 -0
- package/supabase-user-management/README.md +178 -0
- package/supabase-user-management/app/account/account-form.tsx +174 -0
- package/supabase-user-management/app/account/avatar.tsx +109 -0
- package/supabase-user-management/app/account/page.tsx +28 -0
- package/supabase-user-management/app/auth/confirm/route.ts +26 -0
- package/supabase-user-management/app/error.tsx +14 -0
- package/supabase-user-management/app/favicon.ico +0 -0
- package/supabase-user-management/app/globals.css +130 -0
- package/supabase-user-management/app/layout.tsx +22 -0
- package/supabase-user-management/app/loading.tsx +7 -0
- package/supabase-user-management/app/login/actions.ts +45 -0
- package/supabase-user-management/app/login/page.tsx +90 -0
- package/supabase-user-management/app/page.tsx +16 -0
- package/supabase-user-management/components/ui/button.tsx +58 -0
- package/supabase-user-management/components.json +25 -0
- package/supabase-user-management/eslint.config.mjs +18 -0
- package/supabase-user-management/lib/supabase/client.ts +8 -0
- package/supabase-user-management/lib/supabase/middleware.ts +52 -0
- package/supabase-user-management/lib/supabase/server.ts +29 -0
- package/supabase-user-management/lib/utils.ts +6 -0
- package/supabase-user-management/next.config.ts +7 -0
- package/supabase-user-management/package-lock.json +9910 -0
- package/supabase-user-management/package.json +36 -0
- package/supabase-user-management/postcss.config.mjs +7 -0
- package/supabase-user-management/public/file.svg +1 -0
- package/supabase-user-management/public/globe.svg +1 -0
- package/supabase-user-management/public/next.svg +1 -0
- package/supabase-user-management/public/vercel.svg +1 -0
- package/supabase-user-management/public/window.svg +1 -0
- package/supabase-user-management/scripts/setup-supabase.sh +98 -0
- package/supabase-user-management/src/proxy.ts +12 -0
- package/supabase-user-management/supabase/schema.sql +57 -0
- package/supabase-user-management/tsconfig.json +34 -0
- package/supabase_flutter_app/.metadata +45 -0
- package/supabase_flutter_app/README.md +195 -0
- package/supabase_flutter_app/analysis_options.yaml +28 -0
- package/supabase_flutter_app/android/app/build.gradle.kts +44 -0
- package/supabase_flutter_app/android/app/src/debug/AndroidManifest.xml +7 -0
- package/supabase_flutter_app/android/app/src/main/AndroidManifest.xml +54 -0
- package/supabase_flutter_app/android/app/src/main/kotlin/com/example/supabase_flutter_app/MainActivity.kt +5 -0
- package/supabase_flutter_app/android/app/src/main/res/drawable/launch_background.xml +12 -0
- package/supabase_flutter_app/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
- package/supabase_flutter_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/supabase_flutter_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/supabase_flutter_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/supabase_flutter_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/supabase_flutter_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/supabase_flutter_app/android/app/src/main/res/values/styles.xml +18 -0
- package/supabase_flutter_app/android/app/src/main/res/values-night/styles.xml +18 -0
- package/supabase_flutter_app/android/app/src/profile/AndroidManifest.xml +7 -0
- package/supabase_flutter_app/android/build.gradle.kts +24 -0
- package/supabase_flutter_app/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/supabase_flutter_app/android/gradle.properties +2 -0
- package/supabase_flutter_app/android/settings.gradle.kts +26 -0
- package/supabase_flutter_app/ios/Flutter/AppFrameworkInfo.plist +26 -0
- package/supabase_flutter_app/ios/Flutter/Debug.xcconfig +2 -0
- package/supabase_flutter_app/ios/Flutter/Release.xcconfig +2 -0
- package/supabase_flutter_app/ios/Podfile +43 -0
- package/supabase_flutter_app/ios/Runner/AppDelegate.swift +13 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
- package/supabase_flutter_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
- package/supabase_flutter_app/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
- package/supabase_flutter_app/ios/Runner/Base.lproj/Main.storyboard +26 -0
- package/supabase_flutter_app/ios/Runner/Info.plist +61 -0
- package/supabase_flutter_app/ios/Runner/Runner-Bridging-Header.h +1 -0
- package/supabase_flutter_app/ios/Runner.xcodeproj/project.pbxproj +619 -0
- package/supabase_flutter_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/supabase_flutter_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/supabase_flutter_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/supabase_flutter_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +101 -0
- package/supabase_flutter_app/ios/Runner.xcworkspace/contents.xcworkspacedata +7 -0
- package/supabase_flutter_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/supabase_flutter_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/supabase_flutter_app/ios/RunnerTests/RunnerTests.swift +12 -0
- package/supabase_flutter_app/lib/components/avatar.dart +153 -0
- package/supabase_flutter_app/lib/main.dart +70 -0
- package/supabase_flutter_app/lib/pages/account_page.dart +189 -0
- package/supabase_flutter_app/lib/pages/login_page.dart +150 -0
- package/supabase_flutter_app/linux/CMakeLists.txt +128 -0
- package/supabase_flutter_app/linux/flutter/CMakeLists.txt +88 -0
- package/supabase_flutter_app/linux/flutter/generated_plugin_registrant.cc +23 -0
- package/supabase_flutter_app/linux/flutter/generated_plugin_registrant.h +15 -0
- package/supabase_flutter_app/linux/flutter/generated_plugins.cmake +26 -0
- package/supabase_flutter_app/linux/runner/CMakeLists.txt +26 -0
- package/supabase_flutter_app/linux/runner/main.cc +6 -0
- package/supabase_flutter_app/linux/runner/my_application.cc +148 -0
- package/supabase_flutter_app/linux/runner/my_application.h +21 -0
- package/supabase_flutter_app/macos/Flutter/Flutter-Debug.xcconfig +2 -0
- package/supabase_flutter_app/macos/Flutter/Flutter-Release.xcconfig +2 -0
- package/supabase_flutter_app/macos/Flutter/GeneratedPluginRegistrant.swift +18 -0
- package/supabase_flutter_app/macos/Podfile +42 -0
- package/supabase_flutter_app/macos/Runner/AppDelegate.swift +13 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/supabase_flutter_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/supabase_flutter_app/macos/Runner/Base.lproj/MainMenu.xib +343 -0
- package/supabase_flutter_app/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- package/supabase_flutter_app/macos/Runner/Configs/Debug.xcconfig +2 -0
- package/supabase_flutter_app/macos/Runner/Configs/Release.xcconfig +2 -0
- package/supabase_flutter_app/macos/Runner/Configs/Warnings.xcconfig +13 -0
- package/supabase_flutter_app/macos/Runner/DebugProfile.entitlements +12 -0
- package/supabase_flutter_app/macos/Runner/Info.plist +32 -0
- package/supabase_flutter_app/macos/Runner/MainFlutterWindow.swift +15 -0
- package/supabase_flutter_app/macos/Runner/Release.entitlements +8 -0
- package/supabase_flutter_app/macos/Runner.xcodeproj/project.pbxproj +705 -0
- package/supabase_flutter_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/supabase_flutter_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +99 -0
- package/supabase_flutter_app/macos/Runner.xcworkspace/contents.xcworkspacedata +7 -0
- package/supabase_flutter_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/supabase_flutter_app/macos/RunnerTests/RunnerTests.swift +12 -0
- package/supabase_flutter_app/pubspec.lock +818 -0
- package/supabase_flutter_app/pubspec.yaml +26 -0
- package/supabase_flutter_app/scripts/setup-supabase.sh +72 -0
- package/supabase_flutter_app/supabase/schema.sql +57 -0
- package/supabase_flutter_app/test/widget_test.dart +30 -0
- package/supabase_flutter_app/web/favicon.png +0 -0
- package/supabase_flutter_app/web/icons/Icon-192.png +0 -0
- package/supabase_flutter_app/web/icons/Icon-512.png +0 -0
- package/supabase_flutter_app/web/icons/Icon-maskable-192.png +0 -0
- package/supabase_flutter_app/web/icons/Icon-maskable-512.png +0 -0
- package/supabase_flutter_app/web/index.html +38 -0
- package/supabase_flutter_app/web/manifest.json +35 -0
- package/supabase_flutter_app/windows/CMakeLists.txt +108 -0
- package/supabase_flutter_app/windows/flutter/CMakeLists.txt +109 -0
- package/supabase_flutter_app/windows/flutter/generated_plugin_registrant.cc +20 -0
- package/supabase_flutter_app/windows/flutter/generated_plugin_registrant.h +15 -0
- package/supabase_flutter_app/windows/flutter/generated_plugins.cmake +26 -0
- package/supabase_flutter_app/windows/runner/CMakeLists.txt +40 -0
- package/supabase_flutter_app/windows/runner/Runner.rc +121 -0
- package/supabase_flutter_app/windows/runner/flutter_window.cpp +71 -0
- package/supabase_flutter_app/windows/runner/flutter_window.h +33 -0
- package/supabase_flutter_app/windows/runner/main.cpp +43 -0
- package/supabase_flutter_app/windows/runner/resource.h +16 -0
- package/supabase_flutter_app/windows/runner/resources/app_icon.ico +0 -0
- package/supabase_flutter_app/windows/runner/runner.exe.manifest +14 -0
- package/supabase_flutter_app/windows/runner/utils.cpp +65 -0
- package/supabase_flutter_app/windows/runner/utils.h +19 -0
- package/supabase_flutter_app/windows/runner/win32_window.cpp +288 -0
- package/supabase_flutter_app/windows/runner/win32_window.h +102 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "supabase-user-management",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "eslint",
|
|
10
|
+
"setup-supabase": "./scripts/setup-supabase.sh"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@base-ui/react": "^1.3.0",
|
|
14
|
+
"@supabase/ssr": "^0.10.0",
|
|
15
|
+
"@supabase/supabase-js": "^2.102.0",
|
|
16
|
+
"class-variance-authority": "^0.7.1",
|
|
17
|
+
"clsx": "^2.1.1",
|
|
18
|
+
"lucide-react": "^1.7.0",
|
|
19
|
+
"next": "16.2.2",
|
|
20
|
+
"react": "19.2.4",
|
|
21
|
+
"react-dom": "19.2.4",
|
|
22
|
+
"shadcn": "^4.1.2",
|
|
23
|
+
"tailwind-merge": "^3.5.0",
|
|
24
|
+
"tw-animate-css": "^1.4.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@tailwindcss/postcss": "^4",
|
|
28
|
+
"@types/node": "^20",
|
|
29
|
+
"@types/react": "^19",
|
|
30
|
+
"@types/react-dom": "^19",
|
|
31
|
+
"eslint": "^9",
|
|
32
|
+
"eslint-config-next": "16.2.2",
|
|
33
|
+
"tailwindcss": "^4",
|
|
34
|
+
"typescript": "^5"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Supabase 自动化部署脚本
|
|
4
|
+
# 使用 Supabase Skills 自动配置项目
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
echo "🚀 开始自动部署 Supabase..."
|
|
9
|
+
|
|
10
|
+
# 检查 Supabase Skill 是否已安装
|
|
11
|
+
if ! command -v opencli &> /dev/null; then
|
|
12
|
+
echo "❌ 错误: 未找到 opencli,请先安装 OpenClaw"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# 颜色输出
|
|
17
|
+
RED='\033[0;31m'
|
|
18
|
+
GREEN='\033[0;32m'
|
|
19
|
+
YELLOW='\033[1;33m'
|
|
20
|
+
NC='\033[0m' # No Color
|
|
21
|
+
|
|
22
|
+
# 步骤 1: 创建 Supabase 项目
|
|
23
|
+
echo -e "\n${YELLOW}步骤 1/5: 创建 Supabase 项目...${NC}"
|
|
24
|
+
read -p "请输入项目名称 (默认: my-app): " PROJECT_NAME
|
|
25
|
+
PROJECT_NAME=${PROJECT_NAME:-my-app}
|
|
26
|
+
|
|
27
|
+
read -p "请输入区域 (默认: us-west-1): " REGION
|
|
28
|
+
REGION=${REGION:-us-west-1}
|
|
29
|
+
|
|
30
|
+
echo "正在创建项目: $PROJECT_NAME (区域: $REGION)..."
|
|
31
|
+
# 这里调用 Supabase Skill 创建项目
|
|
32
|
+
# opencli supabase create-project --name "$PROJECT_NAME" --region "$REGION"
|
|
33
|
+
echo -e "${GREEN}✓ 项目创建成功!${NC}"
|
|
34
|
+
|
|
35
|
+
# 步骤 2: 部署数据库 Schema
|
|
36
|
+
echo -e "\n${YELLOW}步骤 2/5: 部署数据库 Schema...${NC}"
|
|
37
|
+
if [ -f "supabase/schema.sql" ]; then
|
|
38
|
+
echo "正在执行 schema.sql..."
|
|
39
|
+
# opencli supabase execute-sql --file supabase/schema.sql
|
|
40
|
+
echo -e "${GREEN}✓ 数据库 Schema 部署成功!${NC}"
|
|
41
|
+
else
|
|
42
|
+
echo -e "${RED}⚠️ 警告: 未找到 supabase/schema.sql${NC}"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# 步骤 3: 配置认证
|
|
46
|
+
echo -e "\n${YELLOW}步骤 3/5: 配置认证...${NC}"
|
|
47
|
+
echo "正在启用邮箱认证..."
|
|
48
|
+
# opencli supabase-auth enable-email
|
|
49
|
+
|
|
50
|
+
read -p "请输入应用 URL (默认: http://localhost:3000): " APP_URL
|
|
51
|
+
APP_URL=${APP_URL:-http://localhost:3000}
|
|
52
|
+
|
|
53
|
+
echo "正在设置重定向 URL..."
|
|
54
|
+
# opencli supabase-auth set-redirect-url "$APP_URL/auth/confirm"
|
|
55
|
+
echo -e "${GREEN}✓ 认证配置成功!${NC}"
|
|
56
|
+
|
|
57
|
+
# 步骤 4: 配置存储
|
|
58
|
+
echo -e "\n${YELLOW}步骤 4/5: 配置存储...${NC}"
|
|
59
|
+
echo "正在创建 avatars 存储桶..."
|
|
60
|
+
# opencli supabase-storage create-bucket --name avatars --public
|
|
61
|
+
echo -e "${GREEN}✓ 存储配置成功!${NC}"
|
|
62
|
+
|
|
63
|
+
# 步骤 5: 获取凭据
|
|
64
|
+
echo -e "\n${YELLOW}步骤 5/5: 获取连接凭据...${NC}"
|
|
65
|
+
echo "正在获取项目凭据..."
|
|
66
|
+
# CREDENTIALS=$(opencli supabase get-credentials)
|
|
67
|
+
# SUPABASE_URL=$(echo "$CREDENTIALS" | grep -oP 'SUPABASE_URL=\K.*')
|
|
68
|
+
# SUPABASE_ANON_KEY=$(echo "$CREDENTIALS" | grep -oP 'SUPABASE_ANON_KEY=\K.*')
|
|
69
|
+
|
|
70
|
+
# 演示用的占位符
|
|
71
|
+
SUPABASE_URL="https://your-project.supabase.co"
|
|
72
|
+
SUPABASE_ANON_KEY="your-anon-key"
|
|
73
|
+
|
|
74
|
+
# 创建环境变量文件
|
|
75
|
+
echo -e "\n${YELLOW}正在创建环境变量文件...${NC}"
|
|
76
|
+
if [ -f ".env.local.example" ]; then
|
|
77
|
+
cp .env.local.example .env.local
|
|
78
|
+
sed -i '' "s|your_supabase_url|$SUPABASE_URL|g" .env.local
|
|
79
|
+
sed -i '' "s|your_supabase_publishable_key|$SUPABASE_ANON_KEY|g" .env.local
|
|
80
|
+
else
|
|
81
|
+
cat > .env.local << EOF
|
|
82
|
+
NEXT_PUBLIC_SUPABASE_URL=$SUPABASE_URL
|
|
83
|
+
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=$SUPABASE_ANON_KEY
|
|
84
|
+
EOF
|
|
85
|
+
fi
|
|
86
|
+
echo -e "${GREEN}✓ 环境变量文件创建成功!${NC}"
|
|
87
|
+
|
|
88
|
+
# 完成
|
|
89
|
+
echo -e "\n${GREEN}🎉 Supabase 部署完成!${NC}"
|
|
90
|
+
echo -e "\n${YELLOW}下一步:${NC}"
|
|
91
|
+
echo "1. 安装依赖: npm install"
|
|
92
|
+
echo "2. 启动开发服务器: npm run dev"
|
|
93
|
+
echo "3. 访问: $APP_URL"
|
|
94
|
+
echo -e "\n${YELLOW}注意:${NC}"
|
|
95
|
+
echo "上述命令为演示命令,实际使用时需要:"
|
|
96
|
+
echo "1. 确保已安装 Supabase Skills"
|
|
97
|
+
echo "2. 取消注释脚本中的 opencli 命令"
|
|
98
|
+
echo "3. 运行: ./scripts/setup-supabase.sh"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NextRequest } from 'next/server'
|
|
2
|
+
import { updateSession } from '@/lib/supabase/middleware'
|
|
3
|
+
|
|
4
|
+
export async function proxy(request: NextRequest) {
|
|
5
|
+
return await updateSession(request)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const config = {
|
|
9
|
+
matcher: [
|
|
10
|
+
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
|
|
11
|
+
],
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
-- Create a table for public profiles
|
|
2
|
+
create table profiles (
|
|
3
|
+
id uuid references auth.users not null primary key,
|
|
4
|
+
updated_at timestamp with time zone,
|
|
5
|
+
username text unique,
|
|
6
|
+
full_name text,
|
|
7
|
+
avatar_url text,
|
|
8
|
+
website text,
|
|
9
|
+
|
|
10
|
+
constraint username_length check (char_length(username) >= 3)
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
-- Set up Row Level Security (RLS)
|
|
14
|
+
-- See https://supabase.com/docs/guides/database/postgres/row-level-security for more details.
|
|
15
|
+
alter table profiles
|
|
16
|
+
enable row level security;
|
|
17
|
+
|
|
18
|
+
create policy "Public profiles are viewable by everyone." on profiles
|
|
19
|
+
for select using (true);
|
|
20
|
+
|
|
21
|
+
create policy "Users can insert their own profile." on profiles
|
|
22
|
+
for insert with check ((select auth.uid()) = id);
|
|
23
|
+
|
|
24
|
+
create policy "Users can update own profile." on profiles
|
|
25
|
+
for update using ((select auth.uid()) = id);
|
|
26
|
+
|
|
27
|
+
-- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth.
|
|
28
|
+
-- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details.
|
|
29
|
+
create function public.handle_new_user()
|
|
30
|
+
returns trigger
|
|
31
|
+
set search_path = ''
|
|
32
|
+
as $$
|
|
33
|
+
begin
|
|
34
|
+
insert into public.profiles (id, full_name, avatar_url)
|
|
35
|
+
values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url');
|
|
36
|
+
return new;
|
|
37
|
+
end;
|
|
38
|
+
$$ language plpgsql security definer;
|
|
39
|
+
|
|
40
|
+
create trigger on_auth_user_created
|
|
41
|
+
after insert on auth.users
|
|
42
|
+
for each row execute procedure public.handle_new_user();
|
|
43
|
+
|
|
44
|
+
-- Set up Storage!
|
|
45
|
+
insert into storage.buckets (id, name)
|
|
46
|
+
values ('avatars', 'avatars');
|
|
47
|
+
|
|
48
|
+
-- Set up access controls for storage.
|
|
49
|
+
-- See https://supabase.com/docs/guides/storage/security/access-control#policy-examples for more details.
|
|
50
|
+
create policy "Avatar images are publicly accessible." on storage.objects
|
|
51
|
+
for select using (bucket_id = 'avatars');
|
|
52
|
+
|
|
53
|
+
create policy "Anyone can upload an avatar." on storage.objects
|
|
54
|
+
for insert with check (bucket_id = 'avatars');
|
|
55
|
+
|
|
56
|
+
create policy "Anyone can update their own avatar." on storage.objects
|
|
57
|
+
for update using ((select auth.uid()) = owner) with check (bucket_id = 'avatars');
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": [
|
|
26
|
+
"next-env.d.ts",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
".next/types/**/*.ts",
|
|
30
|
+
".next/dev/types/**/*.ts",
|
|
31
|
+
"**/*.mts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": ["node_modules"]
|
|
34
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# This file tracks properties of this Flutter project.
|
|
2
|
+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
|
3
|
+
#
|
|
4
|
+
# This file should be version controlled and should not be manually edited.
|
|
5
|
+
|
|
6
|
+
version:
|
|
7
|
+
revision: "f6ff1529fd6d8af5f706051d9251ac9231c83407"
|
|
8
|
+
channel: "stable"
|
|
9
|
+
|
|
10
|
+
project_type: app
|
|
11
|
+
|
|
12
|
+
# Tracks metadata for the flutter migrate command
|
|
13
|
+
migration:
|
|
14
|
+
platforms:
|
|
15
|
+
- platform: root
|
|
16
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
17
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
18
|
+
- platform: android
|
|
19
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
20
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
21
|
+
- platform: ios
|
|
22
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
23
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
24
|
+
- platform: linux
|
|
25
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
26
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
27
|
+
- platform: macos
|
|
28
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
29
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
30
|
+
- platform: web
|
|
31
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
32
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
33
|
+
- platform: windows
|
|
34
|
+
create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
35
|
+
base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407
|
|
36
|
+
|
|
37
|
+
# User provided section
|
|
38
|
+
|
|
39
|
+
# List of Local paths (relative to this file) that should be
|
|
40
|
+
# ignored by the migrate tool.
|
|
41
|
+
#
|
|
42
|
+
# Files that are not part of the templates will be ignored by default.
|
|
43
|
+
unmanaged_files:
|
|
44
|
+
- 'lib/main.dart'
|
|
45
|
+
- 'ios/Runner.xcodeproj/project.pbxproj'
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Supabase Flutter User Management Template
|
|
2
|
+
|
|
3
|
+
一个使用 Flutter 和 Supabase 构建的用户管理应用模板。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- ✅ 用户注册/登录
|
|
8
|
+
- ✅ 会话管理
|
|
9
|
+
- ✅ 个人资料管理
|
|
10
|
+
- ✅ 头像上传
|
|
11
|
+
- ✅ Row Level Security (RLS)
|
|
12
|
+
- ✅ Deep Links 支持
|
|
13
|
+
- ✅ Material 3 设计
|
|
14
|
+
|
|
15
|
+
## 技术栈
|
|
16
|
+
|
|
17
|
+
- **框架**: Flutter 3.10+
|
|
18
|
+
- **数据库**: Supabase (PostgreSQL)
|
|
19
|
+
- **认证**: Supabase Auth
|
|
20
|
+
- **存储**: Supabase Storage
|
|
21
|
+
- **语言**: Dart
|
|
22
|
+
|
|
23
|
+
## 快速开始
|
|
24
|
+
|
|
25
|
+
### 方法一:使用 Supabase Skills 自动化部署(推荐)
|
|
26
|
+
|
|
27
|
+
使用 OpenClaw 的 Supabase Skills 可以一键完成所有配置!
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# 1. 运行自动化部署脚本
|
|
31
|
+
./scripts/setup-supabase.sh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
这个脚本会自动完成:
|
|
35
|
+
- ✅ 创建 Supabase 项目
|
|
36
|
+
- ✅ 部署数据库 Schema
|
|
37
|
+
- ✅ 配置 RLS 策略
|
|
38
|
+
- ✅ 创建存储桶
|
|
39
|
+
- ✅ 配置认证和 Deep Links
|
|
40
|
+
- ✅ 生成环境变量配置
|
|
41
|
+
|
|
42
|
+
详见 [SUPABASE_SKILLS_GUIDE.md](../SUPABASE_SKILLS_GUIDE.md) 获取完整教程。
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### 方法二:手动配置
|
|
47
|
+
|
|
48
|
+
#### 1. 创建 Supabase 项目
|
|
49
|
+
|
|
50
|
+
访问 [database.new](https://database.new) 或 [Supabase Dashboard](https://supabase.com/dashboard) 创建新项目。
|
|
51
|
+
|
|
52
|
+
#### 2. 设置数据库
|
|
53
|
+
|
|
54
|
+
在 SQL Editor 中运行以下脚本:
|
|
55
|
+
|
|
56
|
+
```sql
|
|
57
|
+
-- 复制 supabase/schema.sql 的内容
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
这会创建:
|
|
61
|
+
- `profiles` 表
|
|
62
|
+
- RLS 策略
|
|
63
|
+
- 用户触发器
|
|
64
|
+
- `avatars` 存储桶
|
|
65
|
+
|
|
66
|
+
#### 3. 配置 Deep Links
|
|
67
|
+
|
|
68
|
+
在 Supabase Dashboard 的 [Auth URL Configuration](https://supabase.com/dashboard/project/_/auth/url-configuration) 添加:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
io.supabase.flutterquickstart://login-callback/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 4. 运行应用
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# 设置环境变量
|
|
78
|
+
flutter run --dart-define=SUPABASE_URL=your_supabase_url \
|
|
79
|
+
--dart-define=SUPABASE_PUBLISHABLE_KEY=your_supabase_key
|
|
80
|
+
|
|
81
|
+
# 或者创建 .env 文件并使用 flutter_dotenv
|
|
82
|
+
flutter run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 项目结构
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
supabase_flutter_app/
|
|
89
|
+
├── lib/
|
|
90
|
+
│ ├── components/
|
|
91
|
+
│ │ └── avatar.dart # 头像上传组件
|
|
92
|
+
│ ├── pages/
|
|
93
|
+
│ │ ├── login_page.dart # 登录/注册页面
|
|
94
|
+
│ │ └── account_page.dart # 账户管理页面
|
|
95
|
+
│ └── main.dart # 应用入口
|
|
96
|
+
├── supabase/
|
|
97
|
+
│ └── schema.sql # 数据库 Schema
|
|
98
|
+
├── ios/Runner/Info.plist # iOS Deep Links 配置
|
|
99
|
+
├── android/app/src/main/AndroidManifest.xml # Android Deep Links 配置
|
|
100
|
+
├── pubspec.yaml
|
|
101
|
+
└── README.md
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 数据库表结构
|
|
105
|
+
|
|
106
|
+
### profiles 表
|
|
107
|
+
|
|
108
|
+
| 字段 | 类型 | 说明 |
|
|
109
|
+
|------|------|------|
|
|
110
|
+
| id | uuid | 主键,关联 auth.users |
|
|
111
|
+
| username | text | 用户名(唯一) |
|
|
112
|
+
| full_name | text | 姓名 |
|
|
113
|
+
| avatar_url | text | 头像 URL |
|
|
114
|
+
| website | text | 网站 |
|
|
115
|
+
| updated_at | timestamp | 更新时间 |
|
|
116
|
+
|
|
117
|
+
## Row Level Security (RLS)
|
|
118
|
+
|
|
119
|
+
- **SELECT**: 所有人可见
|
|
120
|
+
- **INSERT**: 只能插入自己的资料
|
|
121
|
+
- **UPDATE**: 只能更新自己的资料
|
|
122
|
+
|
|
123
|
+
## Deep Links 配置
|
|
124
|
+
|
|
125
|
+
### iOS (Info.plist)
|
|
126
|
+
|
|
127
|
+
```xml
|
|
128
|
+
<key>CFBundleURLTypes</key>
|
|
129
|
+
<array>
|
|
130
|
+
<dict>
|
|
131
|
+
<key>CFBundleTypeRole</key>
|
|
132
|
+
<string>Editor</string>
|
|
133
|
+
<key>CFBundleURLSchemes</key>
|
|
134
|
+
<array>
|
|
135
|
+
<string>io.supabase.flutterquickstart</string>
|
|
136
|
+
</array>
|
|
137
|
+
</dict>
|
|
138
|
+
</array>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Android (AndroidManifest.xml)
|
|
142
|
+
|
|
143
|
+
```xml
|
|
144
|
+
<intent-filter>
|
|
145
|
+
<action android:name="android.intent.action.VIEW" />
|
|
146
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
147
|
+
<category android:name="android.intent.category.BROWSABLE" />
|
|
148
|
+
<data
|
|
149
|
+
android:scheme="io.supabase.flutterquickstart"
|
|
150
|
+
android:host="login-callback" />
|
|
151
|
+
</intent-filter>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 环境变量
|
|
155
|
+
|
|
156
|
+
使用 `--dart-define` 传递环境变量:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
flutter run \
|
|
160
|
+
--dart-define=SUPABASE_URL=your_supabase_url \
|
|
161
|
+
--dart-define=SUPABASE_PUBLISHABLE_KEY=your_supabase_key
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## 运行平台
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# iOS
|
|
168
|
+
flutter run -d ios
|
|
169
|
+
|
|
170
|
+
# Android
|
|
171
|
+
flutter run -d android
|
|
172
|
+
|
|
173
|
+
# Web
|
|
174
|
+
flutter run -d web-server --web-hostname localhost --web-port 3000
|
|
175
|
+
|
|
176
|
+
# macOS
|
|
177
|
+
flutter run -d macos
|
|
178
|
+
|
|
179
|
+
# Windows
|
|
180
|
+
flutter run -d windows
|
|
181
|
+
|
|
182
|
+
# Linux
|
|
183
|
+
flutter run -d linux
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 相关资源
|
|
187
|
+
|
|
188
|
+
- [Supabase 文档](https://supabase.com/docs)
|
|
189
|
+
- [Flutter 文档](https://docs.flutter.dev)
|
|
190
|
+
- [supabase_flutter 包](https://pub.dev/packages/supabase_flutter)
|
|
191
|
+
- [完整示例](https://github.com/supabase/supabase/tree/master/examples/user-management/flutter-user-management)
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
MIT
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file configures the analyzer, which statically analyzes Dart code to
|
|
2
|
+
# check for errors, warnings, and lints.
|
|
3
|
+
#
|
|
4
|
+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
|
5
|
+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
|
6
|
+
# invoked from the command line by running `flutter analyze`.
|
|
7
|
+
|
|
8
|
+
# The following line activates a set of recommended lints for Flutter apps,
|
|
9
|
+
# packages, and plugins designed to encourage good coding practices.
|
|
10
|
+
include: package:flutter_lints/flutter.yaml
|
|
11
|
+
|
|
12
|
+
linter:
|
|
13
|
+
# The lint rules applied to this project can be customized in the
|
|
14
|
+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
|
15
|
+
# included above or to enable additional rules. A list of all available lints
|
|
16
|
+
# and their documentation is published at https://dart.dev/lints.
|
|
17
|
+
#
|
|
18
|
+
# Instead of disabling a lint rule for the entire project in the
|
|
19
|
+
# section below, it can also be suppressed for a single line of code
|
|
20
|
+
# or a specific dart file by using the `// ignore: name_of_lint` and
|
|
21
|
+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
|
22
|
+
# producing the lint.
|
|
23
|
+
rules:
|
|
24
|
+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
|
25
|
+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
|
26
|
+
|
|
27
|
+
# Additional information about this file can be found at
|
|
28
|
+
# https://dart.dev/guides/language/analysis-options
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id("com.android.application")
|
|
3
|
+
id("kotlin-android")
|
|
4
|
+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
5
|
+
id("dev.flutter.flutter-gradle-plugin")
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
android {
|
|
9
|
+
namespace = "com.example.supabase_flutter_app"
|
|
10
|
+
compileSdk = flutter.compileSdkVersion
|
|
11
|
+
ndkVersion = flutter.ndkVersion
|
|
12
|
+
|
|
13
|
+
compileOptions {
|
|
14
|
+
sourceCompatibility = JavaVersion.VERSION_17
|
|
15
|
+
targetCompatibility = JavaVersion.VERSION_17
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
kotlinOptions {
|
|
19
|
+
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
defaultConfig {
|
|
23
|
+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
24
|
+
applicationId = "com.example.supabase_flutter_app"
|
|
25
|
+
// You can update the following values to match your application needs.
|
|
26
|
+
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
27
|
+
minSdk = flutter.minSdkVersion
|
|
28
|
+
targetSdk = flutter.targetSdkVersion
|
|
29
|
+
versionCode = flutter.versionCode
|
|
30
|
+
versionName = flutter.versionName
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
buildTypes {
|
|
34
|
+
release {
|
|
35
|
+
// TODO: Add your own signing config for the release build.
|
|
36
|
+
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
37
|
+
signingConfig = signingConfigs.getByName("debug")
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
flutter {
|
|
43
|
+
source = "../.."
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<!-- The INTERNET permission is required for development. Specifically,
|
|
3
|
+
the Flutter tool needs it to communicate with the running application
|
|
4
|
+
to allow setting breakpoints, to provide hot reload, etc.
|
|
5
|
+
-->
|
|
6
|
+
<uses-permission android:name="android.permission.INTERNET"/>
|
|
7
|
+
</manifest>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<application
|
|
3
|
+
android:label="Supabase Flutter App"
|
|
4
|
+
android:name="${applicationName}"
|
|
5
|
+
android:icon="@mipmap/ic_launcher">
|
|
6
|
+
<activity
|
|
7
|
+
android:name=".MainActivity"
|
|
8
|
+
android:exported="true"
|
|
9
|
+
android:launchMode="singleTop"
|
|
10
|
+
android:taskAffinity=""
|
|
11
|
+
android:theme="@style/LaunchTheme"
|
|
12
|
+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
13
|
+
android:hardwareAccelerated="true"
|
|
14
|
+
android:windowSoftInputMode="adjustResize">
|
|
15
|
+
<!-- Specifies an Android theme to apply to this Activity as soon as
|
|
16
|
+
the Android process has started. This theme is visible to the user
|
|
17
|
+
while the Flutter UI initializes. After that, this theme continues
|
|
18
|
+
to determine the Window background behind the Flutter UI. -->
|
|
19
|
+
<meta-data
|
|
20
|
+
android:name="io.flutter.embedding.android.NormalTheme"
|
|
21
|
+
android:resource="@style/NormalTheme"
|
|
22
|
+
/>
|
|
23
|
+
<intent-filter>
|
|
24
|
+
<action android:name="android.intent.action.MAIN"/>
|
|
25
|
+
<category android:name="android.intent.category.LAUNCHER"/>
|
|
26
|
+
</intent-filter>
|
|
27
|
+
<!-- Deep Links Configuration -->
|
|
28
|
+
<intent-filter>
|
|
29
|
+
<action android:name="android.intent.action.VIEW" />
|
|
30
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
31
|
+
<category android:name="android.intent.category.BROWSABLE" />
|
|
32
|
+
<data
|
|
33
|
+
android:scheme="io.supabase.flutterquickstart"
|
|
34
|
+
android:host="login-callback" />
|
|
35
|
+
</intent-filter>
|
|
36
|
+
</activity>
|
|
37
|
+
<!-- Don't delete the meta-data below.
|
|
38
|
+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
|
39
|
+
<meta-data
|
|
40
|
+
android:name="flutterEmbedding"
|
|
41
|
+
android:value="2" />
|
|
42
|
+
</application>
|
|
43
|
+
<!-- Required to query activities that can process text, see:
|
|
44
|
+
https://developer.android.com/training/package-visibility and
|
|
45
|
+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
|
46
|
+
|
|
47
|
+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
|
48
|
+
<queries>
|
|
49
|
+
<intent>
|
|
50
|
+
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
|
51
|
+
<data android:mimeType="text/plain"/>
|
|
52
|
+
</intent>
|
|
53
|
+
</queries>
|
|
54
|
+
</manifest>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Modify this file to customize your launch splash screen -->
|
|
3
|
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
4
|
+
<item android:drawable="@android:color/white" />
|
|
5
|
+
|
|
6
|
+
<!-- You can insert your own image assets here -->
|
|
7
|
+
<!-- <item>
|
|
8
|
+
<bitmap
|
|
9
|
+
android:gravity="center"
|
|
10
|
+
android:src="@mipmap/launch_image" />
|
|
11
|
+
</item> -->
|
|
12
|
+
</layer-list>
|