From 89696dcd9b1dd2397cb1cc561d6af69dc53aa893 Mon Sep 17 00:00:00 2001 From: tk Date: Sat, 16 Aug 2025 11:58:34 +0200 Subject: [PATCH] reinit as serverpod project --- .../.github/workflows/deployment-aws.yml | 75 ++ .../.github/workflows/deployment-gcp.yml | 99 ++ wien_talks/README.md | 16 - wien_talks/lib/main.dart | 122 -- wien_talks/test/widget_test.dart | 30 - wien_talks/wien_talks_client/.gitignore | 13 + wien_talks/wien_talks_client/CHANGELOG.md | 3 + wien_talks/wien_talks_client/README.md | 5 + .../wien_talks_client/analysis_options.yaml | 13 + .../wien_talks_client/dartdoc_options.yaml | 5 + wien_talks/wien_talks_client/doc/endpoint.md | 15 + .../lib/src/protocol/client.dart | 71 + .../lib/src/protocol/greeting.dart | 95 ++ .../lib/src/protocol/protocol.dart | 60 + .../lib/wien_talks_client.dart | 2 + wien_talks/wien_talks_client/pubspec.yaml | 8 + .../{ => wien_talks_flutter}/.gitignore | 10 +- wien_talks/{ => wien_talks_flutter}/.metadata | 0 wien_talks/wien_talks_flutter/README.md | 15 + .../analysis_options.yaml | 4 +- .../android/.gitignore | 0 .../android/app/build.gradle.kts | 4 +- .../android/app/src/debug/AndroidManifest.xml | 0 .../android/app/src/main/AndroidManifest.xml | 2 +- .../wien_talks_flutter}/MainActivity.kt | 2 +- .../res/drawable-v21/launch_background.xml | 0 .../main/res/drawable/launch_background.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../app/src/main/res/values-night/styles.xml | 0 .../app/src/main/res/values/styles.xml | 0 .../app/src/profile/AndroidManifest.xml | 0 .../android/build.gradle.kts | 0 .../android/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../android/settings.gradle.kts | 0 .../{ => wien_talks_flutter}/ios/.gitignore | 0 .../ios/Flutter/AppFrameworkInfo.plist | 0 .../ios/Flutter/Debug.xcconfig | 0 .../ios/Flutter/Release.xcconfig | 0 .../ios/Runner.xcodeproj/project.pbxproj | 12 +- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/WorkspaceSettings.xcsettings | 0 .../xcshareddata/xcschemes/Runner.xcscheme | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/WorkspaceSettings.xcsettings | 0 .../ios/Runner/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../Icon-App-1024x1024@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin .../Icon-App-83.5x83.5@2x.png | Bin .../LaunchImage.imageset/Contents.json | 0 .../LaunchImage.imageset/LaunchImage.png | Bin .../LaunchImage.imageset/LaunchImage@2x.png | Bin .../LaunchImage.imageset/LaunchImage@3x.png | Bin .../LaunchImage.imageset/README.md | 0 .../Runner/Base.lproj/LaunchScreen.storyboard | 0 .../ios/Runner/Base.lproj/Main.storyboard | 0 .../ios/Runner/Info.plist | 4 +- .../ios/Runner/Runner-Bridging-Header.h | 0 .../ios/RunnerTests/RunnerTests.swift | 0 wien_talks/wien_talks_flutter/lib/main.dart | 145 ++ .../{ => wien_talks_flutter}/linux/.gitignore | 0 .../linux/CMakeLists.txt | 4 +- .../linux/flutter/CMakeLists.txt | 0 .../flutter/generated_plugin_registrant.cc | 11 + .../flutter/generated_plugin_registrant.h | 15 + .../linux/flutter/generated_plugins.cmake | 23 + .../linux/runner/CMakeLists.txt | 0 .../linux/runner/main.cc | 0 .../linux/runner/my_application.cc | 4 +- .../linux/runner/my_application.h | 0 .../{ => wien_talks_flutter}/macos/.gitignore | 0 .../macos/Flutter/Flutter-Debug.xcconfig | 0 .../macos/Flutter/Flutter-Release.xcconfig | 0 .../Flutter/GeneratedPluginRegistrant.swift | 12 + .../macos/Runner.xcodeproj/project.pbxproj | 18 +- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/xcschemes/Runner.xcscheme | 8 +- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../macos/Runner/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/app_icon_1024.png | Bin .../AppIcon.appiconset/app_icon_128.png | Bin .../AppIcon.appiconset/app_icon_16.png | Bin .../AppIcon.appiconset/app_icon_256.png | Bin .../AppIcon.appiconset/app_icon_32.png | Bin .../AppIcon.appiconset/app_icon_512.png | Bin .../AppIcon.appiconset/app_icon_64.png | Bin .../macos/Runner/Base.lproj/MainMenu.xib | 0 .../macos/Runner/Configs/AppInfo.xcconfig | 4 +- .../macos/Runner/Configs/Debug.xcconfig | 0 .../macos/Runner/Configs/Release.xcconfig | 0 .../macos/Runner/Configs/Warnings.xcconfig | 0 .../macos/Runner/DebugProfile.entitlements | 2 + .../macos/Runner/Info.plist | 0 .../macos/Runner/MainFlutterWindow.swift | 0 .../macos/Runner/Release.entitlements | 2 + .../macos/RunnerTests/RunnerTests.swift | 0 wien_talks/wien_talks_flutter/pubspec.lock | 409 ++++++ .../{ => wien_talks_flutter}/pubspec.yaml | 42 +- .../wien_talks_flutter/test/widget_test.dart | 15 + .../{ => wien_talks_flutter}/web/favicon.png | Bin .../web/icons/Icon-192.png | Bin .../web/icons/Icon-512.png | Bin .../web/icons/Icon-maskable-192.png | Bin .../web/icons/Icon-maskable-512.png | Bin .../{ => wien_talks_flutter}/web/index.html | 4 +- .../web/manifest.json | 4 +- .../windows/.gitignore | 0 .../windows/CMakeLists.txt | 4 +- .../windows/flutter/CMakeLists.txt | 0 .../flutter/generated_plugin_registrant.cc | 14 + .../flutter/generated_plugin_registrant.h | 15 + .../windows/flutter/generated_plugins.cmake | 24 + .../windows/runner/CMakeLists.txt | 0 .../windows/runner/Runner.rc | 8 +- .../windows/runner/flutter_window.cpp | 0 .../windows/runner/flutter_window.h | 0 .../windows/runner/main.cpp | 2 +- .../windows/runner/resource.h | 0 .../windows/runner/resources/app_icon.ico | Bin .../windows/runner/runner.exe.manifest | 0 .../windows/runner/utils.cpp | 0 .../windows/runner/utils.h | 0 .../windows/runner/win32_window.cpp | 0 .../windows/runner/win32_window.h | 0 wien_talks/wien_talks_server/.gcloudignore | 9 + wien_talks/wien_talks_server/.gitignore | 15 + wien_talks/wien_talks_server/CHANGELOG.md | 3 + wien_talks/wien_talks_server/Dockerfile | 39 + wien_talks/wien_talks_server/README.md | 15 + .../wien_talks_server}/analysis_options.yaml | 15 +- wien_talks/wien_talks_server/bin/main.dart | 7 + .../wien_talks_server/config/development.yaml | 58 + .../wien_talks_server/config/generator.yaml | 4 + .../wien_talks_server/config/production.yaml | 62 + .../wien_talks_server/config/staging.yaml | 66 + wien_talks/wien_talks_server/config/test.yaml | 55 + wien_talks/wien_talks_server/dart_test.yaml | 2 + .../deploy/aws/scripts/appspec.yml | 16 + .../deploy/aws/scripts/install_dependencies | 47 + .../deploy/aws/scripts/run_serverpod | 5 + .../deploy/aws/scripts/start_server | 19 + .../deploy/aws/terraform/balancers-staging.tf | 143 ++ .../deploy/aws/terraform/balancers.tf | 148 +++ .../aws/terraform/cloudfront-web-staging.tf | 65 + .../deploy/aws/terraform/cloudfront-web.tf | 73 + .../deploy/aws/terraform/code-deploy.tf | 98 ++ .../deploy/aws/terraform/config.auto.tfvars | 88 ++ .../deploy/aws/terraform/database.tf | 65 + .../deploy/aws/terraform/init-script.sh | 24 + .../deploy/aws/terraform/instances.tf | 102 ++ .../deploy/aws/terraform/main.tf | 17 + .../deploy/aws/terraform/redis.tf | 70 + .../deploy/aws/terraform/staging.tf | 57 + .../deploy/aws/terraform/storage.tf | 94 ++ .../deploy/aws/terraform/variables.tf | 198 +++ .../deploy/aws/terraform/vpc.tf | 18 + .../gcp/console_gcr/cloud-run-deploy.sh | 50 + .../gcp/terraform_gce/config.auto.tfvars | 23 + .../deploy/gcp/terraform_gce/main.tf | 95 ++ .../deploy/gcp/terraform_gce/variables.tf | 39 + .../wien_talks_server/docker-compose.yaml | 44 + wien_talks/wien_talks_server/lib/server.dart | 60 + .../lib/src/birthday_reminder.dart | 18 + .../lib/src/generated/endpoints.dart | 51 + .../lib/src/generated/greeting.dart | 105 ++ .../lib/src/generated/protocol.dart | 93 ++ .../lib/src/generated/protocol.yaml | 2 + .../lib/src/greeting.spy.yaml | 24 + .../lib/src/greeting_endpoint.dart | 34 + .../lib/src/web/routes/root.dart | 11 + .../widgets/built_with_serverpod_page.dart | 11 + .../20250816095813247/definition.json | 1153 ++++++++++++++++ .../20250816095813247/definition.sql | 257 ++++ .../20250816095813247/definition_project.json | 11 + .../20250816095813247/migration.json | 1182 +++++++++++++++++ .../20250816095813247/migration.sql | 257 ++++ .../migrations/migration_registry.txt | 7 + .../wien_talks_server}/pubspec.lock | 182 ++- wien_talks/wien_talks_server/pubspec.yaml | 16 + .../integration/greeting_endpoint_test.dart | 24 + .../test_tools/serverpod_test_tools.dart | 159 +++ .../web/static/css/style.css | 76 ++ .../web/static/images/background.svg | 25 + .../web/static/images/serverpod-logo.svg | 34 + .../web/templates/built_with_serverpod.html | 29 + wien_talks_be/.gitignore | 3 - wien_talks_be/CHANGELOG.md | 3 - wien_talks_be/README.md | 2 - wien_talks_be/bin/wien_talks_be.dart | 5 - wien_talks_be/lib/wien_talks_be.dart | 3 - wien_talks_be/pubspec.yaml | 15 - wien_talks_be/test/wien_talks_be_test.dart | 8 - 213 files changed, 6992 insertions(+), 290 deletions(-) create mode 100644 wien_talks/.github/workflows/deployment-aws.yml create mode 100644 wien_talks/.github/workflows/deployment-gcp.yml delete mode 100644 wien_talks/README.md delete mode 100644 wien_talks/lib/main.dart delete mode 100644 wien_talks/test/widget_test.dart create mode 100644 wien_talks/wien_talks_client/.gitignore create mode 100644 wien_talks/wien_talks_client/CHANGELOG.md create mode 100644 wien_talks/wien_talks_client/README.md create mode 100644 wien_talks/wien_talks_client/analysis_options.yaml create mode 100644 wien_talks/wien_talks_client/dartdoc_options.yaml create mode 100644 wien_talks/wien_talks_client/doc/endpoint.md create mode 100644 wien_talks/wien_talks_client/lib/src/protocol/client.dart create mode 100644 wien_talks/wien_talks_client/lib/src/protocol/greeting.dart create mode 100644 wien_talks/wien_talks_client/lib/src/protocol/protocol.dart create mode 100644 wien_talks/wien_talks_client/lib/wien_talks_client.dart create mode 100644 wien_talks/wien_talks_client/pubspec.yaml rename wien_talks/{ => wien_talks_flutter}/.gitignore (88%) rename wien_talks/{ => wien_talks_flutter}/.metadata (100%) create mode 100644 wien_talks/wien_talks_flutter/README.md rename wien_talks/{ => wien_talks_flutter}/analysis_options.yaml (93%) rename wien_talks/{ => wien_talks_flutter}/android/.gitignore (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/build.gradle.kts (92%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/debug/AndroidManifest.xml (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/AndroidManifest.xml (98%) rename wien_talks/{android/app/src/main/kotlin/com/example/wien_talks => wien_talks_flutter/android/app/src/main/kotlin/com/example/wien_talks_flutter}/MainActivity.kt (70%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/drawable-v21/launch_background.xml (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/drawable/launch_background.xml (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/values-night/styles.xml (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/main/res/values/styles.xml (100%) rename wien_talks/{ => wien_talks_flutter}/android/app/src/profile/AndroidManifest.xml (100%) rename wien_talks/{ => wien_talks_flutter}/android/build.gradle.kts (100%) rename wien_talks/{ => wien_talks_flutter}/android/gradle.properties (100%) rename wien_talks/{ => wien_talks_flutter}/android/gradle/wrapper/gradle-wrapper.properties (100%) rename wien_talks/{ => wien_talks_flutter}/android/settings.gradle.kts (100%) rename wien_talks/{ => wien_talks_flutter}/ios/.gitignore (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Flutter/AppFrameworkInfo.plist (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Flutter/Debug.xcconfig (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Flutter/Release.xcconfig (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcodeproj/project.pbxproj (98%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcworkspace/contents.xcworkspacedata (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/AppDelegate.swift (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Base.lproj/LaunchScreen.storyboard (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Base.lproj/Main.storyboard (100%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Info.plist (95%) rename wien_talks/{ => wien_talks_flutter}/ios/Runner/Runner-Bridging-Header.h (100%) rename wien_talks/{ => wien_talks_flutter}/ios/RunnerTests/RunnerTests.swift (100%) create mode 100644 wien_talks/wien_talks_flutter/lib/main.dart rename wien_talks/{ => wien_talks_flutter}/linux/.gitignore (100%) rename wien_talks/{ => wien_talks_flutter}/linux/CMakeLists.txt (98%) rename wien_talks/{ => wien_talks_flutter}/linux/flutter/CMakeLists.txt (100%) create mode 100644 wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc create mode 100644 wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h create mode 100644 wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake rename wien_talks/{ => wien_talks_flutter}/linux/runner/CMakeLists.txt (100%) rename wien_talks/{ => wien_talks_flutter}/linux/runner/main.cc (100%) rename wien_talks/{ => wien_talks_flutter}/linux/runner/my_application.cc (97%) rename wien_talks/{ => wien_talks_flutter}/linux/runner/my_application.h (100%) rename wien_talks/{ => wien_talks_flutter}/macos/.gitignore (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Flutter/Flutter-Debug.xcconfig (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Flutter/Flutter-Release.xcconfig (100%) create mode 100644 wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift rename wien_talks/{ => wien_talks_flutter}/macos/Runner.xcodeproj/project.pbxproj (96%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (94%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner.xcworkspace/contents.xcworkspacedata (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/AppDelegate.swift (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Base.lproj/MainMenu.xib (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Configs/AppInfo.xcconfig (85%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Configs/Debug.xcconfig (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Configs/Release.xcconfig (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Configs/Warnings.xcconfig (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/DebugProfile.entitlements (86%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Info.plist (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/MainFlutterWindow.swift (100%) rename wien_talks/{ => wien_talks_flutter}/macos/Runner/Release.entitlements (81%) rename wien_talks/{ => wien_talks_flutter}/macos/RunnerTests/RunnerTests.swift (100%) create mode 100644 wien_talks/wien_talks_flutter/pubspec.lock rename wien_talks/{ => wien_talks_flutter}/pubspec.yaml (63%) create mode 100644 wien_talks/wien_talks_flutter/test/widget_test.dart rename wien_talks/{ => wien_talks_flutter}/web/favicon.png (100%) rename wien_talks/{ => wien_talks_flutter}/web/icons/Icon-192.png (100%) rename wien_talks/{ => wien_talks_flutter}/web/icons/Icon-512.png (100%) rename wien_talks/{ => wien_talks_flutter}/web/icons/Icon-maskable-192.png (100%) rename wien_talks/{ => wien_talks_flutter}/web/icons/Icon-maskable-512.png (100%) rename wien_talks/{ => wien_talks_flutter}/web/index.html (91%) rename wien_talks/{ => wien_talks_flutter}/web/manifest.json (92%) rename wien_talks/{ => wien_talks_flutter}/windows/.gitignore (100%) rename wien_talks/{ => wien_talks_flutter}/windows/CMakeLists.txt (98%) rename wien_talks/{ => wien_talks_flutter}/windows/flutter/CMakeLists.txt (100%) create mode 100644 wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc create mode 100644 wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h create mode 100644 wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake rename wien_talks/{ => wien_talks_flutter}/windows/runner/CMakeLists.txt (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/Runner.rc (91%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/flutter_window.cpp (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/flutter_window.h (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/main.cpp (95%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/resource.h (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/resources/app_icon.ico (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/runner.exe.manifest (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/utils.cpp (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/utils.h (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/win32_window.cpp (100%) rename wien_talks/{ => wien_talks_flutter}/windows/runner/win32_window.h (100%) create mode 100644 wien_talks/wien_talks_server/.gcloudignore create mode 100644 wien_talks/wien_talks_server/.gitignore create mode 100644 wien_talks/wien_talks_server/CHANGELOG.md create mode 100644 wien_talks/wien_talks_server/Dockerfile create mode 100644 wien_talks/wien_talks_server/README.md rename {wien_talks_be => wien_talks/wien_talks_server}/analysis_options.yaml (84%) create mode 100644 wien_talks/wien_talks_server/bin/main.dart create mode 100644 wien_talks/wien_talks_server/config/development.yaml create mode 100644 wien_talks/wien_talks_server/config/generator.yaml create mode 100644 wien_talks/wien_talks_server/config/production.yaml create mode 100644 wien_talks/wien_talks_server/config/staging.yaml create mode 100644 wien_talks/wien_talks_server/config/test.yaml create mode 100644 wien_talks/wien_talks_server/dart_test.yaml create mode 100644 wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml create mode 100644 wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies create mode 100644 wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod create mode 100644 wien_talks/wien_talks_server/deploy/aws/scripts/start_server create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/config.auto.tfvars create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/database.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/main.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf create mode 100644 wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf create mode 100644 wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh create mode 100644 wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars create mode 100644 wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf create mode 100644 wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf create mode 100644 wien_talks/wien_talks_server/docker-compose.yaml create mode 100644 wien_talks/wien_talks_server/lib/server.dart create mode 100644 wien_talks/wien_talks_server/lib/src/birthday_reminder.dart create mode 100644 wien_talks/wien_talks_server/lib/src/generated/endpoints.dart create mode 100644 wien_talks/wien_talks_server/lib/src/generated/greeting.dart create mode 100644 wien_talks/wien_talks_server/lib/src/generated/protocol.dart create mode 100644 wien_talks/wien_talks_server/lib/src/generated/protocol.yaml create mode 100644 wien_talks/wien_talks_server/lib/src/greeting.spy.yaml create mode 100644 wien_talks/wien_talks_server/lib/src/greeting_endpoint.dart create mode 100644 wien_talks/wien_talks_server/lib/src/web/routes/root.dart create mode 100644 wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart create mode 100644 wien_talks/wien_talks_server/migrations/20250816095813247/definition.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816095813247/migration.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql create mode 100644 wien_talks/wien_talks_server/migrations/migration_registry.txt rename {wien_talks_be => wien_talks/wien_talks_server}/pubspec.lock (68%) create mode 100644 wien_talks/wien_talks_server/pubspec.yaml create mode 100644 wien_talks/wien_talks_server/test/integration/greeting_endpoint_test.dart create mode 100644 wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart create mode 100644 wien_talks/wien_talks_server/web/static/css/style.css create mode 100644 wien_talks/wien_talks_server/web/static/images/background.svg create mode 100644 wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg create mode 100644 wien_talks/wien_talks_server/web/templates/built_with_serverpod.html delete mode 100644 wien_talks_be/.gitignore delete mode 100644 wien_talks_be/CHANGELOG.md delete mode 100644 wien_talks_be/README.md delete mode 100644 wien_talks_be/bin/wien_talks_be.dart delete mode 100644 wien_talks_be/lib/wien_talks_be.dart delete mode 100644 wien_talks_be/pubspec.yaml delete mode 100644 wien_talks_be/test/wien_talks_be_test.dart diff --git a/wien_talks/.github/workflows/deployment-aws.yml b/wien_talks/.github/workflows/deployment-aws.yml new file mode 100644 index 0000000..ea95cd7 --- /dev/null +++ b/wien_talks/.github/workflows/deployment-aws.yml @@ -0,0 +1,75 @@ +name: Deploy to AWS +on: + push: + branches: [ deployment-aws-production, deployment-aws-staging ] + workflow_dispatch: + inputs: + target: + description: 'Target' + required: true + default: 'production' + type: choice + options: + - 'staging' + - 'production' +jobs: + deploy: + name: Deploy to AWS + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup Dart SDK + uses: dart-lang/setup-dart@v1.6.5 + with: + sdk: 3.5 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Create passwords file + working-directory: wien_talks_server + shell: bash + env: + SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} + run: | + pwd + echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml + ls config/ + + - name: Get Dart packages + working-directory: wien_talks_server + run: dart pub get + + - name: Compile server + working-directory: wien_talks_server + run: dart compile kernel bin/main.dart + + - name: Create CodeDeploy Deployment + id: deploy + env: + PROJECT_NAME: wien_talks + AWS_NAME: wien-talks + DEPLOYMENT_BUCKET: wien-talks-deployment-6559518 + TARGET: ${{ github.event.inputs.target }} + run: | + # Deploy server to AWS + TARGET="${TARGET:=${GITHUB_REF##*-}}" + echo "Deploying to target: $TARGET" + mkdir -p vendor + cp "${PROJECT_NAME}_server/deploy/aws/scripts/appspec.yml" appspec.yml + zip -r deployment.zip . + aws s3 cp deployment.zip "s3://${DEPLOYMENT_BUCKET}/deployment.zip" + aws deploy create-deployment \ + --application-name "${AWS_NAME}-app" \ + --deployment-group-name "${AWS_NAME}-${TARGET}-group" \ + --deployment-config-name CodeDeployDefault.OneAtATime \ + --s3-location "bucket=${DEPLOYMENT_BUCKET},key=deployment.zip,bundleType=zip" diff --git a/wien_talks/.github/workflows/deployment-gcp.yml b/wien_talks/.github/workflows/deployment-gcp.yml new file mode 100644 index 0000000..6ceedf2 --- /dev/null +++ b/wien_talks/.github/workflows/deployment-gcp.yml @@ -0,0 +1,99 @@ +name: Deploy to GCP +on: + push: + branches: [ deployment-gcp-production, deployment-gcp-staging ] + workflow_dispatch: + inputs: + target: + description: 'Target' + required: true + default: 'production' + type: choice + options: + - 'staging' + - 'production' + +env: + # TODO: Update with your Google Cloud project id. If you have changed the + # region and zone in your Terraform configuration, you will need to change + # it here too. + PROJECT: "" + REGION: us-central1 + ZONE: us-central1-c + +jobs: + deploy: + name: Deploy to Google Cloud Run + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setting Target Mode from Input + if: ${{ github.event.inputs.target != '' }} + run: echo "TARGET=${{ github.event.inputs.target }}" >> $GITHUB_ENV + + - name: Setting Target mode based on branch + if: ${{ github.event.inputs.target == '' }} + run: echo "TARGET=${GITHUB_REF##*-}" >> $GITHUB_ENV + + - name: Set repository + run: echo "REPOSITORY=serverpod-${{ env.TARGET }}-container" >> $GITHUB_ENV + + - name: Set Image Name + run: echo "IMAGE_NAME=serverpod" >> $GITHUB_ENV + + - name: Set Service Name + run: echo "SERVICE_NAME=$(echo $IMAGE_NAME | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV + + - name: Test + run: echo $SERVICE_NAME + + + - id: "auth" + name: "Authenticate to Google Cloud" + uses: "google-github-actions/auth@v1" + with: + credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}" + + - name: Create passwords file + working-directory: wien_talks_server + shell: bash + env: + SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} + run: | + pwd + echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml + ls config/ + + - name: Configure Docker + working-directory: wien_talks_server + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev + + - name: Build the Docker image + working-directory: wien_talks_server + run: "docker build -t $IMAGE_NAME ." + + - name: Tag the Docker image + working-directory: wien_talks_server + run: docker tag $IMAGE_NAME ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME + + - name: Push Docker image + working-directory: wien_talks_server + run: docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME + + # Uncomment the following code to automatically restart the servers in the + # instance group when you push a new version of your code. Before doing + # this, make sure that you have successfully deployed a first version. + # + # - name: Restart servers in instance group + # run: | + # gcloud compute instance-groups managed rolling-action replace serverpod-${{ env.TARGET }}-group \ + # --project=${{ env.PROJECT }} \ + # --replacement-method='substitute' \ + # --max-surge=1 \ + # --max-unavailable=1 \ + # --zone=${{ env.ZONE }} diff --git a/wien_talks/README.md b/wien_talks/README.md deleted file mode 100644 index a9ed39d..0000000 --- a/wien_talks/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# wien_talks - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/wien_talks/lib/main.dart b/wien_talks/lib/main.dart deleted file mode 100644 index 7b7f5b6..0000000 --- a/wien_talks/lib/main.dart +++ /dev/null @@ -1,122 +0,0 @@ -import 'package:flutter/material.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({super.key}); - - // This widget is the root of your application. - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - // This is the theme of your application. - // - // TRY THIS: Try running your application with "flutter run". You'll see - // the application has a purple toolbar. Then, without quitting the app, - // try changing the seedColor in the colorScheme below to Colors.green - // and then invoke "hot reload" (save your changes or press the "hot - // reload" button in a Flutter-supported IDE, or press "r" if you used - // the command line to start the app). - // - // Notice that the counter didn't reset back to zero; the application - // state is not lost during the reload. To reset the state, use hot - // restart instead. - // - // This works for code too, not just values: Most code changes can be - // tested with just a hot reload. - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), - ); - } -} - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // TRY THIS: Try changing the color here to a specific color (to - // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar - // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - // - // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" - // action in the IDE, or press "p" in the console), to see the - // wireframe for each widget. - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text('You have pushed the button this many times:'), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. - ); - } -} diff --git a/wien_talks/test/widget_test.dart b/wien_talks/test/widget_test.dart deleted file mode 100644 index a94c8c6..0000000 --- a/wien_talks/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:wien_talks/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/wien_talks/wien_talks_client/.gitignore b/wien_talks/wien_talks_client/.gitignore new file mode 100644 index 0000000..a375a6b --- /dev/null +++ b/wien_talks/wien_talks_client/.gitignore @@ -0,0 +1,13 @@ +# Files and directories created by pub +.dart_tool/ +.packages + +# Omit committing pubspec.lock for library packages: +# https://dart.dev/guides/libraries/private-files#pubspeclock +pubspec.lock + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ diff --git a/wien_talks/wien_talks_client/CHANGELOG.md b/wien_talks/wien_talks_client/CHANGELOG.md new file mode 100644 index 0000000..687440b --- /dev/null +++ b/wien_talks/wien_talks_client/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version, created by Stagehand diff --git a/wien_talks/wien_talks_client/README.md b/wien_talks/wien_talks_client/README.md new file mode 100644 index 0000000..37150ed --- /dev/null +++ b/wien_talks/wien_talks_client/README.md @@ -0,0 +1,5 @@ +# wien_talks_client + +This is your Serverpod client. The code in here is mostly generated by +Serverpod, but you may want to make changes if you are adding modules to your +project. diff --git a/wien_talks/wien_talks_client/analysis_options.yaml b/wien_talks/wien_talks_client/analysis_options.yaml new file mode 100644 index 0000000..8d78563 --- /dev/null +++ b/wien_talks/wien_talks_client/analysis_options.yaml @@ -0,0 +1,13 @@ +# Defines a default set of lint rules enforced for +# projects at Google. For details and rationale, +# see https://github.com/dart-lang/pedantic#enabled-lints. + +# For lint rules and documentation, see http://dart-lang.github.io/linter/lints. +# Uncomment to specify additional rules. +# linter: +# rules: +# - camel_case_types + +analyzer: + exclude: + - lib/src/protocol/** diff --git a/wien_talks/wien_talks_client/dartdoc_options.yaml b/wien_talks/wien_talks_client/dartdoc_options.yaml new file mode 100644 index 0000000..035db99 --- /dev/null +++ b/wien_talks/wien_talks_client/dartdoc_options.yaml @@ -0,0 +1,5 @@ +dartdoc: + categories: + "Endpoint": + markdown: doc/endpoint.md + name: Endpoint \ No newline at end of file diff --git a/wien_talks/wien_talks_client/doc/endpoint.md b/wien_talks/wien_talks_client/doc/endpoint.md new file mode 100644 index 0000000..8582b12 --- /dev/null +++ b/wien_talks/wien_talks_client/doc/endpoint.md @@ -0,0 +1,15 @@ +# Callable endpoints + +Each class contains callable methods that will call a method on the server side. These are normally defined in the `endpoint` directory in your server project. This client sends requests to these endpoints and returns the result. + +Example usage: + +```dart +// How to use GreetingEndpoint. +client.greeting.hello("world!"); + +// Generic format. +client..(...); +``` + +Please see the full official documentation [here](https://docs.serverpod.dev) diff --git a/wien_talks/wien_talks_client/lib/src/protocol/client.dart b/wien_talks/wien_talks_client/lib/src/protocol/client.dart new file mode 100644 index 0000000..7fa2180 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/client.dart @@ -0,0 +1,71 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _i1; +import 'dart:async' as _i2; +import 'package:wien_talks_client/src/protocol/greeting.dart' as _i3; +import 'protocol.dart' as _i4; + +/// This is an example endpoint that returns a greeting message through +/// its [hello] method. +/// {@category Endpoint} +class EndpointGreeting extends _i1.EndpointRef { + EndpointGreeting(_i1.EndpointCaller caller) : super(caller); + + @override + String get name => 'greeting'; + + /// Returns a personalized greeting message: "Hello {name}". + _i2.Future<_i3.Greeting> hello(String name) => + caller.callServerEndpoint<_i3.Greeting>( + 'greeting', + 'hello', + {'name': name}, + ); +} + +class Client extends _i1.ServerpodClientShared { + Client( + String host, { + dynamic securityContext, + _i1.AuthenticationKeyManager? authenticationKeyManager, + Duration? streamingConnectionTimeout, + Duration? connectionTimeout, + Function( + _i1.MethodCallContext, + Object, + StackTrace, + )? onFailedCall, + Function(_i1.MethodCallContext)? onSucceededCall, + bool? disconnectStreamsOnLostInternetConnection, + }) : super( + host, + _i4.Protocol(), + securityContext: securityContext, + authenticationKeyManager: authenticationKeyManager, + streamingConnectionTimeout: streamingConnectionTimeout, + connectionTimeout: connectionTimeout, + onFailedCall: onFailedCall, + onSucceededCall: onSucceededCall, + disconnectStreamsOnLostInternetConnection: + disconnectStreamsOnLostInternetConnection, + ) { + greeting = EndpointGreeting(this); + } + + late final EndpointGreeting greeting; + + @override + Map get endpointRefLookup => {'greeting': greeting}; + + @override + Map get moduleLookup => {}; +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/greeting.dart b/wien_talks/wien_talks_client/lib/src/protocol/greeting.dart new file mode 100644 index 0000000..bb85a81 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/greeting.dart @@ -0,0 +1,95 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _i1; + +/// A greeting message which can be sent to or from the server. +abstract class Greeting implements _i1.SerializableModel { + Greeting._({ + required this.message, + required this.author, + required this.timestamp, + }); + + factory Greeting({ + required String message, + required String author, + required DateTime timestamp, + }) = _GreetingImpl; + + factory Greeting.fromJson(Map jsonSerialization) { + return Greeting( + message: jsonSerialization['message'] as String, + author: jsonSerialization['author'] as String, + timestamp: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['timestamp']), + ); + } + + /// The greeting message. + String message; + + /// The author of the greeting message. + String author; + + /// The time when the message was created. + DateTime timestamp; + + /// Returns a shallow copy of this [Greeting] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Greeting copyWith({ + String? message, + String? author, + DateTime? timestamp, + }); + @override + Map toJson() { + return { + 'message': message, + 'author': author, + 'timestamp': timestamp.toJson(), + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _GreetingImpl extends Greeting { + _GreetingImpl({ + required String message, + required String author, + required DateTime timestamp, + }) : super._( + message: message, + author: author, + timestamp: timestamp, + ); + + /// Returns a shallow copy of this [Greeting] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Greeting copyWith({ + String? message, + String? author, + DateTime? timestamp, + }) { + return Greeting( + message: message ?? this.message, + author: author ?? this.author, + timestamp: timestamp ?? this.timestamp, + ); + } +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart b/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart new file mode 100644 index 0000000..92603c6 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart @@ -0,0 +1,60 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _i1; +import 'greeting.dart' as _i2; +export 'greeting.dart'; +export 'client.dart'; + +class Protocol extends _i1.SerializationManager { + Protocol._(); + + factory Protocol() => _instance; + + static final Protocol _instance = Protocol._(); + + @override + T deserialize( + dynamic data, [ + Type? t, + ]) { + t ??= T; + if (t == _i2.Greeting) { + return _i2.Greeting.fromJson(data) as T; + } + if (t == _i1.getType<_i2.Greeting?>()) { + return (data != null ? _i2.Greeting.fromJson(data) : null) as T; + } + return super.deserialize(data, t); + } + + @override + String? getClassNameForObject(Object? data) { + String? className = super.getClassNameForObject(data); + if (className != null) return className; + if (data is _i2.Greeting) { + return 'Greeting'; + } + return null; + } + + @override + dynamic deserializeByClassName(Map data) { + var dataClassName = data['className']; + if (dataClassName is! String) { + return super.deserializeByClassName(data); + } + if (dataClassName == 'Greeting') { + return deserialize<_i2.Greeting>(data['data']); + } + return super.deserializeByClassName(data); + } +} diff --git a/wien_talks/wien_talks_client/lib/wien_talks_client.dart b/wien_talks/wien_talks_client/lib/wien_talks_client.dart new file mode 100644 index 0000000..d81f69b --- /dev/null +++ b/wien_talks/wien_talks_client/lib/wien_talks_client.dart @@ -0,0 +1,2 @@ +export 'src/protocol/protocol.dart'; +export 'package:serverpod_client/serverpod_client.dart'; diff --git a/wien_talks/wien_talks_client/pubspec.yaml b/wien_talks/wien_talks_client/pubspec.yaml new file mode 100644 index 0000000..223e12d --- /dev/null +++ b/wien_talks/wien_talks_client/pubspec.yaml @@ -0,0 +1,8 @@ +name: wien_talks_client +description: Starting point for a Serverpod client. + +environment: + sdk: '>=3.5.0 <4.0.0' + +dependencies: + serverpod_client: 2.9.1 diff --git a/wien_talks/.gitignore b/wien_talks/wien_talks_flutter/.gitignore similarity index 88% rename from wien_talks/.gitignore rename to wien_talks/wien_talks_flutter/.gitignore index 79c113f..22546e2 100644 --- a/wien_talks/.gitignore +++ b/wien_talks/wien_talks_flutter/.gitignore @@ -5,12 +5,9 @@ *.swp .DS_Store .atom/ -.build/ .buildlog/ .history .svn/ -.swiftpm/ -migrate_working_dir/ # IntelliJ related *.iml @@ -29,11 +26,15 @@ migrate_working_dir/ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies +.packages .pub-cache/ .pub/ /build/ -# Symbolication related +# Web related +lib/generated_plugin_registrant.dart + +# Symbolization related app.*.symbols # Obfuscation related @@ -43,3 +44,4 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + diff --git a/wien_talks/.metadata b/wien_talks/wien_talks_flutter/.metadata similarity index 100% rename from wien_talks/.metadata rename to wien_talks/wien_talks_flutter/.metadata diff --git a/wien_talks/wien_talks_flutter/README.md b/wien_talks/wien_talks_flutter/README.md new file mode 100644 index 0000000..0a3aefb --- /dev/null +++ b/wien_talks/wien_talks_flutter/README.md @@ -0,0 +1,15 @@ +# wien_talks_flutter + +A new Flutter project with Serverpod. + +## Getting Started + +This project is a starting point for a Flutter application that is using +Serverpod. + +A great starting point for learning Serverpod is our documentation site at: +[https://docs.serverpod.dev](https://docs.serverpod.dev). + +To run the project, first make sure that the server is running, then do: + + flutter run diff --git a/wien_talks/analysis_options.yaml b/wien_talks/wien_talks_flutter/analysis_options.yaml similarity index 93% rename from wien_talks/analysis_options.yaml rename to wien_talks/wien_talks_flutter/analysis_options.yaml index 0d29021..fd16f92 100644 --- a/wien_talks/analysis_options.yaml +++ b/wien_talks/wien_talks_flutter/analysis_options.yaml @@ -13,7 +13,8 @@ linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code @@ -23,6 +24,5 @@ linter: rules: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/wien_talks/android/.gitignore b/wien_talks/wien_talks_flutter/android/.gitignore similarity index 100% rename from wien_talks/android/.gitignore rename to wien_talks/wien_talks_flutter/android/.gitignore diff --git a/wien_talks/android/app/build.gradle.kts b/wien_talks/wien_talks_flutter/android/app/build.gradle.kts similarity index 92% rename from wien_talks/android/app/build.gradle.kts rename to wien_talks/wien_talks_flutter/android/app/build.gradle.kts index 5fcf9da..c5d9579 100644 --- a/wien_talks/android/app/build.gradle.kts +++ b/wien_talks/wien_talks_flutter/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.wien_talks" + namespace = "com.example.wien_talks_flutter" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -21,7 +21,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.wien_talks" + applicationId = "com.example.wien_talks_flutter" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion diff --git a/wien_talks/android/app/src/debug/AndroidManifest.xml b/wien_talks/wien_talks_flutter/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from wien_talks/android/app/src/debug/AndroidManifest.xml rename to wien_talks/wien_talks_flutter/android/app/src/debug/AndroidManifest.xml diff --git a/wien_talks/android/app/src/main/AndroidManifest.xml b/wien_talks/wien_talks_flutter/android/app/src/main/AndroidManifest.xml similarity index 98% rename from wien_talks/android/app/src/main/AndroidManifest.xml rename to wien_talks/wien_talks_flutter/android/app/src/main/AndroidManifest.xml index d468ac2..8d61822 100644 --- a/wien_talks/android/app/src/main/AndroidManifest.xml +++ b/wien_talks/wien_talks_flutter/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Wien Talks + Wien Talks Flutter CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - wien_talks + wien_talks_flutter CFBundlePackageType APPL CFBundleShortVersionString diff --git a/wien_talks/ios/Runner/Runner-Bridging-Header.h b/wien_talks/wien_talks_flutter/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from wien_talks/ios/Runner/Runner-Bridging-Header.h rename to wien_talks/wien_talks_flutter/ios/Runner/Runner-Bridging-Header.h diff --git a/wien_talks/ios/RunnerTests/RunnerTests.swift b/wien_talks/wien_talks_flutter/ios/RunnerTests/RunnerTests.swift similarity index 100% rename from wien_talks/ios/RunnerTests/RunnerTests.swift rename to wien_talks/wien_talks_flutter/ios/RunnerTests/RunnerTests.swift diff --git a/wien_talks/wien_talks_flutter/lib/main.dart b/wien_talks/wien_talks_flutter/lib/main.dart new file mode 100644 index 0000000..69c728d --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/main.dart @@ -0,0 +1,145 @@ +import 'package:wien_talks_client/wien_talks_client.dart'; +import 'package:flutter/material.dart'; +import 'package:serverpod_flutter/serverpod_flutter.dart'; + +/// Sets up a global client object that can be used to talk to the server from +/// anywhere in our app. The client is generated from your server code +/// and is set up to connect to a Serverpod running on a local server on +/// the default port. You will need to modify this to connect to staging or +/// production servers. +/// In a larger app, you may want to use the dependency injection of your choice +/// instead of using a global client object. This is just a simple example. +late final Client client; + +late String serverUrl; + +void main() { + // When you are running the app on a physical device, you need to set the + // server URL to the IP address of your computer. You can find the IP + // address by running `ipconfig` on Windows or `ifconfig` on Mac/Linux. + // You can set the variable when running or building your app like this: + // E.g. `flutter run --dart-define=SERVER_URL=https://api.example.com/` + const serverUrlFromEnv = String.fromEnvironment('SERVER_URL'); + final serverUrl = + serverUrlFromEnv.isEmpty ? 'http://$localhost:8080/' : serverUrlFromEnv; + + client = Client(serverUrl) + ..connectivityMonitor = FlutterConnectivityMonitor(); + + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Serverpod Demo', + theme: ThemeData(primarySwatch: Colors.blue), + home: const MyHomePage(title: 'Serverpod Example'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + final String title; + + @override + MyHomePageState createState() => MyHomePageState(); +} + +class MyHomePageState extends State { + /// Holds the last result or null if no result exists yet. + String? _resultMessage; + + /// Holds the last error message that we've received from the server or null + /// if no error exists yet. + String? _errorMessage; + + final _textEditingController = TextEditingController(); + + /// Calls the `hello` method of the `greeting` endpoint. Will set either the + /// `_resultMessage` or `_errorMessage` field, depending on if the call + /// is successful. + void _callHello() async { + try { + final result = await client.greeting.hello(_textEditingController.text); + setState(() { + _errorMessage = null; + _resultMessage = result.message; + }); + } catch (e) { + setState(() { + _errorMessage = '$e'; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text(widget.title)), + body: Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only(bottom: 16.0), + child: TextField( + controller: _textEditingController, + decoration: const InputDecoration(hintText: 'Enter your name'), + ), + ), + Padding( + padding: const EdgeInsets.only(bottom: 16.0), + child: ElevatedButton( + onPressed: _callHello, + child: const Text('Send to Server'), + ), + ), + ResultDisplay( + resultMessage: _resultMessage, + errorMessage: _errorMessage, + ), + ], + ), + ), + ); + } +} + +/// ResultDisplays shows the result of the call. Either the returned result +/// from the `example.greeting` endpoint method or an error message. +class ResultDisplay extends StatelessWidget { + final String? resultMessage; + final String? errorMessage; + + const ResultDisplay({super.key, this.resultMessage, this.errorMessage}); + + @override + Widget build(BuildContext context) { + String text; + Color backgroundColor; + if (errorMessage != null) { + backgroundColor = Colors.red[300]!; + text = errorMessage!; + } else if (resultMessage != null) { + backgroundColor = Colors.green[300]!; + text = resultMessage!; + } else { + backgroundColor = Colors.grey[300]!; + text = 'No server response yet.'; + } + + return ConstrainedBox( + constraints: const BoxConstraints(minHeight: 50), + child: Container( + color: backgroundColor, + child: Center(child: Text(text)), + ), + ); + } +} diff --git a/wien_talks/linux/.gitignore b/wien_talks/wien_talks_flutter/linux/.gitignore similarity index 100% rename from wien_talks/linux/.gitignore rename to wien_talks/wien_talks_flutter/linux/.gitignore diff --git a/wien_talks/linux/CMakeLists.txt b/wien_talks/wien_talks_flutter/linux/CMakeLists.txt similarity index 98% rename from wien_talks/linux/CMakeLists.txt rename to wien_talks/wien_talks_flutter/linux/CMakeLists.txt index 5783f68..e745e52 100644 --- a/wien_talks/linux/CMakeLists.txt +++ b/wien_talks/wien_talks_flutter/linux/CMakeLists.txt @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "wien_talks") +set(BINARY_NAME "wien_talks_flutter") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.wien_talks") +set(APPLICATION_ID "com.example.wien_talks_flutter") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/wien_talks/linux/flutter/CMakeLists.txt b/wien_talks/wien_talks_flutter/linux/flutter/CMakeLists.txt similarity index 100% rename from wien_talks/linux/flutter/CMakeLists.txt rename to wien_talks/wien_talks_flutter/linux/flutter/CMakeLists.txt diff --git a/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..e71a16d --- /dev/null +++ b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..2e1de87 --- /dev/null +++ b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/wien_talks/linux/runner/CMakeLists.txt b/wien_talks/wien_talks_flutter/linux/runner/CMakeLists.txt similarity index 100% rename from wien_talks/linux/runner/CMakeLists.txt rename to wien_talks/wien_talks_flutter/linux/runner/CMakeLists.txt diff --git a/wien_talks/linux/runner/main.cc b/wien_talks/wien_talks_flutter/linux/runner/main.cc similarity index 100% rename from wien_talks/linux/runner/main.cc rename to wien_talks/wien_talks_flutter/linux/runner/main.cc diff --git a/wien_talks/linux/runner/my_application.cc b/wien_talks/wien_talks_flutter/linux/runner/my_application.cc similarity index 97% rename from wien_talks/linux/runner/my_application.cc rename to wien_talks/wien_talks_flutter/linux/runner/my_application.cc index 5f266bf..cf9f64d 100644 --- a/wien_talks/linux/runner/my_application.cc +++ b/wien_talks/wien_talks_flutter/linux/runner/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "wien_talks"); + gtk_header_bar_set_title(header_bar, "wien_talks_flutter"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "wien_talks"); + gtk_window_set_title(window, "wien_talks_flutter"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/wien_talks/linux/runner/my_application.h b/wien_talks/wien_talks_flutter/linux/runner/my_application.h similarity index 100% rename from wien_talks/linux/runner/my_application.h rename to wien_talks/wien_talks_flutter/linux/runner/my_application.h diff --git a/wien_talks/macos/.gitignore b/wien_talks/wien_talks_flutter/macos/.gitignore similarity index 100% rename from wien_talks/macos/.gitignore rename to wien_talks/wien_talks_flutter/macos/.gitignore diff --git a/wien_talks/macos/Flutter/Flutter-Debug.xcconfig b/wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Debug.xcconfig similarity index 100% rename from wien_talks/macos/Flutter/Flutter-Debug.xcconfig rename to wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Debug.xcconfig diff --git a/wien_talks/macos/Flutter/Flutter-Release.xcconfig b/wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Release.xcconfig similarity index 100% rename from wien_talks/macos/Flutter/Flutter-Release.xcconfig rename to wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Release.xcconfig diff --git a/wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift b/wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..ad535f5 --- /dev/null +++ b/wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import connectivity_plus + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) +} diff --git a/wien_talks/macos/Runner.xcodeproj/project.pbxproj b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.pbxproj similarity index 96% rename from wien_talks/macos/Runner.xcodeproj/project.pbxproj rename to wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.pbxproj index 660f9ea..3ad623d 100644 --- a/wien_talks/macos/Runner.xcodeproj/project.pbxproj +++ b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* wien_talks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "wien_talks.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* wien_talks_flutter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "wien_talks_flutter.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -131,7 +131,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* wien_talks.app */, + 33CC10ED2044A3C60003C045 /* wien_talks_flutter.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -217,7 +217,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* wien_talks.app */; + productReference = 33CC10ED2044A3C60003C045 /* wien_talks_flutter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -385,10 +385,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks_flutter"; }; name = Debug; }; @@ -399,10 +399,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks_flutter"; }; name = Release; }; @@ -413,10 +413,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks_flutter"; }; name = Profile; }; diff --git a/wien_talks/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from wien_talks/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/wien_talks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 94% rename from wien_talks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 944b61b..d6b3630 100644 --- a/wien_talks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -66,7 +66,7 @@ @@ -83,7 +83,7 @@ diff --git a/wien_talks/macos/Runner.xcworkspace/contents.xcworkspacedata b/wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from wien_talks/macos/Runner.xcworkspace/contents.xcworkspacedata rename to wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/wien_talks/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from wien_talks/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/wien_talks/macos/Runner/AppDelegate.swift b/wien_talks/wien_talks_flutter/macos/Runner/AppDelegate.swift similarity index 100% rename from wien_talks/macos/Runner/AppDelegate.swift rename to wien_talks/wien_talks_flutter/macos/Runner/AppDelegate.swift diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/wien_talks/macos/Runner/Base.lproj/MainMenu.xib b/wien_talks/wien_talks_flutter/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from wien_talks/macos/Runner/Base.lproj/MainMenu.xib rename to wien_talks/wien_talks_flutter/macos/Runner/Base.lproj/MainMenu.xib diff --git a/wien_talks/macos/Runner/Configs/AppInfo.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/AppInfo.xcconfig similarity index 85% rename from wien_talks/macos/Runner/Configs/AppInfo.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/AppInfo.xcconfig index b757dda..8e125d2 100644 --- a/wien_talks/macos/Runner/Configs/AppInfo.xcconfig +++ b/wien_talks/wien_talks_flutter/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = wien_talks +PRODUCT_NAME = wien_talks_flutter // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks +PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. diff --git a/wien_talks/macos/Runner/Configs/Debug.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from wien_talks/macos/Runner/Configs/Debug.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/Debug.xcconfig diff --git a/wien_talks/macos/Runner/Configs/Release.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from wien_talks/macos/Runner/Configs/Release.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/Release.xcconfig diff --git a/wien_talks/macos/Runner/Configs/Warnings.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from wien_talks/macos/Runner/Configs/Warnings.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/Warnings.xcconfig diff --git a/wien_talks/macos/Runner/DebugProfile.entitlements b/wien_talks/wien_talks_flutter/macos/Runner/DebugProfile.entitlements similarity index 86% rename from wien_talks/macos/Runner/DebugProfile.entitlements rename to wien_talks/wien_talks_flutter/macos/Runner/DebugProfile.entitlements index dddb8a3..3ba6c12 100644 --- a/wien_talks/macos/Runner/DebugProfile.entitlements +++ b/wien_talks/wien_talks_flutter/macos/Runner/DebugProfile.entitlements @@ -6,6 +6,8 @@ com.apple.security.cs.allow-jit + com.apple.security.network.client + com.apple.security.network.server diff --git a/wien_talks/macos/Runner/Info.plist b/wien_talks/wien_talks_flutter/macos/Runner/Info.plist similarity index 100% rename from wien_talks/macos/Runner/Info.plist rename to wien_talks/wien_talks_flutter/macos/Runner/Info.plist diff --git a/wien_talks/macos/Runner/MainFlutterWindow.swift b/wien_talks/wien_talks_flutter/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from wien_talks/macos/Runner/MainFlutterWindow.swift rename to wien_talks/wien_talks_flutter/macos/Runner/MainFlutterWindow.swift diff --git a/wien_talks/macos/Runner/Release.entitlements b/wien_talks/wien_talks_flutter/macos/Runner/Release.entitlements similarity index 81% rename from wien_talks/macos/Runner/Release.entitlements rename to wien_talks/wien_talks_flutter/macos/Runner/Release.entitlements index 852fa1a..ee95ab7 100644 --- a/wien_talks/macos/Runner/Release.entitlements +++ b/wien_talks/wien_talks_flutter/macos/Runner/Release.entitlements @@ -4,5 +4,7 @@ com.apple.security.app-sandbox + com.apple.security.network.client + diff --git a/wien_talks/macos/RunnerTests/RunnerTests.swift b/wien_talks/wien_talks_flutter/macos/RunnerTests/RunnerTests.swift similarity index 100% rename from wien_talks/macos/RunnerTests/RunnerTests.swift rename to wien_talks/wien_talks_flutter/macos/RunnerTests/RunnerTests.swift diff --git a/wien_talks/wien_talks_flutter/pubspec.lock b/wien_talks/wien_talks_flutter/pubspec.lock new file mode 100644 index 0000000..f06f119 --- /dev/null +++ b/wien_talks/wien_talks_flutter/pubspec.lock @@ -0,0 +1,409 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: b5e72753cf63becce2c61fd04dfe0f1c430cc5278b53a1342dc5ad839eab29ec + url: "https://pub.dev" + source: hosted + version: "6.1.5" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.dev" + source: hosted + version: "1.5.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + url: "https://pub.dev" + source: hosted + version: "10.0.9" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.dev" + source: hosted + version: "3.0.9" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + serverpod_client: + dependency: transitive + description: + name: serverpod_client + sha256: "04cb6d36730c8c24c067cde6e41551ad2dd7ae3725bbaa2756e82d2f5b345f54" + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_flutter: + dependency: "direct main" + description: + name: serverpod_flutter + sha256: "1d9c2cb511581a7fdc1fc81ac5475ef75c0cf0a1c9181308e956db4818759bb7" + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_serialization: + dependency: transitive + description: + name: serverpod_serialization + sha256: c301a5e45610c062e51e1ba580f51f3257c3404ce2dd2f7e216dccbd93869502 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 + url: "https://pub.dev" + source: hosted + version: "15.0.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + wien_talks_client: + dependency: "direct main" + description: + path: "../wien_talks_client" + relative: true + source: path + version: "0.0.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.8.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/wien_talks/pubspec.yaml b/wien_talks/wien_talks_flutter/pubspec.yaml similarity index 63% rename from wien_talks/pubspec.yaml rename to wien_talks/wien_talks_flutter/pubspec.yaml index 63ea52d..3f0110a 100644 --- a/wien_talks/pubspec.yaml +++ b/wien_talks/wien_talks_flutter/pubspec.yaml @@ -1,7 +1,8 @@ -name: wien_talks -description: "A new Flutter project." +name: wien_talks_flutter +description: A new Flutter project with Serverpod. + # The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. +# pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. @@ -11,45 +12,36 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: - sdk: ^3.8.1 + sdk: '>=3.5.0 <4.0.0' + flutter: '>=3.24.0' -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter + serverpod_flutter: 2.9.1 + wien_talks_client: + path: ../wien_talks_client + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.8 + cupertino_icons: ^1.0.5 dev_dependencies: + flutter_lints: '>=3.0.0 <7.0.0' flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^5.0.0 - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec -# The following section is specific to Flutter packages. +# The following section is specific to Flutter. flutter: # The following line ensures that the Material Icons font is @@ -63,10 +55,10 @@ flutter: # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images + # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package + # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a @@ -86,4 +78,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.dev/to/font-from-package + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/wien_talks/wien_talks_flutter/test/widget_test.dart b/wien_talks/wien_talks_flutter/test/widget_test.dart new file mode 100644 index 0000000..ac1458c --- /dev/null +++ b/wien_talks/wien_talks_flutter/test/widget_test.dart @@ -0,0 +1,15 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +// import 'package:flutter/material.dart'; +// import 'package:flutter_test/flutter_test.dart'; +// +// import 'package:PROJECTNAME_flutter/main.dart'; + +void main() { + // Add your app tests here +} diff --git a/wien_talks/web/favicon.png b/wien_talks/wien_talks_flutter/web/favicon.png similarity index 100% rename from wien_talks/web/favicon.png rename to wien_talks/wien_talks_flutter/web/favicon.png diff --git a/wien_talks/web/icons/Icon-192.png b/wien_talks/wien_talks_flutter/web/icons/Icon-192.png similarity index 100% rename from wien_talks/web/icons/Icon-192.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-192.png diff --git a/wien_talks/web/icons/Icon-512.png b/wien_talks/wien_talks_flutter/web/icons/Icon-512.png similarity index 100% rename from wien_talks/web/icons/Icon-512.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-512.png diff --git a/wien_talks/web/icons/Icon-maskable-192.png b/wien_talks/wien_talks_flutter/web/icons/Icon-maskable-192.png similarity index 100% rename from wien_talks/web/icons/Icon-maskable-192.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-maskable-192.png diff --git a/wien_talks/web/icons/Icon-maskable-512.png b/wien_talks/wien_talks_flutter/web/icons/Icon-maskable-512.png similarity index 100% rename from wien_talks/web/icons/Icon-maskable-512.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-maskable-512.png diff --git a/wien_talks/web/index.html b/wien_talks/wien_talks_flutter/web/index.html similarity index 91% rename from wien_talks/web/index.html rename to wien_talks/wien_talks_flutter/web/index.html index ade8429..29b4e1a 100644 --- a/wien_talks/web/index.html +++ b/wien_talks/wien_talks_flutter/web/index.html @@ -23,13 +23,13 @@ - + - wien_talks + wien_talks_flutter diff --git a/wien_talks/web/manifest.json b/wien_talks/wien_talks_flutter/web/manifest.json similarity index 92% rename from wien_talks/web/manifest.json rename to wien_talks/wien_talks_flutter/web/manifest.json index b8b6ffb..66c2000 100644 --- a/wien_talks/web/manifest.json +++ b/wien_talks/wien_talks_flutter/web/manifest.json @@ -1,6 +1,6 @@ { - "name": "wien_talks", - "short_name": "wien_talks", + "name": "wien_talks_flutter", + "short_name": "wien_talks_flutter", "start_url": ".", "display": "standalone", "background_color": "#0175C2", diff --git a/wien_talks/windows/.gitignore b/wien_talks/wien_talks_flutter/windows/.gitignore similarity index 100% rename from wien_talks/windows/.gitignore rename to wien_talks/wien_talks_flutter/windows/.gitignore diff --git a/wien_talks/windows/CMakeLists.txt b/wien_talks/wien_talks_flutter/windows/CMakeLists.txt similarity index 98% rename from wien_talks/windows/CMakeLists.txt rename to wien_talks/wien_talks_flutter/windows/CMakeLists.txt index 77c88ba..78f6d56 100644 --- a/wien_talks/windows/CMakeLists.txt +++ b/wien_talks/wien_talks_flutter/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(wien_talks LANGUAGES CXX) +project(wien_talks_flutter LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "wien_talks") +set(BINARY_NAME "wien_talks_flutter") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/wien_talks/windows/flutter/CMakeLists.txt b/wien_talks/wien_talks_flutter/windows/flutter/CMakeLists.txt similarity index 100% rename from wien_talks/windows/flutter/CMakeLists.txt rename to wien_talks/wien_talks_flutter/windows/flutter/CMakeLists.txt diff --git a/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..8777c93 --- /dev/null +++ b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); +} diff --git a/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..cc1361d --- /dev/null +++ b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/wien_talks/windows/runner/CMakeLists.txt b/wien_talks/wien_talks_flutter/windows/runner/CMakeLists.txt similarity index 100% rename from wien_talks/windows/runner/CMakeLists.txt rename to wien_talks/wien_talks_flutter/windows/runner/CMakeLists.txt diff --git a/wien_talks/windows/runner/Runner.rc b/wien_talks/wien_talks_flutter/windows/runner/Runner.rc similarity index 91% rename from wien_talks/windows/runner/Runner.rc rename to wien_talks/wien_talks_flutter/windows/runner/Runner.rc index e2a0e65..059c599 100644 --- a/wien_talks/windows/runner/Runner.rc +++ b/wien_talks/wien_talks_flutter/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "wien_talks" "\0" + VALUE "FileDescription", "wien_talks_flutter" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "wien_talks" "\0" + VALUE "InternalName", "wien_talks_flutter" "\0" VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "wien_talks.exe" "\0" - VALUE "ProductName", "wien_talks" "\0" + VALUE "OriginalFilename", "wien_talks_flutter.exe" "\0" + VALUE "ProductName", "wien_talks_flutter" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/wien_talks/windows/runner/flutter_window.cpp b/wien_talks/wien_talks_flutter/windows/runner/flutter_window.cpp similarity index 100% rename from wien_talks/windows/runner/flutter_window.cpp rename to wien_talks/wien_talks_flutter/windows/runner/flutter_window.cpp diff --git a/wien_talks/windows/runner/flutter_window.h b/wien_talks/wien_talks_flutter/windows/runner/flutter_window.h similarity index 100% rename from wien_talks/windows/runner/flutter_window.h rename to wien_talks/wien_talks_flutter/windows/runner/flutter_window.h diff --git a/wien_talks/windows/runner/main.cpp b/wien_talks/wien_talks_flutter/windows/runner/main.cpp similarity index 95% rename from wien_talks/windows/runner/main.cpp rename to wien_talks/wien_talks_flutter/windows/runner/main.cpp index 61843e4..04a2d6a 100644 --- a/wien_talks/windows/runner/main.cpp +++ b/wien_talks/wien_talks_flutter/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"wien_talks", origin, size)) { + if (!window.Create(L"wien_talks_flutter", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/wien_talks/windows/runner/resource.h b/wien_talks/wien_talks_flutter/windows/runner/resource.h similarity index 100% rename from wien_talks/windows/runner/resource.h rename to wien_talks/wien_talks_flutter/windows/runner/resource.h diff --git a/wien_talks/windows/runner/resources/app_icon.ico b/wien_talks/wien_talks_flutter/windows/runner/resources/app_icon.ico similarity index 100% rename from wien_talks/windows/runner/resources/app_icon.ico rename to wien_talks/wien_talks_flutter/windows/runner/resources/app_icon.ico diff --git a/wien_talks/windows/runner/runner.exe.manifest b/wien_talks/wien_talks_flutter/windows/runner/runner.exe.manifest similarity index 100% rename from wien_talks/windows/runner/runner.exe.manifest rename to wien_talks/wien_talks_flutter/windows/runner/runner.exe.manifest diff --git a/wien_talks/windows/runner/utils.cpp b/wien_talks/wien_talks_flutter/windows/runner/utils.cpp similarity index 100% rename from wien_talks/windows/runner/utils.cpp rename to wien_talks/wien_talks_flutter/windows/runner/utils.cpp diff --git a/wien_talks/windows/runner/utils.h b/wien_talks/wien_talks_flutter/windows/runner/utils.h similarity index 100% rename from wien_talks/windows/runner/utils.h rename to wien_talks/wien_talks_flutter/windows/runner/utils.h diff --git a/wien_talks/windows/runner/win32_window.cpp b/wien_talks/wien_talks_flutter/windows/runner/win32_window.cpp similarity index 100% rename from wien_talks/windows/runner/win32_window.cpp rename to wien_talks/wien_talks_flutter/windows/runner/win32_window.cpp diff --git a/wien_talks/windows/runner/win32_window.h b/wien_talks/wien_talks_flutter/windows/runner/win32_window.h similarity index 100% rename from wien_talks/windows/runner/win32_window.h rename to wien_talks/wien_talks_flutter/windows/runner/win32_window.h diff --git a/wien_talks/wien_talks_server/.gcloudignore b/wien_talks/wien_talks_server/.gcloudignore new file mode 100644 index 0000000..3d64647 --- /dev/null +++ b/wien_talks/wien_talks_server/.gcloudignore @@ -0,0 +1,9 @@ +# Files and directories created by pub +.dart_tool/ +.packages + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ diff --git a/wien_talks/wien_talks_server/.gitignore b/wien_talks/wien_talks_server/.gitignore new file mode 100644 index 0000000..e36bb12 --- /dev/null +++ b/wien_talks/wien_talks_server/.gitignore @@ -0,0 +1,15 @@ +# Files and directories created by pub +.dart_tool/ +.packages + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ + +# Passwords file +config/passwords.yaml + +# Firebase service account key for Firebase auth +config/firebase_service_account_key.json diff --git a/wien_talks/wien_talks_server/CHANGELOG.md b/wien_talks/wien_talks_server/CHANGELOG.md new file mode 100644 index 0000000..687440b --- /dev/null +++ b/wien_talks/wien_talks_server/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version, created by Stagehand diff --git a/wien_talks/wien_talks_server/Dockerfile b/wien_talks/wien_talks_server/Dockerfile new file mode 100644 index 0000000..1496f72 --- /dev/null +++ b/wien_talks/wien_talks_server/Dockerfile @@ -0,0 +1,39 @@ +# Build stage +FROM dart:3.5.0 AS build +WORKDIR /app +COPY . . + +# Install dependencies and compile the server executable +RUN dart pub get +RUN dart compile exe bin/main.dart -o bin/server + +# Final stage +FROM alpine:latest + +# Environment variables +ENV runmode=production +ENV serverid=default +ENV logging=normal +ENV role=monolith + +# Copy runtime dependencies +COPY --from=build /runtime/ / + +# Copy compiled server executable +COPY --from=build /app/bin/server server + +# Copy configuration files and resources +COPY --from=build /app/config/ config/ +COPY --from=build /app/web/ web/ +COPY --from=build /app/migrations/ migrations/ + +# This file is required to enable the endpoint log filter in Insights. +COPY --from=build /app/lib/src/generated/protocol.yaml lib/src/generated/protocol.yaml + +# Expose ports +EXPOSE 8080 +EXPOSE 8081 +EXPOSE 8082 + +# Define the entrypoint command +ENTRYPOINT ./server --mode=$runmode --server-id=$serverid --logging=$logging --role=$role diff --git a/wien_talks/wien_talks_server/README.md b/wien_talks/wien_talks_server/README.md new file mode 100644 index 0000000..f730d7e --- /dev/null +++ b/wien_talks/wien_talks_server/README.md @@ -0,0 +1,15 @@ +# wien_talks_server + +This is the starting point for your Serverpod server. + +To run your server, you first need to start Postgres and Redis. It's easiest to do with Docker. + + docker compose up --build --detach + +Then you can start the Serverpod server. + + dart bin/main.dart + +When you are finished, you can shut down Serverpod with `Ctrl-C`, then stop Postgres and Redis. + + docker compose stop diff --git a/wien_talks_be/analysis_options.yaml b/wien_talks/wien_talks_server/analysis_options.yaml similarity index 84% rename from wien_talks_be/analysis_options.yaml rename to wien_talks/wien_talks_server/analysis_options.yaml index dee8927..8847d6e 100644 --- a/wien_talks_be/analysis_options.yaml +++ b/wien_talks/wien_talks_server/analysis_options.yaml @@ -15,14 +15,15 @@ include: package:lints/recommended.yaml # Uncomment the following section to specify additional rules. -# linter: -# rules: -# - camel_case_types - -# analyzer: -# exclude: -# - path/to/excluded/files/** +linter: + rules: + unawaited_futures: true + avoid_print: true +analyzer: + exclude: + - lib/src/generated/** + - test/integration/test_tools/serverpod_test_tools.dart # For more information about the core and recommended set of lints, see # https://dart.dev/go/core-lints diff --git a/wien_talks/wien_talks_server/bin/main.dart b/wien_talks/wien_talks_server/bin/main.dart new file mode 100644 index 0000000..8b08e8e --- /dev/null +++ b/wien_talks/wien_talks_server/bin/main.dart @@ -0,0 +1,7 @@ +import 'package:wien_talks_server/server.dart'; + +/// This is the starting point for your Serverpod server. Typically, there is +/// no need to modify this file. +void main(List args) { + run(args); +} diff --git a/wien_talks/wien_talks_server/config/development.yaml b/wien_talks/wien_talks_server/config/development.yaml new file mode 100644 index 0000000..4ae91a9 --- /dev/null +++ b/wien_talks/wien_talks_server/config/development.yaml @@ -0,0 +1,58 @@ +# This is the configuration file for your local development environment. By +# default, it runs a single server on port 8080. To set up your server, you will +# need to add the name of the database you are connecting to and the user name. +# The password for the database is stored in the config/passwords.yaml. +# +# When running your server locally, the server ports are the same as the public +# facing ports. + +# Configuration for the main API server. +apiServer: + port: 8080 + publicHost: localhost + publicPort: 8080 + publicScheme: http + +# Configuration for the Insights server. +insightsServer: + port: 8081 + publicHost: localhost + publicPort: 8081 + publicScheme: http + +# Configuration for the web server. +webServer: + port: 8082 + publicHost: localhost + publicPort: 8082 + publicScheme: http + +# This is the database setup for your server. +database: + host: localhost + port: 8090 + name: wien_talks + user: postgres + #requireSsl: true # defaults to false + #isUnixSocket: true # defaults to false + +# This is the setup for Redis. +redis: + enabled: false + host: localhost + port: 8091 + #user: # defaults to empty + #requireSsl: true # defaults to false + +maxRequestSize: 524288 # The maximum size of requests allowed in bytes + +sessionLogs: + persistentEnabled: true + consoleEnabled: true + consoleLogFormat: text # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/config/generator.yaml b/wien_talks/wien_talks_server/config/generator.yaml new file mode 100644 index 0000000..74d9772 --- /dev/null +++ b/wien_talks/wien_talks_server/config/generator.yaml @@ -0,0 +1,4 @@ +type: server + +client_package_path: ../wien_talks_client +server_test_tools_path: test/integration/test_tools diff --git a/wien_talks/wien_talks_server/config/production.yaml b/wien_talks/wien_talks_server/config/production.yaml new file mode 100644 index 0000000..036949f --- /dev/null +++ b/wien_talks/wien_talks_server/config/production.yaml @@ -0,0 +1,62 @@ +# This is the configuration file for your production environment. +# Typically, you will want to route the traffic through a load balancer +# which adds SSL security through https. If you use Serverpod's standard +# Terraform scripts to deploy your server, all you need to change in +# this file is the examplepod.com domain name. + +# Configuration for the main API server. +apiServer: + port: 8080 + publicHost: api.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the Insights server. +insightsServer: + port: 8081 + publicHost: insights.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the web server. +webServer: + port: 8082 + publicHost: app.examplepod.com + publicPort: 443 + publicScheme: https + +# This is the database setup for your servers. The default for the Google Cloud +# Engine Terraform configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. database.examplepod.com. +database: + host: database.private-production.examplepod.com + port: 5432 + name: serverpod + user: postgres + requireSsl: true + #isUnixSocket: true # defaults to false + +# This is the setup for Redis. The default for the Google Cloud Engine Terraform +# configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. redis.examplepod.com. +redis: + enabled: false + host: redis.private-production.examplepod.com + port: 6379 + #user: # defaults to empty + #requireSsl: true # defaults to false + +maxRequestSize: 524288 # The maximum size of requests allowed in bytes + +sessionLogs: + consoleEnabled: false +# persistentEnabled: true +# consoleLogFormat: json # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/config/staging.yaml b/wien_talks/wien_talks_server/config/staging.yaml new file mode 100644 index 0000000..1c731b2 --- /dev/null +++ b/wien_talks/wien_talks_server/config/staging.yaml @@ -0,0 +1,66 @@ +# This is the configuration file for your staging environment. The staging +# environment is meant to resemble the production environment as much as +# possible and may connect to production databases services and data. You use it +# for final testing before deploying the production server. +# +# Typically, you will want to route the traffic through a load balancer +# which adds SSL security through https. If you use Serverpod's standard +# Terraform scripts to deploy your server, all you need to change in +# this file is the examplepod.com domain name. + +# Configuration for the main API server. +apiServer: + port: 8080 + publicHost: api-staging.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the Insights server. +insightsServer: + port: 8081 + publicHost: insights-staging.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the web server. +webServer: + port: 8082 + publicHost: app-staging.examplepod.com + publicPort: 443 + publicScheme: https + +# This is the database setup for your servers. The default for the Google Cloud +# Engine Terraform configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. database-staging.examplepod.com. +database: + host: database.private-staging.examplepod.com + port: 5432 + name: serverpod + user: postgres + requireSsl: true + #isUnixSocket: true # defaults to false + +# This is the setup for Redis. The default for the Google Cloud Engine Terraform +# configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. redis-staging.examplepod.com. +redis: + enabled: false + host: redis.private-staging.examplepod.com + port: 6379 + #user: # defaults to empty + #requireSsl: true # defaults to false + +maxRequestSize: 524288 # The maximum size of requests allowed in bytes + +sessionLogs: +# persistentEnabled: true +# consoleEnabled: true +# consoleLogFormat: json # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/config/test.yaml b/wien_talks/wien_talks_server/config/test.yaml new file mode 100644 index 0000000..1ee6c12 --- /dev/null +++ b/wien_talks/wien_talks_server/config/test.yaml @@ -0,0 +1,55 @@ +# This is the configuration file for your test environment. +# All ports are set to zero in this file which makes the server find the next available port. +# This is needed to enable running tests concurrently. To set up your server, you will +# need to add the name of the database you are connecting to and the user name. +# The password for the database is stored in the config/passwords.yaml. +# +# When running your server locally, the server ports are the same as the public +# facing ports. + +# Configuration for the main API test server. +apiServer: + port: 0 + publicHost: localhost + publicPort: 0 + publicScheme: http + +# Configuration for the Insights test server. +insightsServer: + port: 0 + publicHost: localhost + publicPort: 0 + publicScheme: http + +# Configuration for the web test server. +webServer: + port: 0 + publicHost: localhost + publicPort: 0 + publicScheme: http + +# This is the database setup for your test server. +database: + host: localhost + port: 9090 + name: wien_talks_test + user: postgres + +# This is the setup for your Redis test instance. +redis: + enabled: false + host: localhost + port: 9091 + #user: # defaults to empty + #requireSsl: true # defaults to false + +sessionLogs: + persistentEnabled: true + consoleEnabled: true +# consoleLogFormat: json # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/dart_test.yaml b/wien_talks/wien_talks_server/dart_test.yaml new file mode 100644 index 0000000..2b60c7d --- /dev/null +++ b/wien_talks/wien_talks_server/dart_test.yaml @@ -0,0 +1,2 @@ +tags: + integration: {} diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml b/wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml new file mode 100644 index 0000000..582cb3c --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml @@ -0,0 +1,16 @@ +version: 0.0 +os: linux +files: + - source: /vendor/ + destination: /home/ec2-user/serverpod/upload/vendor/ + - source: /wien_talks_server/ + destination: /home/ec2-user/serverpod/upload/wien_talks_server/ +hooks: + BeforeInstall: + - location: wien_talks_server/deploy/aws/scripts/install_dependencies + timeout: 300 + runas: root + ApplicationStart: + - location: wien_talks_server/deploy/aws/scripts/start_server + timeout: 300 + runas: root diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies b/wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies new file mode 100644 index 0000000..041de4c --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies @@ -0,0 +1,47 @@ +#!/bin/bash +set -e # Exit on any error + +# Variables for configuration +DART_VERSION=3.5.1 +USERNAME=ec2-user +WORKDIR=/home/$USERNAME +DART_INSTALL_DIR="/usr/lib/dart$DART_VERSION" + +# Uncomment the following lines if migrating from an older serverpod CLI version +# if [ -f "/etc/profile.d/script.sh" ]; then +# sudo rm /etc/profile.d/script.sh +# fi + +# Install the specified Dart version if not already installed +if [ ! -d "$DART_INSTALL_DIR" ]; then + echo "Installing Dart $DART_VERSION..." + wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/$DART_VERSION/sdk/dartsdk-linux-x64-release.zip -P /tmp + cd /tmp || exit + unzip -q dartsdk-linux-x64-release.zip + sudo mv dart-sdk/ "$DART_INSTALL_DIR" + sudo chmod -R 755 "$DART_INSTALL_DIR" + rm -rf dartsdk-linux-x64-release.zip +fi + +# Make symlink for Dart binaries +sudo ln -sf "$DART_INSTALL_DIR/bin/dart" /usr/local/bin/dart + +# Write the systemd unit file +cat > /lib/systemd/system/serverpod.service << EOF +[Unit] +Description=Serverpod server +After=network.target +Wants=network-online.target + +[Service] +User=$USERNAME +WorkingDirectory=$WORKDIR +ExecStart=$WORKDIR/serverpod/active/wien_talks_server/deploy/aws/scripts/run_serverpod +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +# Reload systemd configuration +systemctl daemon-reload diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod b/wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod new file mode 100644 index 0000000..455383d --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod @@ -0,0 +1,5 @@ +#!/bin/bash +RUNMODE=$(cat /home/ec2-user/runmode) +SERVER_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) +cd /home/ec2-user/serverpod/active/wien_talks_server +dart --old_gen_heap_size=0 run bin/main.dill --mode $RUNMODE --server-id $SERVER_ID > /home/ec2-user/serverpod.log 2> /home/ec2-user/serverpod.err diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/start_server b/wien_talks/wien_talks_server/deploy/aws/scripts/start_server new file mode 100644 index 0000000..517a411 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/start_server @@ -0,0 +1,19 @@ +#!/bin/bash + +# Make sure permissions are correct for the serverpod directory +chown -R ec2-user:ec2-user /home/ec2-user/serverpod + +# Run pub get as ec2-user +cd /home/ec2-user/serverpod/upload/wien_talks_server/ +sudo -u ec2-user dart pub get + +# Set correct permissions for start script +chmod 755 deploy/aws/scripts/run_serverpod + +# Stop the server if it's running, copy files, and restart +systemctl stop serverpod + +rm -rf /home/ec2-user/serverpod/active/ +cp -rp /home/ec2-user/serverpod/upload/ /home/ec2-user/serverpod/active/ + +systemctl start serverpod diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf new file mode 100644 index 0000000..ac78a84 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf @@ -0,0 +1,143 @@ +# API load balancer setup + +resource "aws_lb" "serverpod_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-serverpod-staging" + internal = false + load_balancer_type = "application" + security_groups = [aws_security_group.api.id] + subnets = module.vpc.public_subnets +} + +resource "aws_lb_listener" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + load_balancer_arn = aws_lb.serverpod_staging[0].arn + port = "443" + protocol = "HTTPS" + certificate_arn = var.certificate_arn + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.api_staging[0].arn + } +} + +resource "aws_lb_target_group" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-api-staging" + port = 8080 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_lb_listener_rule" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + listener_arn = aws_lb_listener.api_staging[0].arn + priority = 100 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.api_staging[0].arn + } + + condition { + host_header { + values = ["${var.subdomain_api_staging}.${var.top_domain}"] + } + } +} + +resource "aws_autoscaling_attachment" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + autoscaling_group_name = aws_autoscaling_group.staging[0].id + lb_target_group_arn = aws_lb_target_group.api_staging[0].arn +} + +resource "aws_route53_record" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_api_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod_staging[0].dns_name}"] +} + +resource "aws_lb_target_group" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-insights-staging" + port = 8081 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + autoscaling_group_name = aws_autoscaling_group.staging[0].id + lb_target_group_arn = aws_lb_target_group.insights_staging[0].arn +} + +resource "aws_lb_listener_rule" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + listener_arn = aws_lb_listener.api_staging[0].arn + priority = 99 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.insights_staging[0].arn + } + + condition { + host_header { + values = ["${var.subdomain_insights_staging}.${var.top_domain}"] + } + } +} + +resource "aws_route53_record" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_insights_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod_staging[0].dns_name}"] +} + +resource "aws_lb_target_group" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-web-staging" + port = 8082 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + autoscaling_group_name = aws_autoscaling_group.staging[0].id + lb_target_group_arn = aws_lb_target_group.web_staging[0].arn +} + + +resource "aws_lb_listener" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + load_balancer_arn = aws_lb.serverpod_staging[0].arn + port = "80" + protocol = "HTTP" + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.web_staging[0].arn + } +} diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf new file mode 100644 index 0000000..774bab0 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf @@ -0,0 +1,148 @@ +# API load balancer setup + +resource "aws_lb" "serverpod" { + name = "${var.project_name}-serverpod" + internal = false + load_balancer_type = "application" + security_groups = [aws_security_group.api.id] + subnets = module.vpc.public_subnets +} + +resource "aws_security_group" "api" { + name = "${var.project_name}-api" + ingress { + from_port = 443 + to_port = 443 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + ingress { + from_port = 80 + to_port = 80 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + vpc_id = module.vpc.vpc_id +} + +resource "aws_lb_listener" "api" { + load_balancer_arn = aws_lb.serverpod.arn + port = "443" + protocol = "HTTPS" + certificate_arn = var.certificate_arn + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.api.arn + } +} + +resource "aws_lb_target_group" "api" { + name = "${var.project_name}-api" + port = 8080 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_lb_listener_rule" "api" { + listener_arn = aws_lb_listener.api.arn + priority = 100 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.api.arn + } + + condition { + host_header { + values = ["${var.subdomain_api}.${var.top_domain}"] + } + } +} + +resource "aws_autoscaling_attachment" "api" { + autoscaling_group_name = aws_autoscaling_group.serverpod.id + lb_target_group_arn = aws_lb_target_group.api.arn +} + +resource "aws_route53_record" "api" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_api}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod.dns_name}"] +} + +# Insights load balancer rules + +resource "aws_lb_target_group" "insights" { + name = "${var.project_name}-insights" + port = 8081 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "insights" { + autoscaling_group_name = aws_autoscaling_group.serverpod.id + lb_target_group_arn = aws_lb_target_group.insights.arn +} + +resource "aws_lb_listener_rule" "insights" { + listener_arn = aws_lb_listener.api.arn + priority = 99 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.insights.arn + } + + condition { + host_header { + values = ["${var.subdomain_insights}.${var.top_domain}"] + } + } +} + +resource "aws_route53_record" "insights" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_insights}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod.dns_name}"] +} + +# Web server load balancer rules + +resource "aws_lb_target_group" "web" { + name = "${var.project_name}-web" + port = 8082 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "web" { + autoscaling_group_name = aws_autoscaling_group.serverpod.id + lb_target_group_arn = aws_lb_target_group.web.arn +} + +resource "aws_lb_listener" "web" { + load_balancer_arn = aws_lb.serverpod.arn + port = "80" + protocol = "HTTP" + # certificate_arn = var.certificate_arn + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.web.arn + } +} + diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf new file mode 100644 index 0000000..d746378 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf @@ -0,0 +1,65 @@ +locals { + alb_origin_id_staging = "${var.project_name}-web-staging" +} + +resource "aws_cloudfront_distribution" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + origin { + origin_id = local.alb_origin_id_staging + domain_name = aws_lb.serverpod_staging[0].dns_name + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "http-only" + origin_ssl_protocols = ["SSLv3"] + } + } + enabled = true + + aliases = ["${var.subdomain_web_staging}.${var.top_domain}"] + + default_cache_behavior { + allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] + cached_methods = ["HEAD", "GET"] + target_origin_id = local.alb_origin_id_staging + + forwarded_values { + query_string = true + + cookies { + forward = "all" + } + + headers = ["*"] + } + + viewer_protocol_policy = "redirect-to-https" + min_ttl = 0 + default_ttl = 0 + max_ttl = 0 + } + + price_class = "PriceClass_100" + + viewer_certificate { + acm_certificate_arn = var.cloudfront_certificate_arn + ssl_support_method = "sni-only" + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } +} + +resource "aws_route53_record" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_web_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_cloudfront_distribution.web_staging[0].domain_name}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf new file mode 100644 index 0000000..340685a --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf @@ -0,0 +1,73 @@ +locals { + alb_origin_id = "${var.project_name}-web" +} + +resource "aws_cloudfront_distribution" "web" { + origin { + origin_id = local.alb_origin_id + domain_name = aws_lb.serverpod.dns_name + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "http-only" + origin_ssl_protocols = ["SSLv3"] + } + } + enabled = true + + aliases = ["${var.subdomain_web}.${var.top_domain}", "${var.top_domain}"] + + default_cache_behavior { + allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] + cached_methods = ["HEAD", "GET"] + target_origin_id = local.alb_origin_id + + forwarded_values { + query_string = true + + cookies { + forward = "all" + } + + headers = ["*"] + } + + viewer_protocol_policy = "redirect-to-https" + min_ttl = 0 + default_ttl = 0 + max_ttl = 0 + } + + price_class = "PriceClass_100" + + viewer_certificate { + acm_certificate_arn = var.cloudfront_certificate_arn + ssl_support_method = "sni-only" + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } +} + +resource "aws_route53_record" "web" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_web}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_cloudfront_distribution.web.domain_name}"] +} + +resource "aws_route53_record" "web_top_domain" { + count = var.use_top_domain_for_web ? 1 : 0 + zone_id = var.hosted_zone_id + name = var.top_domain + type = "A" + alias { + name = aws_cloudfront_distribution.web.domain_name + zone_id = aws_cloudfront_distribution.web.hosted_zone_id + evaluate_target_health = false + } +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf new file mode 100644 index 0000000..2216a42 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf @@ -0,0 +1,98 @@ + +# Code deploy setup + +resource "aws_iam_instance_profile" "codedeploy_profile" { + name = "${var.project_name}-codedeploy-profile" + role = aws_iam_role.codedeploy_role.name +} + +resource "aws_iam_role" "codedeploy_role" { + name = "${var.project_name}-codedeploy-role" + + assume_role_policy = < AMI Catalog in your AWS console.) +# Note: For some regions the t2.micro is not available. If so, consult the AWS +# documentation to find another instance type that suits your needs. +instance_type = "t2.micro" +instance_ami = "ami-0ca285d4c2cda3300" +autoscaling_min_size = 1 +autoscaling_max_size = 1 +autoscaling_desired_capacity = 1 + + +# Setup an additional server cluster and associated load balancers for staging. +# By default, the staging server uses the same database and Redis setup as the +# production server. If you want to change this behavior you will need add +# and edit the Terraform files. +# Note: By turning this feature on, the server setup will no longer fit within +# the AWS free tier as it will use multiple server instances and load balancers. +enable_staging_server = false + +staging_instance_type = "t2.micro" +staging_autoscaling_min_size = 1 +staging_autoscaling_max_size = 1 +staging_autoscaling_desired_capacity = 1 + +# The deployment bucket name needs to be unique and can only contain lower case +# letters and dashes (no underscored allowed). +deployment_bucket_name = "wien-talks-deployment-6559518" +public_storage_bucket_name = "wien-talks-public-storage-6559518" +private_storage_bucket_name = "wien-talks-private-storage-6559518" +public_storage_bucket_name_staging = "wien-talks-public-storage-staging-6559518" +private_storage_bucket_name_staging = "wien-talks-private-storage-staging-6559518" \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/database.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/database.tf new file mode 100644 index 0000000..07db31b --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/database.tf @@ -0,0 +1,65 @@ +resource "aws_db_instance" "postgres" { + identifier = var.project_name + allocated_storage = 10 + engine = "postgres" + engine_version = "16.3" + instance_class = "db.t3.micro" + db_name = "serverpod" + username = "postgres" + password = var.DATABASE_PASSWORD_PRODUCTION + skip_final_snapshot = true + vpc_security_group_ids = [ + aws_security_group.database.id + ] + publicly_accessible = true + db_subnet_group_name = module.vpc.database_subnet_group_name +} + +resource "aws_route53_record" "database" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_database}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_db_instance.postgres.address}"] +} + +# Makes the database accessible from anywhere. +resource "aws_security_group" "database" { + name = "${var.project_name}-database" + ingress { + from_port = 5432 + to_port = 5432 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } +} + +# Staging +resource "aws_db_instance" "postgres_staging" { + count = var.enable_staging_server ? 1 : 0 + + identifier = "${var.project_name}-staging" + allocated_storage = 10 + engine = "postgres" + engine_version = "16.3" + instance_class = "db.t3.micro" + db_name = "serverpod" + username = "postgres" + password = var.DATABASE_PASSWORD_STAGING + skip_final_snapshot = true + vpc_security_group_ids = [ + aws_security_group.database.id + ] + publicly_accessible = true + db_subnet_group_name = module.vpc.database_subnet_group_name +} + +resource "aws_route53_record" "database_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_database_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_db_instance.postgres_staging[0].address}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh b/wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh new file mode 100644 index 0000000..139eabc --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh @@ -0,0 +1,24 @@ +#!/bin/bash +echo "Update yum packages" +yum update -y + +# Install yum packages +echo "Installing ruby" +yum install ruby -y +echo "Installing wget" +yum install wget -y + +# Install CodeDeploy agent +echo "Installing CodeDeploy agent" +cd /home/ec2-user +wget https://aws-codedeploy-us-west-2.s3.us-west-2.amazonaws.com/latest/install +chmod +x ./install +./install auto +rm install + +# Set runmode +echo "Setting runmode" +echo ${runmode} > /home/ec2-user/runmode +chown ec2-user:ec2-user /home/ec2-user/runmode + +echo "Setup done" diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf new file mode 100644 index 0000000..59bdd1c --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf @@ -0,0 +1,102 @@ + +# EC2 auto scaling cluster and security groups + +data "aws_availability_zones" "available" { + state = "available" +} + +# TODO: Fix? +data "aws_ami" "amazon-linux" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-ebs"] + } +} + +resource "aws_launch_configuration" "serverpod" { + name_prefix = "${var.project_name}-" + image_id = var.instance_ami + # image_id = data.aws_ami.amazon-linux.id + instance_type = var.instance_type + user_data = templatefile("init-script.sh", { runmode = "production" }) + + security_groups = [ + aws_security_group.serverpod.id, + aws_security_group.ssh.id + ] + + iam_instance_profile = aws_iam_instance_profile.codedeploy_profile.name + + lifecycle { + create_before_destroy = true + } +} + +resource "aws_autoscaling_group" "serverpod" { + min_size = var.autoscaling_min_size + max_size = var.autoscaling_max_size + desired_capacity = var.autoscaling_desired_capacity + launch_configuration = aws_launch_configuration.serverpod.name + vpc_zone_identifier = module.vpc.public_subnets + + target_group_arns = [ + aws_lb_target_group.api.arn, + aws_lb_target_group.insights.arn, + aws_lb_target_group.web.arn + ] + + tag { + key = "Name" + value = "${var.project_name}-serverpod" + propagate_at_launch = true + } + + tag { + key = "CodeDeploy" + value = var.project_name + propagate_at_launch = true + } +} + +resource "aws_security_group" "serverpod" { + name = "${var.project_name}-serverpod" + + ingress { + from_port = 8080 + to_port = 8082 + protocol = "tcp" + security_groups = [aws_security_group.api.id] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + vpc_id = module.vpc.vpc_id +} + +resource "aws_security_group" "ssh" { + name = "${var.project_name}-ssh" + + ingress { + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + vpc_id = module.vpc.vpc_id +} diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/main.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/main.tf new file mode 100644 index 0000000..224e436 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/main.tf @@ -0,0 +1,17 @@ +# Terraform and AWS setup + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.13" + } + } + + required_version = ">= 1.1.9" +} + +provider "aws" { + # profile = "default" + region = var.aws_region +} diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf new file mode 100644 index 0000000..7c10d27 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf @@ -0,0 +1,70 @@ +resource "aws_elasticache_cluster" "redis" { + count = var.enable_redis ? 1 : 0 + + cluster_id = var.project_name + engine = "redis" + node_type = "cache.t4g.micro" + num_cache_nodes = 1 + engine_version = "6.x" + port = 6379 + apply_immediately = true + security_group_ids = [aws_security_group.redis[0].id] + subnet_group_name = aws_elasticache_subnet_group.redis[0].name +} + +resource "aws_route53_record" "redis" { + count = var.enable_redis ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_redis}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_elasticache_cluster.redis[0].cache_nodes[0].address}"] +} + +# Makes Redis accessible from the serverpod only. +resource "aws_security_group" "redis" { + count = var.enable_redis ? 1 : 0 + + name = "${var.project_name}-redis" + ingress { + from_port = 6379 + to_port = 6379 + protocol = "tcp" + security_groups = [aws_security_group.serverpod.id] + } + + vpc_id = module.vpc.vpc_id +} + +resource "aws_elasticache_subnet_group" "redis" { + count = var.enable_redis ? 1 : 0 + + name = "${var.project_name}-subnet" + subnet_ids = module.vpc.public_subnets +} + +# Staging +resource "aws_elasticache_cluster" "redis_staging" { + count = var.enable_redis && var.enable_staging_server ? 1 : 0 + + cluster_id = var.project_name + engine = "redis" + node_type = "cache.t4g.micro" + num_cache_nodes = 1 + engine_version = "6.x" + port = 6379 + apply_immediately = true + security_group_ids = [aws_security_group.redis[0].id] + subnet_group_name = aws_elasticache_subnet_group.redis[0].name +} + +resource "aws_route53_record" "redis_staging" { + count = var.enable_redis && var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_redis_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_elasticache_cluster.redis_staging[0].cache_nodes[0].address}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf new file mode 100644 index 0000000..11d0db2 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf @@ -0,0 +1,57 @@ +resource "aws_launch_configuration" "staging" { + count = var.enable_staging_server ? 1 : 0 + + name_prefix = "${var.project_name}-staging-" + image_id = var.instance_ami + # image_id = data.aws_ami.amazon-linux.id + instance_type = var.staging_instance_type + user_data = templatefile("init-script.sh", { runmode = "staging" }) + + security_groups = [ + aws_security_group.serverpod.id, + aws_security_group.ssh.id + ] + + iam_instance_profile = aws_iam_instance_profile.codedeploy_profile.name + + lifecycle { + create_before_destroy = true + } +} + +resource "aws_autoscaling_group" "staging" { + count = var.enable_staging_server ? 1 : 0 + + min_size = var.staging_autoscaling_min_size + max_size = var.staging_autoscaling_max_size + desired_capacity = var.staging_autoscaling_desired_capacity + launch_configuration = aws_launch_configuration.staging[0].name + vpc_zone_identifier = module.vpc.public_subnets + + target_group_arns = [ + aws_lb_target_group.api_staging[0].arn, + aws_lb_target_group.insights_staging[0].arn, + aws_lb_target_group.web_staging[0].arn + ] + + tag { + key = "Name" + value = "${var.project_name}-serverpod-staging" + propagate_at_launch = true + } + + tag { + key = "CodeDeploy" + value = "${var.project_name}-staging" + propagate_at_launch = true + } +} + +resource "aws_codedeploy_deployment_group" "staging" { + count = var.enable_staging_server ? 1 : 0 + + app_name = aws_codedeploy_app.serverpod.name + deployment_group_name = "${var.project_name}-staging-group" + service_role_arn = aws_iam_role.codedeploy_role.arn + autoscaling_groups = [aws_autoscaling_group.staging[0].id] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf new file mode 100644 index 0000000..6f122c3 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf @@ -0,0 +1,94 @@ +# S3 buckets +resource "aws_s3_bucket" "public_storage" { + bucket = var.public_storage_bucket_name + force_destroy = true + + tags = { + Name = "${var.project_name} public storage" + } +} + +resource "aws_s3_bucket_acl" "public_storage" { + bucket = aws_s3_bucket.public_storage.id + acl = "private" +} + +resource "aws_s3_bucket_ownership_controls" "public_storage" { + bucket = aws_s3_bucket.public_storage.id + rule { + object_ownership = "ObjectWriter" + } +} + +resource "aws_s3_bucket" "private_storage" { + bucket = var.private_storage_bucket_name + force_destroy = true + + tags = { + Name = "${var.project_name} private storage" + } +} + +resource "aws_s3_bucket_acl" "private_storage" { + bucket = aws_s3_bucket.private_storage.id + acl = "private" +} + +resource "aws_s3_bucket_ownership_controls" "private_storage" { + bucket = aws_s3_bucket.private_storage.id + rule { + object_ownership = "ObjectWriter" + } +} + +locals { + s3_origin_id = "${var.project_name}-storage" +} + +resource "aws_cloudfront_distribution" "public_storage" { + origin { + origin_id = local.s3_origin_id + domain_name = aws_s3_bucket.public_storage.bucket_regional_domain_name + } + enabled = true + + aliases = ["${var.subdomain_storage}.${var.top_domain}"] + + default_cache_behavior { + allowed_methods = ["GET", "HEAD"] + cached_methods = ["GET", "HEAD"] + target_origin_id = local.s3_origin_id + + forwarded_values { + query_string = false + cookies { + forward = "none" + } + } + viewer_protocol_policy = "redirect-to-https" + min_ttl = 0 + default_ttl = 3600 + max_ttl = 86400 + } + + price_class = "PriceClass_100" + + viewer_certificate { + acm_certificate_arn = var.cloudfront_certificate_arn + ssl_support_method = "sni-only" + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } +} + +resource "aws_route53_record" "public_storage" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_storage}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_cloudfront_distribution.public_storage.domain_name}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf new file mode 100644 index 0000000..545649f --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf @@ -0,0 +1,198 @@ +# Project setup + +variable "project_name" { + description = "Name of your project" + type = string +} + +variable "aws_region" { + description = "The region to deploy the configuration to" + type = string +} + +variable "enable_redis" { + description = "Deploy a managed Redis server" + type = bool +} + +variable "enable_staging_server" { + description = "Deploy a staging server" + type = bool +} + +# Instance setup + +variable "instance_ami" { + description = "The ami used for the instance" + type = string +} + +variable "instance_type" { + description = "The type used for the instance" + type = string +} + +variable "autoscaling_min_size" { + description = "Minimum size for the autoscaling pool" + type = number +} + +variable "autoscaling_max_size" { + description = "Maximum size for the autoscaling pool" + type = number +} + +variable "autoscaling_desired_capacity" { + description = "Desired size for the autoscaling pool" + type = number +} + +# Staging instance setup + +variable "staging_instance_type" { + description = "The type used for the instance" + type = string +} + +variable "staging_autoscaling_min_size" { + description = "Minimum size for the autoscaling pool" + type = number +} + +variable "staging_autoscaling_max_size" { + description = "Maximum size for the autoscaling pool" + type = number +} + +variable "staging_autoscaling_desired_capacity" { + description = "Desired size for the autoscaling pool" + type = number +} + +# Deployment + +variable "deployment_bucket_name" { + description = "Name of S3 bucket used for deployments" + type = string +} + +# Domains and certificates + +variable "hosted_zone_id" { + description = "The id of your hosted zone in Route 53" + type = string +} + +variable "certificate_arn" { + description = "Wildcard certificate for the top domain" + type = string +} + +variable "cloudfront_certificate_arn" { + description = "Certificate for use with Cloudfront, must be in us-east-1 region." + type = string +} + +variable "top_domain" { + description = "The domain name for use with Insights api" + type = string +} + +variable "subdomain_database" { + description = "The domain name for use with the database" + type = string +} + +variable "subdomain_redis" { + description = "The domain name for use with Redis" + type = string +} + +variable "subdomain_api" { + description = "The domain name for use with api" + type = string +} + +variable "subdomain_insights" { + description = "The domain name for use with Insights api" + type = string +} + +variable "subdomain_web" { + description = "The domain name for use with the web server" + type = string +} + +variable "subdomain_storage" { + description = "The domain name for use with public storage" + type = string +} + +variable "subdomain_database_staging" { + description = "The domain name for use with the database" + type = string +} + +variable "subdomain_redis_staging" { + description = "The domain name for use with Redis" + type = string +} + +variable "subdomain_api_staging" { + description = "The domain name for use by api staging" + type = string +} + +variable "subdomain_insights_staging" { + description = "The domain name for use by insights staging" + type = string +} + +variable "subdomain_web_staging" { + description = "The domain name for use by web server staging" + type = string +} + +variable "subdomain_storage_staging" { + description = "The domain name for use with public storage" + type = string +} + +variable "use_top_domain_for_web" { + description = "Set to true if you want to point the top domain to the web server" + type = bool +} + +# Storage + +variable "public_storage_bucket_name" { + description = "Name of S3 bucket used for public storage" + type = string +} + +variable "private_storage_bucket_name" { + description = "Name of S3 bucket used for private storage" + type = string +} + +variable "public_storage_bucket_name_staging" { + description = "Name of S3 bucket used for public storage" + type = string +} + +variable "private_storage_bucket_name_staging" { + description = "Name of S3 bucket used for private storage" + type = string +} + +# Database + +variable "DATABASE_PASSWORD_PRODUCTION" { + description = "The production database password, you can find it in the config/passwords.yaml file." + type = string +} + +variable "DATABASE_PASSWORD_STAGING" { + description = "The staging database password, you can find it in the config/passwords.yaml file (no need to specify if you aren't deploying a staging environment)." + type = string +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf new file mode 100644 index 0000000..b6855ca --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf @@ -0,0 +1,18 @@ +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "2.77.0" + + name = "${var.project_name}-vpc" + cidr = "10.0.0.0/16" + + azs = data.aws_availability_zones.available.names + public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] + enable_dns_hostnames = true + enable_dns_support = true + + # create_database_subnet_group = true + # create_database_subnet_route_table = true + # create_database_internet_gateway_route = true + + # create_elasticache_subnet_group = true +} diff --git a/wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh b/wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh new file mode 100644 index 0000000..3ea6078 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# These are the variables that need to be set to be able to deploy to cloud run. +# You can find the values in the Google Cloud Console. +DATABASE_INSTANCE_CONNECTION_NAME="" +SERVICE_ACCOUNT="" + +# Optionally configure the region and runmode (staging is also viable). +REGION="us-central1" +RUNMODE="production" + + +# Check that we are running the script from the correct directory. +if [ ! -f config/production.yaml ]; then + echo "Run this script from the root of your server directory (e.g., mypod/mypod_server)." + exit 1 +fi + + +# Deploy the API server. +echo "Deploying API server..." + +gcloud run deploy serverpod-api \ + --source=. \ + --region=$REGION \ + --platform=managed \ + --service-account=$SERVICE_ACCOUNT \ + --port=8080 \ + --set-cloudsql-instances=$DATABASE_INSTANCE_CONNECTION_NAME \ + --execution-environment=gen2 \ + --set-env-vars="runmode=$RUNMODE" \ + --set-env-vars="role=serverless" \ + --allow-unauthenticated + + +# Deploy the Insights server. This is used by the Serverpod Insights app. It +# can provide run time information and logs from the API server. +echo "Deploying Insights server..." + +gcloud run deploy serverpod-insights \ + --source=. \ + --region=$REGION \ + --platform=managed \ + --service-account=$SERVICE_ACCOUNT \ + --port=8081 \ + --set-cloudsql-instances=$DATABASE_INSTANCE_CONNECTION_NAME \ + --execution-environment=gen2 \ + --set-env-vars="runmode=$RUNMODE" \ + --set-env-vars="role=serverless" \ + --allow-unauthenticated diff --git a/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars new file mode 100644 index 0000000..dc2b0e1 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars @@ -0,0 +1,23 @@ +# This is the main configuration file. You can deploy your Serverpod by only +# doing changes to this file. Serverpod uses a minimal setup by default, but +# you can edit the main.tf file to choose higher tiers for database and your +# managed instances or enable additional services like Redis. +# +# You can find complete setup instructions at: +# https://docs.serverpod.dev/ + +# The Project ID from the Google Cloud Console. +project = "" + +# The service account email address authorized by your Google Cloud Console. +service_account_email = "" + +# The name of your DNS zone. +dns_managed_zone = "" + +# The top domain of your DNS zone. e.g. "examplepod.com" +top_domain = "" + +# The region and zone to use for the deployment. Default values work. +region = "us-central1" +zone = "us-central1-c" diff --git a/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf new file mode 100644 index 0000000..34f1928 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf @@ -0,0 +1,95 @@ +# Set up and configure Terraform and the Google Cloud provider. +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "4.51.0" + } + } +} + +provider "google" { + credentials = file("credentials.json") + + project = var.project + region = var.region + zone = var.zone +} + +# Add a Serverpod module configured for production. Full documentation on all +# options is available at: +# https://github.com/serverpod/terraform-google-serverpod-cloud-engine + +module "serverpod_production" { + # References the Serverpod module from GitHub. + source = "github.com/serverpod/terraform-google-serverpod-cloud-engine?ref=stable-1.1" + + # Required parameters. + project = var.project + service_account_email = var.service_account_email + + runmode = "production" + + region = var.region + zone = var.zone + + dns_managed_zone = var.dns_managed_zone + top_domain = var.top_domain + + # Size of the auto scaling group. + autoscaling_min_size = 1 + autoscaling_max_size = 2 + + # Password for the production database. + database_password = var.DATABASE_PASSWORD_PRODUCTION + + # Adds Cloud Storage buckets for file uploads. + enable_storage = true + + # Adds Redis for caching and communication between servers. + enable_redis = false + + # Makes it possible to SSH into the individual server instances. + enable_ssh = true +} + + +# If you want to set up a staging environment, you can add a second module +# configured for staging. Just uncomment the following code and change the +# parameters as needed (default options should work too). + +# module "serverpod_staging" { +# # References the Serverpod module from GitHub. +# source = "github.com/serverpod/terraform-google-serverpod-cloud-engine?ref=stable-1.1" + +# # Required parameters. +# project = var.project +# service_account_email = var.service_account_email + +# runmode = "staging" + +# region = var.region +# zone = var.zone + +# dns_managed_zone = var.dns_managed_zone +# top_domain = var.top_domain + +# # Prefix for the staging, added to all subdomains. +# subdomain_prefix = "staging-" + +# # Size of the auto scaling group. +# autoscaling_min_size = 1 +# autoscaling_max_size = 2 + +# # Password for the production database. +# database_password = var.DATABASE_PASSWORD_STAGING + +# # Adds Cloud Storage buckets for file uploads. +# enable_storage = true + +# # Adds Redis for caching and communication between servers. +# enable_redis = false + +# # Makes it possible to SSH into the individual server instances. +# enable_ssh = true +# } diff --git a/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf new file mode 100644 index 0000000..85d5075 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf @@ -0,0 +1,39 @@ +# Project setup. + +variable "project" { + type = string +} + +variable "service_account_email" { + type = string +} + +variable "dns_managed_zone" { + type = string +} + +variable "top_domain" { + type = string +} + +variable "region" { + type = string + default = "us-central1" +} + +variable "zone" { + type = string + default = "us-central1-c" +} + +# Database + +variable "DATABASE_PASSWORD_PRODUCTION" { + description = "The production database password, you can find it in the config/passwords.yaml file." + type = string +} + +variable "DATABASE_PASSWORD_STAGING" { + description = "The staging database password, you can find it in the config/passwords.yaml file (no need to specify if you aren't deploying a staging environment)." + type = string +} diff --git a/wien_talks/wien_talks_server/docker-compose.yaml b/wien_talks/wien_talks_server/docker-compose.yaml new file mode 100644 index 0000000..ac81e06 --- /dev/null +++ b/wien_talks/wien_talks_server/docker-compose.yaml @@ -0,0 +1,44 @@ +services: + # Development services + postgres: + image: pgvector/pgvector:pg16 + ports: + - "8090:5432" + environment: + POSTGRES_USER: postgres + POSTGRES_DB: wien_talks + POSTGRES_PASSWORD: "xiooSw3_x3i8ckjeCzqFHeKKjuv0Wxsv" + volumes: + - wien_talks_data:/var/lib/postgresql/data + + redis: + image: redis:6.2.6 + ports: + - "8091:6379" + command: redis-server --requirepass "9vM2BNozAdWSFBvhxbh32kIzfXhQpQ-9" + environment: + - REDIS_REPLICATION_MODE=master + + # Test services + postgres_test: + image: pgvector/pgvector:pg16 + ports: + - "9090:5432" + environment: + POSTGRES_USER: postgres + POSTGRES_DB: wien_talks_test + POSTGRES_PASSWORD: "ZjZXx6_kky5qtz6Uf6X54KvgsjBzanGF" + volumes: + - wien_talks_test_data:/var/lib/postgresql/data + + redis_test: + image: redis:6.2.6 + ports: + - "9091:6379" + command: redis-server --requirepass "oNl0yIsZCylx162cRkzP3046JbIaycuZ" + environment: + - REDIS_REPLICATION_MODE=master + +volumes: + wien_talks_data: + wien_talks_test_data: diff --git a/wien_talks/wien_talks_server/lib/server.dart b/wien_talks/wien_talks_server/lib/server.dart new file mode 100644 index 0000000..f69fa35 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/server.dart @@ -0,0 +1,60 @@ +import 'package:wien_talks_server/src/birthday_reminder.dart'; +import 'package:serverpod/serverpod.dart'; + +import 'package:wien_talks_server/src/web/routes/root.dart'; + +import 'src/generated/protocol.dart'; +import 'src/generated/endpoints.dart'; + +// This is the starting point of your Serverpod server. In most cases, you will +// only need to make additions to this file if you add future calls, are +// configuring Relic (Serverpod's web-server), or need custom setup work. + +void run(List args) async { + // Initialize Serverpod and connect it with your generated code. + final pod = Serverpod(args, Protocol(), Endpoints()); + + // Setup a default page at the web root. + pod.webServer.addRoute(RouteRoot(), '/'); + pod.webServer.addRoute(RouteRoot(), '/index.html'); + // Serve all files in the /static directory. + pod.webServer.addRoute( + RouteStaticDirectory(serverDirectory: 'static', basePath: '/'), + '/*', + ); + + // Start the server. + await pod.start(); + + // After starting the server, you can register future calls. Future calls are + // tasks that need to happen in the future, or independently of the request/ + // response cycle. For example, you can use future calls to send emails, or to + // schedule tasks to be executed at a later time. Future calls are executed in + // the background. Their schedule is persisted to the database, so you will + // not lose them if the server is restarted. + + pod.registerFutureCall( + BirthdayReminder(), + FutureCallNames.birthdayReminder.name, + ); + + // You can schedule future calls for a later time during startup. But you can + // also schedule them in any endpoint or webroute through the session object. + // there is also [futureCallAtTime] if you want to schedule a future call at a + // specific time. + await pod.futureCallWithDelay( + FutureCallNames.birthdayReminder.name, + Greeting( + message: 'Hello!', + author: 'Serverpod Server', + timestamp: DateTime.now(), + ), + Duration(seconds: 5), + ); +} + +/// Names of all future calls in the server. +/// +/// This is better than using a string literal, as it will reduce the risk of +/// typos and make it easier to refactor the code. +enum FutureCallNames { birthdayReminder } diff --git a/wien_talks/wien_talks_server/lib/src/birthday_reminder.dart b/wien_talks/wien_talks_server/lib/src/birthday_reminder.dart new file mode 100644 index 0000000..ef3d8cb --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/birthday_reminder.dart @@ -0,0 +1,18 @@ +import 'package:wien_talks_server/src/generated/protocol.dart'; +import 'package:serverpod/serverpod.dart'; + +/// This is a simple example of a future call that logs a birthday reminder. +/// +/// In a real-world application, you would implement the logic to send a +/// an email or a push notification to the user. +class BirthdayReminder extends FutureCall { + @override + Future invoke(Session session, Greeting? object) async { + // This is where you would implement the logic to send a birthday reminder. + // For example, you could send an email or a notification to the user. + // You can access the user information from the `object` parameter if + // needed. + + session.log('${object?.message} Remember to send a birthday card!'); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart b/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart new file mode 100644 index 0000000..25c4573 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart @@ -0,0 +1,51 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _i1; +import '../greeting_endpoint.dart' as _i2; + +class Endpoints extends _i1.EndpointDispatch { + @override + void initializeEndpoints(_i1.Server server) { + var endpoints = { + 'greeting': _i2.GreetingEndpoint() + ..initialize( + server, + 'greeting', + null, + ) + }; + connectors['greeting'] = _i1.EndpointConnector( + name: 'greeting', + endpoint: endpoints['greeting']!, + methodConnectors: { + 'hello': _i1.MethodConnector( + name: 'hello', + params: { + 'name': _i1.ParameterDescription( + name: 'name', + type: _i1.getType(), + nullable: false, + ) + }, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['greeting'] as _i2.GreetingEndpoint).hello( + session, + params['name'], + ), + ) + }, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/greeting.dart b/wien_talks/wien_talks_server/lib/src/generated/greeting.dart new file mode 100644 index 0000000..005a7be --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/greeting.dart @@ -0,0 +1,105 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _i1; + +/// A greeting message which can be sent to or from the server. +abstract class Greeting + implements _i1.SerializableModel, _i1.ProtocolSerialization { + Greeting._({ + required this.message, + required this.author, + required this.timestamp, + }); + + factory Greeting({ + required String message, + required String author, + required DateTime timestamp, + }) = _GreetingImpl; + + factory Greeting.fromJson(Map jsonSerialization) { + return Greeting( + message: jsonSerialization['message'] as String, + author: jsonSerialization['author'] as String, + timestamp: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['timestamp']), + ); + } + + /// The greeting message. + String message; + + /// The author of the greeting message. + String author; + + /// The time when the message was created. + DateTime timestamp; + + /// Returns a shallow copy of this [Greeting] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Greeting copyWith({ + String? message, + String? author, + DateTime? timestamp, + }); + @override + Map toJson() { + return { + 'message': message, + 'author': author, + 'timestamp': timestamp.toJson(), + }; + } + + @override + Map toJsonForProtocol() { + return { + 'message': message, + 'author': author, + 'timestamp': timestamp.toJson(), + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _GreetingImpl extends Greeting { + _GreetingImpl({ + required String message, + required String author, + required DateTime timestamp, + }) : super._( + message: message, + author: author, + timestamp: timestamp, + ); + + /// Returns a shallow copy of this [Greeting] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Greeting copyWith({ + String? message, + String? author, + DateTime? timestamp, + }) { + return Greeting( + message: message ?? this.message, + author: author ?? this.author, + timestamp: timestamp ?? this.timestamp, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/protocol.dart b/wien_talks/wien_talks_server/lib/src/generated/protocol.dart new file mode 100644 index 0000000..1bd69cc --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/protocol.dart @@ -0,0 +1,93 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod/serverpod.dart' as _i1; +import 'package:serverpod/protocol.dart' as _i2; +import 'greeting.dart' as _i3; +export 'greeting.dart'; + +class Protocol extends _i1.SerializationManagerServer { + Protocol._(); + + factory Protocol() => _instance; + + static final Protocol _instance = Protocol._(); + + static final List<_i2.TableDefinition> targetTableDefinitions = [ + ..._i2.Protocol.targetTableDefinitions + ]; + + @override + T deserialize( + dynamic data, [ + Type? t, + ]) { + t ??= T; + if (t == _i3.Greeting) { + return _i3.Greeting.fromJson(data) as T; + } + if (t == _i1.getType<_i3.Greeting?>()) { + return (data != null ? _i3.Greeting.fromJson(data) : null) as T; + } + try { + return _i2.Protocol().deserialize(data, t); + } on _i1.DeserializationTypeNotFoundException catch (_) {} + return super.deserialize(data, t); + } + + @override + String? getClassNameForObject(Object? data) { + String? className = super.getClassNameForObject(data); + if (className != null) return className; + if (data is _i3.Greeting) { + return 'Greeting'; + } + className = _i2.Protocol().getClassNameForObject(data); + if (className != null) { + return 'serverpod.$className'; + } + return null; + } + + @override + dynamic deserializeByClassName(Map data) { + var dataClassName = data['className']; + if (dataClassName is! String) { + return super.deserializeByClassName(data); + } + if (dataClassName == 'Greeting') { + return deserialize<_i3.Greeting>(data['data']); + } + if (dataClassName.startsWith('serverpod.')) { + data['className'] = dataClassName.substring(10); + return _i2.Protocol().deserializeByClassName(data); + } + return super.deserializeByClassName(data); + } + + @override + _i1.Table? getTableForType(Type t) { + { + var table = _i2.Protocol().getTableForType(t); + if (table != null) { + return table; + } + } + return null; + } + + @override + List<_i2.TableDefinition> getTargetTableDefinitions() => + targetTableDefinitions; + + @override + String getModuleName() => 'wien_talks'; +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml b/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml new file mode 100644 index 0000000..9a4113d --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml @@ -0,0 +1,2 @@ +greeting: + - hello: diff --git a/wien_talks/wien_talks_server/lib/src/greeting.spy.yaml b/wien_talks/wien_talks_server/lib/src/greeting.spy.yaml new file mode 100644 index 0000000..3d08c8b --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/greeting.spy.yaml @@ -0,0 +1,24 @@ +# Yaml-files in the `models` directory specify which serializable objects +# should be generated. When you add or modify a file, you will need to run +# `serverpod generate` to make the generated classes available in the server and +# client. +# +# Please consult the documentation for more information on what you can add to +# your yaml-files. + +### A greeting message which can be sent to or from the server. +class: Greeting + +# Add the table key, if this class represents a row in the database. +#table: greeting + +# The fields (and columns if connected to the database) of the class. +# For a list of supported types, please see the documentation. +# https://docs.serverpod.dev/concepts/working-with-endpoints +fields: + ### The greeting message. + message: String + ### The author of the greeting message. + author: String + ### The time when the message was created. + timestamp: DateTime diff --git a/wien_talks/wien_talks_server/lib/src/greeting_endpoint.dart b/wien_talks/wien_talks_server/lib/src/greeting_endpoint.dart new file mode 100644 index 0000000..9faab19 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/greeting_endpoint.dart @@ -0,0 +1,34 @@ +import 'generated/protocol.dart'; +import 'package:serverpod/serverpod.dart'; + +// This is an example endpoint of your server. It's best practice to use the +// `Endpoint` ending of the class name, but it will be removed when accessing +// the endpoint from the client. I.e., this endpoint can be accessed through +// `client.greeting` on the client side. + +// After adding or modifying an endpoint, you will need to run +// `serverpod generate` to update the server and client code. + +/// This is an example endpoint that returns a greeting message through +/// its [hello] method. +class GreetingEndpoint extends Endpoint { + // This method is called when the client calls the `hello` method on the + // `greeting` endpoint. + // + // The `Session` parameter contains the context of the client request. + // It provides access to the database and other server-side resources like + // secrets from your password file, the cache, storage, and server-event + // messaging. + // + // You can use any serializable type as a parameter or return type, read more + // in the [docs](https://docs.serverpod.dev/concepts/working-with-endpoints). + + /// Returns a personalized greeting message: "Hello {name}". + Future hello(Session session, String name) async { + return Greeting( + message: 'Hello $name', + author: 'Serverpod', + timestamp: DateTime.now(), + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/web/routes/root.dart b/wien_talks/wien_talks_server/lib/src/web/routes/root.dart new file mode 100644 index 0000000..7c4a02e --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/web/routes/root.dart @@ -0,0 +1,11 @@ +import 'dart:io'; + +import 'package:wien_talks_server/src/web/widgets/built_with_serverpod_page.dart'; +import 'package:serverpod/serverpod.dart'; + +class RouteRoot extends WidgetRoute { + @override + Future build(Session session, HttpRequest request) async { + return BuiltWithServerpodPage(); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart b/wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart new file mode 100644 index 0000000..233327c --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart @@ -0,0 +1,11 @@ +import 'package:serverpod/serverpod.dart'; + +/// A widget that displays the Serverpod version and the current run mode. +/// It uses the built_with_serverpod.html template to render the page. +/// The [name] of the template should correspond to a template file in your +/// server's web/templates directory. +class BuiltWithServerpodPage extends Widget { + BuiltWithServerpodPage() : super(name: 'built_with_serverpod') { + values = {'served': DateTime.now(), 'runmode': Serverpod.instance.runMode}; + } +} diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/definition.json b/wien_talks/wien_talks_server/migrations/20250816095813247/definition.json new file mode 100644 index 0000000..47337a1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816095813247/definition.json @@ -0,0 +1,1153 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816095813247" + }, + { + "module": "serverpod", + "version": "20240516151843329" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql b/wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql new file mode 100644 index 0000000..a5506ab --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql @@ -0,0 +1,257 @@ +BEGIN; + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816095813247', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816095813247', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json new file mode 100644 index 0000000..e5cbb31 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json @@ -0,0 +1,11 @@ +{ + "moduleName": "wien_talks", + "tables": [], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/migration.json b/wien_talks/wien_talks_server/migrations/20250816095813247/migration.json new file mode 100644 index 0000000..9e98e44 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816095813247/migration.json @@ -0,0 +1,1182 @@ +{ + "actions": [ + { + "type": "createTable", + "createTable": { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql b/wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql new file mode 100644 index 0000000..47258dd --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql @@ -0,0 +1,257 @@ +BEGIN; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- ACTION CREATE FOREIGN KEY +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- ACTION CREATE FOREIGN KEY +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- ACTION CREATE FOREIGN KEY +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816095813247', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816095813247', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/migration_registry.txt b/wien_talks/wien_talks_server/migrations/migration_registry.txt new file mode 100644 index 0000000..a0ec0ac --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/migration_registry.txt @@ -0,0 +1,7 @@ +### AUTOMATICALLY GENERATED DO NOT MODIFY +### +### This file is generated by Serverpod when creating a migration, do not modify it +### manually. If a collision is detected in this file when doing a code merge, resolve +### the conflict by removing and recreating the conflicting migration. + +20250816095813247 diff --git a/wien_talks_be/pubspec.lock b/wien_talks/wien_talks_server/pubspec.lock similarity index 68% rename from wien_talks_be/pubspec.lock rename to wien_talks/wien_talks_server/pubspec.lock index 690612c..3112221 100644 --- a/wien_talks_be/pubspec.lock +++ b/wien_talks/wien_talks_server/pubspec.lock @@ -41,6 +41,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + buffer: + dependency: transitive + description: + name: buffer + sha256: "389da2ec2c16283c8787e0adaede82b1842102f8c8aae2f49003a766c5c6b3d1" + url: "https://pub.dev" + source: hosted + version: "1.2.3" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a + url: "https://pub.dev" + source: hosted + version: "1.4.0" cli_config: dependency: transitive description: @@ -89,6 +105,22 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter_lints: + dependency: transitive + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" frontend_server_client: dependency: transitive description: @@ -105,6 +137,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.dev" + source: hosted + version: "1.5.0" http_multi_server: dependency: transitive description: @@ -141,10 +181,10 @@ packages: dependency: "direct dev" description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "6.0.0" logging: dependency: transitive description: @@ -177,6 +217,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" + mustache_template: + dependency: transitive + description: + name: mustache_template + sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c + url: "https://pub.dev" + source: hosted + version: "2.0.0" node_preamble: dependency: transitive description: @@ -209,6 +257,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + postgres: + dependency: transitive + description: + name: postgres + sha256: "9aaa6f4872956adef653535a4e2133b167465c1a68c22b9bd0744ef1244e9393" + url: "https://pub.dev" + source: hosted + version: "3.5.6" pub_semver: dependency: transitive description: @@ -217,6 +273,78 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" + redis: + dependency: transitive + description: + name: redis + sha256: "4a8218ef7b0642ff499147c7a105591208259e2f55f07db0101ace7f82f66cf9" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + sasl_scram: + dependency: transitive + description: + name: sasl_scram + sha256: a47207a436eb650f8fdcf54a2e2587b850dc3caef9973ce01f332b07a6fc9cb9 + url: "https://pub.dev" + source: hosted + version: "0.1.1" + saslprep: + dependency: transitive + description: + name: saslprep + sha256: "3d421d10be9513bf4459c17c5e70e7b8bc718c9fc5ad4ba5eb4f5fd27396f740" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + serverpod: + dependency: "direct main" + description: + name: serverpod + sha256: ffb358e9ff84bf546ee612b4b5a5f5556bd9840e4a8f06d825efb77a4dd3009e + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_lints: + dependency: transitive + description: + name: serverpod_lints + sha256: dc6f9c52fbbb39ca6b8f4a3dbdfaceb17c30fd5299a1a9bbd05da942d8bc2fd8 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_serialization: + dependency: transitive + description: + name: serverpod_serialization + sha256: c301a5e45610c062e51e1ba580f51f3257c3404ce2dd2f7e216dccbd93869502 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_shared: + dependency: transitive + description: + name: serverpod_shared + sha256: "4c88ca57d90138a01d70a5e28f206c86f9ec43a9215de06ee6a5d0c95049d519" + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_test: + dependency: "direct dev" + description: + name: serverpod_test + sha256: c0ad3a29f9b60dbf3e47cd313cf48a0d87d4db2f26e21a14e44734146dc5a22b + url: "https://pub.dev" + source: hosted + version: "2.9.1" shelf: dependency: transitive description: @@ -273,6 +401,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: @@ -297,6 +433,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.1" + super_string: + dependency: transitive + description: + name: super_string + sha256: ba41acf9fbb318b3fc0d57c9235779100394d85d83f45ab533615df1f3146ea7 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 + url: "https://pub.dev" + source: hosted + version: "3.4.0" + system_resources: + dependency: transitive + description: + name: system_resources + sha256: "7e78cf8ef224c1e0b6bf4462322b6739fea2274fef928cbcbf21ae5e5a8272d8" + url: "https://pub.dev" + source: hosted + version: "1.6.0" term_glyph: dependency: transitive description: @@ -337,6 +497,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + unorm_dart: + dependency: transitive + description: + name: unorm_dart + sha256: "8e3870a1caa60bde8352f9597dd3535d8068613269444f8e35ea8925ec84c1f5" + url: "https://pub.dev" + source: hosted + version: "0.3.1+1" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" vm_service: dependency: transitive description: @@ -394,4 +570,4 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.8.1 <4.0.0" + dart: ">=3.8.0 <4.0.0" diff --git a/wien_talks/wien_talks_server/pubspec.yaml b/wien_talks/wien_talks_server/pubspec.yaml new file mode 100644 index 0000000..bebc275 --- /dev/null +++ b/wien_talks/wien_talks_server/pubspec.yaml @@ -0,0 +1,16 @@ +name: wien_talks_server +description: Starting point for a Serverpod server. +# version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=3.5.0 <4.0.0' + +dependencies: + serverpod: 2.9.1 + +dev_dependencies: + lints: '>=3.0.0 <7.0.0' + test: '^1.24.2' + serverpod_test: 2.9.1 + diff --git a/wien_talks/wien_talks_server/test/integration/greeting_endpoint_test.dart b/wien_talks/wien_talks_server/test/integration/greeting_endpoint_test.dart new file mode 100644 index 0000000..5049049 --- /dev/null +++ b/wien_talks/wien_talks_server/test/integration/greeting_endpoint_test.dart @@ -0,0 +1,24 @@ +import 'package:test/test.dart'; + +// Import the generated test helper file, it contains everything you need. +import 'test_tools/serverpod_test_tools.dart'; + +void main() { + // This is an example test that uses the `withServerpod` test helper. + // `withServerpod` enables you to call your endpoints directly from the test like regular functions. + // Note that after adding or modifying an endpoint, you will need to run + // `serverpod generate` to update the test tools code. + // Refer to the docs for more information on how to use the test helper. + withServerpod('Given Greeting endpoint', (sessionBuilder, endpoints) { + test( + 'when calling `hello` with name then returned greeting includes name', + () async { + // Call the endpoint method by using the `endpoints` parameter and + // pass `sessionBuilder` as a first argument. Refer to the docs on + // how to use the `sessionBuilder` to set up different test scenarios. + final greeting = await endpoints.greeting.hello(sessionBuilder, 'Bob'); + expect(greeting.message, 'Hello Bob'); + }, + ); + }); +} diff --git a/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart b/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart new file mode 100644 index 0000000..d9ec37d --- /dev/null +++ b/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart @@ -0,0 +1,159 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_local_identifiers + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_test/serverpod_test.dart' as _i1; +import 'package:serverpod/serverpod.dart' as _i2; +import 'dart:async' as _i3; +import 'package:wien_talks_server/src/generated/greeting.dart' as _i4; +import 'package:wien_talks_server/src/generated/protocol.dart'; +import 'package:wien_talks_server/src/generated/endpoints.dart'; +export 'package:serverpod_test/serverpod_test_public_exports.dart'; + +/// Creates a new test group that takes a callback that can be used to write tests. +/// The callback has two parameters: `sessionBuilder` and `endpoints`. +/// `sessionBuilder` is used to build a `Session` object that represents the server state during an endpoint call and is used to set up scenarios. +/// `endpoints` contains all your Serverpod endpoints and lets you call them: +/// ```dart +/// withServerpod('Given Example endpoint', (sessionBuilder, endpoints) { +/// test('when calling `hello` then should return greeting', () async { +/// final greeting = await endpoints.example.hello(sessionBuilder, 'Michael'); +/// expect(greeting, 'Hello Michael'); +/// }); +/// }); +/// ``` +/// +/// **Configuration options** +/// +/// [applyMigrations] Whether pending migrations should be applied when starting Serverpod. Defaults to `true` +/// +/// [enableSessionLogging] Whether session logging should be enabled. Defaults to `false` +/// +/// [rollbackDatabase] Options for when to rollback the database during the test lifecycle. +/// By default `withServerpod` does all database operations inside a transaction that is rolled back after each `test` case. +/// Just like the following enum describes, the behavior of the automatic rollbacks can be configured: +/// ```dart +/// /// Options for when to rollback the database during the test lifecycle. +/// enum RollbackDatabase { +/// /// After each test. This is the default. +/// afterEach, +/// +/// /// After all tests. +/// afterAll, +/// +/// /// Disable rolling back the database. +/// disabled, +/// } +/// ``` +/// +/// [runMode] The run mode that Serverpod should be running in. Defaults to `test`. +/// +/// [serverpodLoggingMode] The logging mode used when creating Serverpod. Defaults to `ServerpodLoggingMode.normal` +/// +/// [serverpodStartTimeout] The timeout to use when starting Serverpod, which connects to the database among other things. Defaults to `Duration(seconds: 30)`. +/// +/// [testGroupTagsOverride] By default Serverpod test tools tags the `withServerpod` test group with `"integration"`. +/// This is to provide a simple way to only run unit or integration tests. +/// This property allows this tag to be overridden to something else. Defaults to `['integration']`. +/// +/// [experimentalFeatures] Optionally specify experimental features. See [Serverpod] for more information. +@_i1.isTestGroup +void withServerpod( + String testGroupName, + _i1.TestClosure testClosure, { + bool? applyMigrations, + bool? enableSessionLogging, + _i2.ExperimentalFeatures? experimentalFeatures, + _i1.RollbackDatabase? rollbackDatabase, + String? runMode, + _i2.RuntimeParametersListBuilder? runtimeParametersBuilder, + _i2.ServerpodLoggingMode? serverpodLoggingMode, + Duration? serverpodStartTimeout, + List? testGroupTagsOverride, +}) { + _i1.buildWithServerpod<_InternalTestEndpoints>( + testGroupName, + _i1.TestServerpod( + testEndpoints: _InternalTestEndpoints(), + endpoints: Endpoints(), + serializationManager: Protocol(), + runMode: runMode, + applyMigrations: applyMigrations, + isDatabaseEnabled: true, + serverpodLoggingMode: serverpodLoggingMode, + experimentalFeatures: experimentalFeatures, + runtimeParametersBuilder: runtimeParametersBuilder, + ), + maybeRollbackDatabase: rollbackDatabase, + maybeEnableSessionLogging: enableSessionLogging, + maybeTestGroupTagsOverride: testGroupTagsOverride, + maybeServerpodStartTimeout: serverpodStartTimeout, + )(testClosure); +} + +class TestEndpoints { + late final _GreetingEndpoint greeting; +} + +class _InternalTestEndpoints extends TestEndpoints + implements _i1.InternalTestEndpoints { + @override + void initialize( + _i2.SerializationManager serializationManager, + _i2.EndpointDispatch endpoints, + ) { + greeting = _GreetingEndpoint( + endpoints, + serializationManager, + ); + } +} + +class _GreetingEndpoint { + _GreetingEndpoint( + this._endpointDispatch, + this._serializationManager, + ); + + final _i2.EndpointDispatch _endpointDispatch; + + final _i2.SerializationManager _serializationManager; + + _i3.Future<_i4.Greeting> hello( + _i1.TestSessionBuilder sessionBuilder, + String name, + ) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'greeting', + method: 'hello', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'greeting', + methodName: 'hello', + parameters: _i1.testObjectToJson({'name': name}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future<_i4.Greeting>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } +} diff --git a/wien_talks/wien_talks_server/web/static/css/style.css b/wien_talks/wien_talks_server/web/static/css/style.css new file mode 100644 index 0000000..2cea817 --- /dev/null +++ b/wien_talks/wien_talks_server/web/static/css/style.css @@ -0,0 +1,76 @@ +html { + box-sizing: border-box; + font-size: 14px; + font-family: Arial, Helvetica, sans-serif; + background: url('/images/background.svg') no-repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} + +*, *:before, *:after { + box-sizing: inherit; +} + +body, h1, h2, h3, h4, h5, h6, p, ol, ul { + margin: 0; + padding: 0; + font-weight: normal; +} + +ol, ul { + list-style: none; +} + +img { + max-width: 100%; + height: auto; +} + +body { + padding: 16px; +} + +hr { + margin-top: 16px; margin-bottom: 16px; + border: 0; + height: 1px; + background: #999; +} + +.content { + min-width: 300px; + position: absolute; + left: 50%; + top: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-color: white; + border-radius: 8px; + padding: 16px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); +} + +.logo-box a { + text-decoration: none; + font-weight: bold; + color: #666; +} + +.logo-box { + text-align: center; +} + +.info-box p { + margin-top: 2px; +} + +.link-box { + text-align: center; + color: #999; +} + +.link-box a { + text-decoration: none; +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/web/static/images/background.svg b/wien_talks/wien_talks_server/web/static/images/background.svg new file mode 100644 index 0000000..45ce11d --- /dev/null +++ b/wien_talks/wien_talks_server/web/static/images/background.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg b/wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg new file mode 100644 index 0000000..1872447 --- /dev/null +++ b/wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wien_talks/wien_talks_server/web/templates/built_with_serverpod.html b/wien_talks/wien_talks_server/web/templates/built_with_serverpod.html new file mode 100644 index 0000000..b7a43f5 --- /dev/null +++ b/wien_talks/wien_talks_server/web/templates/built_with_serverpod.html @@ -0,0 +1,29 @@ + + + + + Built with Serverpod + + + +
+ +
+
+

Served at: {{served}}

+

Run mode: {{runmode}}

+
+
+ +
+ + \ No newline at end of file diff --git a/wien_talks_be/.gitignore b/wien_talks_be/.gitignore deleted file mode 100644 index 3a85790..0000000 --- a/wien_talks_be/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# https://dart.dev/guides/libraries/private-files -# Created by `dart pub` -.dart_tool/ diff --git a/wien_talks_be/CHANGELOG.md b/wien_talks_be/CHANGELOG.md deleted file mode 100644 index effe43c..0000000 --- a/wien_talks_be/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.0 - -- Initial version. diff --git a/wien_talks_be/README.md b/wien_talks_be/README.md deleted file mode 100644 index 3816eca..0000000 --- a/wien_talks_be/README.md +++ /dev/null @@ -1,2 +0,0 @@ -A sample command-line application with an entrypoint in `bin/`, library code -in `lib/`, and example unit test in `test/`. diff --git a/wien_talks_be/bin/wien_talks_be.dart b/wien_talks_be/bin/wien_talks_be.dart deleted file mode 100644 index bada568..0000000 --- a/wien_talks_be/bin/wien_talks_be.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:wien_talks_be/wien_talks_be.dart' as wien_talks_be; - -void main(List arguments) { - print('Hello world: ${wien_talks_be.calculate()}!'); -} diff --git a/wien_talks_be/lib/wien_talks_be.dart b/wien_talks_be/lib/wien_talks_be.dart deleted file mode 100644 index f64ad72..0000000 --- a/wien_talks_be/lib/wien_talks_be.dart +++ /dev/null @@ -1,3 +0,0 @@ -int calculate() { - return 6 * 7; -} diff --git a/wien_talks_be/pubspec.yaml b/wien_talks_be/pubspec.yaml deleted file mode 100644 index 60ed050..0000000 --- a/wien_talks_be/pubspec.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: wien_talks_be -description: A sample command-line application. -version: 1.0.0 -# repository: https://github.com/my_org/my_repo - -environment: - sdk: ^3.8.1 - -# Add regular dependencies here. -dependencies: - # path: ^1.8.0 - -dev_dependencies: - lints: ^5.0.0 - test: ^1.24.0 diff --git a/wien_talks_be/test/wien_talks_be_test.dart b/wien_talks_be/test/wien_talks_be_test.dart deleted file mode 100644 index 8db0a6f..0000000 --- a/wien_talks_be/test/wien_talks_be_test.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:wien_talks_be/wien_talks_be.dart'; -import 'package:test/test.dart'; - -void main() { - test('calculate', () { - expect(calculate(), 42); - }); -}