├── .DS_Store ├── .github └── workflows │ ├── deployment-aws.yml │ └── deployment-gcp.yml ├── README.md ├── chat_app_serverpod_client ├── .gitignore ├── CHANGELOG.md ├── README.md ├── analysis_options.yaml ├── dartdoc_options.yaml ├── doc │ └── endpoint.md ├── lib │ ├── chat_app_serverpod_client.dart │ └── src │ │ └── protocol │ │ ├── chat.dart │ │ ├── client.dart │ │ ├── example.dart │ │ ├── message.chat.dart │ │ ├── protocol.dart │ │ ├── typing.chat.dart │ │ └── usermessage.chat.dart └── pubspec.yaml ├── chat_app_serverpod_flutter ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── chat_app_serverpod_flutter │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ ├── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ └── LaunchImage.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ └── README.md │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h │ └── RunnerTests │ │ └── RunnerTests.swift ├── lib │ ├── functions │ │ └── initialize_auth.dart │ ├── main.dart │ ├── screens │ │ ├── account_page.dart │ │ ├── chat_screen.dart │ │ ├── home_page.dart │ │ └── sign_in_page.dart │ ├── utils │ │ ├── data.dart │ │ ├── methods.dart │ │ └── theme.dart │ └── widgets │ │ └── sign_in_widget.dart ├── linux │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ ├── main.cc │ ├── my_application.cc │ └── my_application.h ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── app_icon_1024.png │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_512.png │ │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ │ └── MainMenu.xib │ │ ├── Configs │ │ │ ├── AppInfo.xcconfig │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements │ └── RunnerTests │ │ └── RunnerTests.swift ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ └── Icon-maskable-512.png │ ├── index.html │ └── manifest.json └── windows │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake │ └── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ └── app_icon.ico │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h └── chat_app_serverpod_server ├── .DS_Store ├── .gcloudignore ├── .gitignore ├── CHANGELOG.md ├── Dockerfile ├── README.md ├── analysis_options.yaml ├── bin └── main.dart ├── config ├── development.yaml ├── generator.yaml ├── production.yaml └── staging.yaml ├── deploy ├── .DS_Store ├── aws │ ├── scripts │ │ ├── appspec.yml │ │ ├── install_dependencies │ │ ├── run_serverpod │ │ └── start_server │ └── terraform │ │ ├── balancers-staging.tf │ │ ├── balancers.tf │ │ ├── cloudfront-web-staging.tf │ │ ├── cloudfront-web.tf │ │ ├── code-deploy.tf │ │ ├── config.auto.tfvars │ │ ├── database.tf │ │ ├── init-script.sh │ │ ├── instances.tf │ │ ├── main.tf │ │ ├── redis.tf │ │ ├── staging.tf │ │ ├── storage.tf │ │ ├── variables.tf │ │ └── vpc.tf └── gcp │ ├── console_gcr │ └── cloud-run-deploy.sh │ └── terraform_gce │ ├── config.auto.tfvars │ ├── main.tf │ └── variables.tf ├── docker-compose.yaml ├── lib ├── .DS_Store ├── server.dart └── src │ ├── .DS_Store │ ├── endpoints │ ├── chat_endpoint.dart │ ├── example_endpoint.dart │ ├── type_endpoint.dart │ ├── user_endpoint.dart │ └── usermessage_endpoint.dart │ ├── future_calls │ └── example_future_call.dart │ ├── generated │ ├── chat.dart │ ├── endpoints.dart │ ├── example.dart │ ├── message.chat.dart │ ├── protocol.dart │ ├── protocol.yaml │ ├── typing.chat.dart │ └── usermessage.chat.dart │ ├── models │ ├── chat.yaml │ ├── example.spy.yaml │ ├── message.chat.yaml │ ├── typing.chat.yaml │ └── usermessage.chat.yaml │ └── web │ ├── routes │ └── root.dart │ └── widgets │ └── default_page_widget.dart ├── migrations ├── .DS_Store ├── 20240619170842342 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240619173629236 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240620053531204 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240620192018041 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240620194328033 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240620200953666 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240620201147929 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240620205227936 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240621045412320 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240621071106181 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql ├── 20240621071616007 │ ├── definition.json │ ├── definition.sql │ ├── definition_project.json │ ├── migration.json │ └── migration.sql └── migration_registry.txt ├── pubspec.lock ├── pubspec.yaml └── web ├── .DS_Store ├── static ├── css │ └── style.css └── images │ ├── background.svg │ └── serverpod-logo.svg └── templates └── default.html /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/.DS_Store -------------------------------------------------------------------------------- /.github/workflows/deployment-aws.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to AWS 2 | on: 3 | push: 4 | branches: [ deployment-aws-production, deployment-aws-staging ] 5 | workflow_dispatch: 6 | inputs: 7 | target: 8 | description: 'Target' 9 | required: true 10 | default: 'production' 11 | type: choice 12 | options: 13 | - 'staging' 14 | - 'production' 15 | jobs: 16 | deploy: 17 | name: Deploy to AWS 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v2 23 | with: 24 | submodules: recursive 25 | 26 | - name: Setup Dart SDK 27 | uses: dart-lang/setup-dart@v1.3 28 | with: 29 | sdk: 3.0 30 | 31 | - name: Configure AWS credentials 32 | uses: aws-actions/configure-aws-credentials@v1 33 | with: 34 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 35 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 36 | aws-region: us-west-2 37 | 38 | - name: Create passwords file 39 | working-directory: chat_app_serverpod_server 40 | shell: bash 41 | env: 42 | SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} 43 | run: | 44 | pwd 45 | echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml 46 | ls config/ 47 | 48 | - name: Get Dart packages 49 | working-directory: chat_app_serverpod_server 50 | run: dart pub get 51 | 52 | - name: Compile server 53 | working-directory: chat_app_serverpod_server 54 | run: dart compile kernel bin/main.dart 55 | 56 | - name: Create CodeDeploy Deployment 57 | id: deploy 58 | env: 59 | PROJECT_NAME: chat_app_serverpod 60 | AWS_NAME: chat-app-serverpod 61 | DEPLOYMENT_BUCKET: chat-app-serverpod-deployment-7000297 62 | TARGET: ${{ github.event.inputs.target }} 63 | run: | 64 | # Deploy server to AWS 65 | TARGET="${TARGET:=${GITHUB_REF##*-}}" 66 | echo "Deploying to target: $TARGET" 67 | mkdir -p vendor 68 | cp "${PROJECT_NAME}_server/deploy/aws/scripts/appspec.yml" appspec.yml 69 | zip -r deployment.zip . 70 | aws s3 cp deployment.zip "s3://${DEPLOYMENT_BUCKET}/deployment.zip" 71 | aws deploy create-deployment \ 72 | --application-name "${AWS_NAME}-app" \ 73 | --deployment-group-name "${AWS_NAME}-${TARGET}-group" \ 74 | --deployment-config-name CodeDeployDefault.OneAtATime \ 75 | --s3-location "bucket=${DEPLOYMENT_BUCKET},key=deployment.zip,bundleType=zip" 76 | -------------------------------------------------------------------------------- /.github/workflows/deployment-gcp.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to GCP 2 | on: 3 | push: 4 | branches: [ deployment-gcp-production, deployment-gcp-staging ] 5 | workflow_dispatch: 6 | inputs: 7 | target: 8 | description: 'Target' 9 | required: true 10 | default: 'production' 11 | type: choice 12 | options: 13 | - 'staging' 14 | - 'production' 15 | 16 | env: 17 | # TODO: Update with your Google Cloud project id. If you have changed the 18 | # region and zone in your Terraform configuration, you will need to change 19 | # it here too. 20 | PROJECT: "" 21 | REGION: us-central1 22 | ZONE: us-central1-c 23 | 24 | jobs: 25 | deploy: 26 | name: Deploy to Google Cloud Run 27 | runs-on: ubuntu-latest 28 | 29 | steps: 30 | - name: Checkout 31 | uses: actions/checkout@v3 32 | with: 33 | submodules: recursive 34 | 35 | - name: Setting Target Mode from Input 36 | if: ${{ github.event.inputs.target != '' }} 37 | run: echo "TARGET=${{ github.event.inputs.target }}" >> $GITHUB_ENV 38 | 39 | - name: Setting Target mode based on branch 40 | if: ${{ github.event.inputs.target == '' }} 41 | run: echo "TARGET=${GITHUB_REF##*-}" >> $GITHUB_ENV 42 | 43 | - name: Set repository 44 | run: echo "REPOSITORY=serverpod-${{ env.TARGET }}-container" >> $GITHUB_ENV 45 | 46 | - name: Set Image Name 47 | run: echo "IMAGE_NAME=serverpod" >> $GITHUB_ENV 48 | 49 | - name: Set Service Name 50 | run: echo "SERVICE_NAME=$(echo $IMAGE_NAME | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV 51 | 52 | - name: Test 53 | run: echo $SERVICE_NAME 54 | 55 | 56 | - id: "auth" 57 | name: "Authenticate to Google Cloud" 58 | uses: "google-github-actions/auth@v1" 59 | with: 60 | credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}" 61 | 62 | - name: Create passwords file 63 | working-directory: chat_app_serverpod_server 64 | shell: bash 65 | env: 66 | SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} 67 | run: | 68 | pwd 69 | echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml 70 | ls config/ 71 | 72 | - name: Configure Docker 73 | working-directory: chat_app_serverpod_server 74 | run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev 75 | 76 | - name: Build the Docker image 77 | working-directory: chat_app_serverpod_server 78 | run: "docker build -t $IMAGE_NAME ." 79 | 80 | - name: Tag the Docker image 81 | working-directory: chat_app_serverpod_server 82 | run: docker tag $IMAGE_NAME ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME 83 | 84 | - name: Push Docker image 85 | working-directory: chat_app_serverpod_server 86 | run: docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME 87 | 88 | # Uncomment the following code to automatically restart the servers in the 89 | # instance group when you push a new version of your code. Before doing 90 | # this, make sure that you have successfully deployed a first version. 91 | # 92 | # - name: Restart servers in instance group 93 | # run: | 94 | # gcloud compute instance-groups managed rolling-action replace serverpod-${{ env.TARGET }}-group \ 95 | # --project=${{ env.PROJECT }} \ 96 | # --replacement-method='substitute' \ 97 | # --max-surge=1 \ 98 | # --max-unavailable=1 \ 99 | # --zone=${{ env.ZONE }} 100 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter & Serverpod - Realtime Chat App 2 | ## _A Realtime chat app built with Flutter and Serverpod_ 3 | 4 | 5 | ![serverpod final output](https://github.com/tanvir-robin/chat-app-serverpod/assets/95021955/d74bf64b-84e3-42a8-8653-fc8b6d72c0c9) 6 | 7 | 8 | 9 | #### Serverpod is an open-source, scalable app server, written in Dart for the Flutter community. 10 | 11 | - Register. 12 | - Enter OTP from your mail. 13 | - ✨Chat ✨ 14 | 15 | ## Features 16 | 17 | - Authentication 18 | 19 | - OTP Verification via Email 20 | 21 | - Realtime Chatting 22 | 23 | - Typing Indicator 24 | 25 | - Single Message Reply 26 | 27 | - Emoji Reactions to Messages 28 | 29 | - Dark / Light Themes 30 | 31 | 32 | 33 | ## Tech 34 | 35 | - Flutter & Dart 36 | - Serverod as Backend 37 | - Docker 38 | - PostgreSQL (By Serverpod) 39 | 40 | 41 | 42 | ## Installation 43 | 44 | This project requires the following to run 45 | - [Flutter SDK](https://flutter.dev/) 46 | - [Serverpod CLI](https://docs.serverpod.dev/) 47 | - [Docker](https://www.docker.com/products/docker-desktop/) 48 | 49 | Clone the repo to your local machine 50 | 51 | ```sh 52 | cd 53 | gh repo clone tanvir-robin/chat-app-serverpod 54 | ``` 55 | 56 | Load the dependencies 57 | 58 | ```sh 59 | flutter pub get all 60 | ``` 61 | 62 | Follow the serverpod documenations to run and setup further to the project. 63 | 64 | > While creating or running project using serverpod CLI. Docker must be running in the beackground. 65 | 66 | > Use IP '10.0.2.2' instead of 'localhost' while running on emulator. 67 | 68 | Run the server project 69 | 70 | ```sh 71 | dart bin/main.dart 72 | ``` 73 | Run the client project 74 | 75 | 76 | ```sh 77 | fluttr run 78 | ``` 79 | 80 | 81 | 82 | ## Development 83 | 84 | Want to contribute? Great! 85 | Feel free to fork and create pull request. 86 | 87 | ## Glimps 88 | 89 | 90 | 91 | 92 | https://github.com/tanvir-robin/chat-app-serverpod/assets/95021955/cb390775-b0d1-4e61-802c-8d248b217c14 93 | 94 | 95 | 96 | 97 | ## Read More 98 | - [Serverpod](https://docs.serverpod.dev) 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Omit committing pubspec.lock for library packages: 6 | # https://dart.dev/guides/libraries/private-files#pubspeclock 7 | pubspec.lock 8 | 9 | # Conventional directory for build outputs 10 | build/ 11 | 12 | # Directory created by dartdoc 13 | doc/api/ 14 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/README.md: -------------------------------------------------------------------------------- 1 | # chat_app_serverpod_client 2 | 3 | This is your Serverpod client. The code in here is mostly generated by 4 | Serverpod, but you may want to make changes if you are adding modules to your 5 | project. 6 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | 5 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 6 | # Uncomment to specify additional rules. 7 | # linter: 8 | # rules: 9 | # - camel_case_types 10 | 11 | analyzer: 12 | # exclude: 13 | # - path/to/excluded/files/** 14 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/dartdoc_options.yaml: -------------------------------------------------------------------------------- 1 | dartdoc: 2 | categories: 3 | "Endpoint": 4 | markdown: doc/endpoint.md 5 | name: Endpoint -------------------------------------------------------------------------------- /chat_app_serverpod_client/doc/endpoint.md: -------------------------------------------------------------------------------- 1 | # Callable endpoints 2 | 3 | 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. 4 | 5 | Example usage: 6 | 7 | ```dart 8 | // How to use ExampleEndpoint. 9 | client.example.hello("world!"); 10 | 11 | // Generic format. 12 | client..(...); 13 | ``` 14 | 15 | Please see the full official documentation [here](https://docs.serverpod.dev) 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/lib/chat_app_serverpod_client.dart: -------------------------------------------------------------------------------- 1 | export 'src/protocol/protocol.dart'; 2 | export 'package:serverpod_client/serverpod_client.dart'; 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/lib/src/protocol/chat.dart: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ 2 | /* To generate run: "serverpod generate" */ 3 | 4 | // ignore_for_file: library_private_types_in_public_api 5 | // ignore_for_file: public_member_api_docs 6 | // ignore_for_file: implementation_imports 7 | // ignore_for_file: use_super_parameters 8 | // ignore_for_file: type_literal_in_constant_pattern 9 | 10 | // ignore_for_file: no_leading_underscores_for_library_prefixes 11 | import 'package:serverpod_client/serverpod_client.dart' as _i1; 12 | 13 | abstract class Chat implements _i1.SerializableModel { 14 | Chat._({ 15 | this.id, 16 | required this.text, 17 | required this.sender, 18 | this.sent, 19 | }); 20 | 21 | factory Chat({ 22 | int? id, 23 | required String text, 24 | required String sender, 25 | DateTime? sent, 26 | }) = _ChatImpl; 27 | 28 | factory Chat.fromJson(Map jsonSerialization) { 29 | return Chat( 30 | id: jsonSerialization['id'] as int?, 31 | text: jsonSerialization['text'] as String, 32 | sender: jsonSerialization['sender'] as String, 33 | sent: jsonSerialization['sent'] == null 34 | ? null 35 | : _i1.DateTimeJsonExtension.fromJson(jsonSerialization['sent']), 36 | ); 37 | } 38 | 39 | /// The database id, set if the object has been inserted into the 40 | /// database or if it has been fetched from the database. Otherwise, 41 | /// the id will be null. 42 | int? id; 43 | 44 | String text; 45 | 46 | String sender; 47 | 48 | DateTime? sent; 49 | 50 | Chat copyWith({ 51 | int? id, 52 | String? text, 53 | String? sender, 54 | DateTime? sent, 55 | }); 56 | @override 57 | Map toJson() { 58 | return { 59 | if (id != null) 'id': id, 60 | 'text': text, 61 | 'sender': sender, 62 | if (sent != null) 'sent': sent?.toJson(), 63 | }; 64 | } 65 | 66 | @override 67 | String toString() { 68 | return _i1.SerializationManager.encode(this); 69 | } 70 | } 71 | 72 | class _Undefined {} 73 | 74 | class _ChatImpl extends Chat { 75 | _ChatImpl({ 76 | int? id, 77 | required String text, 78 | required String sender, 79 | DateTime? sent, 80 | }) : super._( 81 | id: id, 82 | text: text, 83 | sender: sender, 84 | sent: sent, 85 | ); 86 | 87 | @override 88 | Chat copyWith({ 89 | Object? id = _Undefined, 90 | String? text, 91 | String? sender, 92 | Object? sent = _Undefined, 93 | }) { 94 | return Chat( 95 | id: id is int? ? id : this.id, 96 | text: text ?? this.text, 97 | sender: sender ?? this.sender, 98 | sent: sent is DateTime? ? sent : this.sent, 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/lib/src/protocol/example.dart: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ 2 | /* To generate run: "serverpod generate" */ 3 | 4 | // ignore_for_file: library_private_types_in_public_api 5 | // ignore_for_file: public_member_api_docs 6 | // ignore_for_file: implementation_imports 7 | // ignore_for_file: use_super_parameters 8 | // ignore_for_file: type_literal_in_constant_pattern 9 | 10 | // ignore_for_file: no_leading_underscores_for_library_prefixes 11 | import 'package:serverpod_client/serverpod_client.dart' as _i1; 12 | 13 | abstract class Example implements _i1.SerializableModel { 14 | Example._({ 15 | required this.name, 16 | required this.data, 17 | }); 18 | 19 | factory Example({ 20 | required String name, 21 | required int data, 22 | }) = _ExampleImpl; 23 | 24 | factory Example.fromJson(Map jsonSerialization) { 25 | return Example( 26 | name: jsonSerialization['name'] as String, 27 | data: jsonSerialization['data'] as int, 28 | ); 29 | } 30 | 31 | String name; 32 | 33 | int data; 34 | 35 | Example copyWith({ 36 | String? name, 37 | int? data, 38 | }); 39 | @override 40 | Map toJson() { 41 | return { 42 | 'name': name, 43 | 'data': data, 44 | }; 45 | } 46 | 47 | @override 48 | String toString() { 49 | return _i1.SerializationManager.encode(this); 50 | } 51 | } 52 | 53 | class _ExampleImpl extends Example { 54 | _ExampleImpl({ 55 | required String name, 56 | required int data, 57 | }) : super._( 58 | name: name, 59 | data: data, 60 | ); 61 | 62 | @override 63 | Example copyWith({ 64 | String? name, 65 | int? data, 66 | }) { 67 | return Example( 68 | name: name ?? this.name, 69 | data: data ?? this.data, 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/lib/src/protocol/message.chat.dart: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ 2 | /* To generate run: "serverpod generate" */ 3 | 4 | // ignore_for_file: library_private_types_in_public_api 5 | // ignore_for_file: public_member_api_docs 6 | // ignore_for_file: implementation_imports 7 | // ignore_for_file: use_super_parameters 8 | // ignore_for_file: type_literal_in_constant_pattern 9 | 10 | // ignore_for_file: no_leading_underscores_for_library_prefixes 11 | import 'package:serverpod_client/serverpod_client.dart' as _i1; 12 | 13 | abstract class Message implements _i1.SerializableModel { 14 | Message._({ 15 | this.id, 16 | required this.text, 17 | required this.sender, 18 | required this.receiver, 19 | this.sent, 20 | }); 21 | 22 | factory Message({ 23 | int? id, 24 | required String text, 25 | required String sender, 26 | required String receiver, 27 | DateTime? sent, 28 | }) = _MessageImpl; 29 | 30 | factory Message.fromJson(Map jsonSerialization) { 31 | return Message( 32 | id: jsonSerialization['id'] as int?, 33 | text: jsonSerialization['text'] as String, 34 | sender: jsonSerialization['sender'] as String, 35 | receiver: jsonSerialization['receiver'] as String, 36 | sent: jsonSerialization['sent'] == null 37 | ? null 38 | : _i1.DateTimeJsonExtension.fromJson(jsonSerialization['sent']), 39 | ); 40 | } 41 | 42 | /// The database id, set if the object has been inserted into the 43 | /// database or if it has been fetched from the database. Otherwise, 44 | /// the id will be null. 45 | int? id; 46 | 47 | String text; 48 | 49 | String sender; 50 | 51 | String receiver; 52 | 53 | DateTime? sent; 54 | 55 | Message copyWith({ 56 | int? id, 57 | String? text, 58 | String? sender, 59 | String? receiver, 60 | DateTime? sent, 61 | }); 62 | @override 63 | Map toJson() { 64 | return { 65 | if (id != null) 'id': id, 66 | 'text': text, 67 | 'sender': sender, 68 | 'receiver': receiver, 69 | if (sent != null) 'sent': sent?.toJson(), 70 | }; 71 | } 72 | 73 | @override 74 | String toString() { 75 | return _i1.SerializationManager.encode(this); 76 | } 77 | } 78 | 79 | class _Undefined {} 80 | 81 | class _MessageImpl extends Message { 82 | _MessageImpl({ 83 | int? id, 84 | required String text, 85 | required String sender, 86 | required String receiver, 87 | DateTime? sent, 88 | }) : super._( 89 | id: id, 90 | text: text, 91 | sender: sender, 92 | receiver: receiver, 93 | sent: sent, 94 | ); 95 | 96 | @override 97 | Message copyWith({ 98 | Object? id = _Undefined, 99 | String? text, 100 | String? sender, 101 | String? receiver, 102 | Object? sent = _Undefined, 103 | }) { 104 | return Message( 105 | id: id is int? ? id : this.id, 106 | text: text ?? this.text, 107 | sender: sender ?? this.sender, 108 | receiver: receiver ?? this.receiver, 109 | sent: sent is DateTime? ? sent : this.sent, 110 | ); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/lib/src/protocol/typing.chat.dart: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ 2 | /* To generate run: "serverpod generate" */ 3 | 4 | // ignore_for_file: library_private_types_in_public_api 5 | // ignore_for_file: public_member_api_docs 6 | // ignore_for_file: implementation_imports 7 | // ignore_for_file: use_super_parameters 8 | // ignore_for_file: type_literal_in_constant_pattern 9 | 10 | // ignore_for_file: no_leading_underscores_for_library_prefixes 11 | import 'package:serverpod_client/serverpod_client.dart' as _i1; 12 | 13 | abstract class TypingIndicator implements _i1.SerializableModel { 14 | TypingIndicator._({ 15 | required this.typerID, 16 | required this.status, 17 | }); 18 | 19 | factory TypingIndicator({ 20 | required int typerID, 21 | required bool status, 22 | }) = _TypingIndicatorImpl; 23 | 24 | factory TypingIndicator.fromJson(Map jsonSerialization) { 25 | return TypingIndicator( 26 | typerID: jsonSerialization['typerID'] as int, 27 | status: jsonSerialization['status'] as bool, 28 | ); 29 | } 30 | 31 | int typerID; 32 | 33 | bool status; 34 | 35 | TypingIndicator copyWith({ 36 | int? typerID, 37 | bool? status, 38 | }); 39 | @override 40 | Map toJson() { 41 | return { 42 | 'typerID': typerID, 43 | 'status': status, 44 | }; 45 | } 46 | 47 | @override 48 | String toString() { 49 | return _i1.SerializationManager.encode(this); 50 | } 51 | } 52 | 53 | class _TypingIndicatorImpl extends TypingIndicator { 54 | _TypingIndicatorImpl({ 55 | required int typerID, 56 | required bool status, 57 | }) : super._( 58 | typerID: typerID, 59 | status: status, 60 | ); 61 | 62 | @override 63 | TypingIndicator copyWith({ 64 | int? typerID, 65 | bool? status, 66 | }) { 67 | return TypingIndicator( 68 | typerID: typerID ?? this.typerID, 69 | status: status ?? this.status, 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /chat_app_serverpod_client/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chat_app_serverpod_client 2 | description: Starting point for a Serverpod client. 3 | 4 | environment: 5 | sdk: ">=3.2.0 <4.0.0" 6 | 7 | dependencies: 8 | serverpod_client: 2.8.0 9 | serverpod_auth_client: ^2.8.0 10 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolization related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | 48 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 17 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 18 | - platform: android 19 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 20 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 21 | - platform: ios 22 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 23 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 24 | - platform: linux 25 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 26 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 27 | - platform: macos 28 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 29 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 30 | - platform: web 31 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 32 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 33 | - platform: windows 34 | create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 35 | base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/README.md: -------------------------------------------------------------------------------- 1 | # chat_app_serverpod_flutter 2 | 3 | A new Flutter project with Serverpod. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application that is using 8 | Serverpod. 9 | 10 | A great starting point for learning Serverpod is our documentation site at: 11 | [https://docs.serverpod.dev](https://docs.serverpod.dev). 12 | 13 | To run the project, first make sure that the server is running, then do: 14 | 15 | flutter run 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id "dev.flutter.flutter-gradle-plugin" 6 | } 7 | 8 | def localProperties = new Properties() 9 | def localPropertiesFile = rootProject.file("local.properties") 10 | if (localPropertiesFile.exists()) { 11 | localPropertiesFile.withReader("UTF-8") { reader -> 12 | localProperties.load(reader) 13 | } 14 | } 15 | 16 | def flutterVersionCode = localProperties.getProperty("flutter.versionCode") 17 | if (flutterVersionCode == null) { 18 | flutterVersionCode = "1" 19 | } 20 | 21 | def flutterVersionName = localProperties.getProperty("flutter.versionName") 22 | if (flutterVersionName == null) { 23 | flutterVersionName = "1.0" 24 | } 25 | 26 | android { 27 | namespace = "com.example.chat_app_serverpod_flutter" 28 | compileSdk = flutter.compileSdkVersion 29 | ndkVersion = flutter.ndkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility = JavaVersion.VERSION_1_8 33 | targetCompatibility = JavaVersion.VERSION_1_8 34 | } 35 | 36 | defaultConfig { 37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 38 | applicationId = "com.example.chat_app_serverpod_flutter" 39 | // You can update the following values to match your application needs. 40 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 41 | minSdk = flutter.minSdkVersion 42 | targetSdk = flutter.targetSdkVersion 43 | versionCode = flutterVersionCode.toInteger() 44 | versionName = flutterVersionName 45 | } 46 | 47 | buildTypes { 48 | release { 49 | // TODO: Add your own signing config for the release build. 50 | // Signing with the debug keys for now, so `flutter run --release` works. 51 | signingConfig = signingConfigs.debug 52 | } 53 | } 54 | } 55 | 56 | flutter { 57 | source = "../.." 58 | } 59 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 16 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 34 | 35 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/kotlin/com/example/chat_app_serverpod_flutter/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.chat_app_serverpod_flutter 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = "../build" 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(":app") 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip 6 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "7.3.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | $(DEVELOPMENT_LANGUAGE) 12 | CFBundleDisplayName 13 | Chat App Serverpod Flutter 14 | CFBundleExecutable 15 | $(EXECUTABLE_NAME) 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | chat_app_serverpod_flutter 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | $(FLUTTER_BUILD_NAME) 26 | CFBundleSignature 27 | ???? 28 | CFBundleVersion 29 | $(FLUTTER_BUILD_NUMBER) 30 | LSRequiresIPhoneOS 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIMainStoryboardFile 35 | Main 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | CADisableMinimumFrameDurationOnPhone 50 | 51 | UIApplicationSupportsIndirectInputEvents 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/functions/initialize_auth.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_client/chat_app_serverpod_client.dart'; 2 | import 'package:serverpod_auth_shared_flutter/serverpod_auth_shared_flutter.dart'; 3 | import 'package:serverpod_flutter/serverpod_flutter.dart'; 4 | 5 | late SessionManager sessionManager; 6 | late Client client; 7 | 8 | Future initializeServerpodClient() async { 9 | // Sets up a singleton client object that can be used to talk to the server from 10 | // anywhere in our app. The client is generated from your server code. 11 | // The client is set up to connect to a Serverpod running on a local server on 12 | // the default port. You will need to modify this to connect to staging or 13 | // production servers. 14 | const ipAddress = '10.0.2.2'; // Android emulator ip for the host 15 | // const String ipAddress = '192.168.2.105'; 16 | // const ipAddress = 'localhost'; //For PC/Web 17 | 18 | // Sets up a singleton client object that can be used to talk to the server from 19 | // anywhere in our app. The client is generated from your server code. 20 | // The client is set up to connect to a Serverpod running on a local server on 21 | // the default port. You will need to modify this to connect to staging or 22 | // production servers. 23 | client = Client( 24 | 'http://$ipAddress:8080/', 25 | authenticationKeyManager: FlutterAuthenticationKeyManager(), 26 | )..connectivityMonitor = FlutterConnectivityMonitor(); 27 | 28 | // The session manager keeps track of the signed-in state of the user. You 29 | // can query it to see if the user is currently signed in and get information 30 | // about the user. 31 | sessionManager = SessionManager( 32 | caller: client.modules.auth, 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_client/chat_app_serverpod_client.dart'; 2 | import 'package:chat_app_serverpod_flutter/functions/initialize_auth.dart'; 3 | import 'package:chat_app_serverpod_flutter/screens/home_page.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:serverpod_flutter/serverpod_flutter.dart'; 6 | 7 | // Sets up a singleton client object that can be used to talk to the server from 8 | // anywhere in our app. The client is generated from your server code. 9 | // The client is set up to connect to a Serverpod running on a local server on 10 | // the default port. You will need to modify this to connect to staging or 11 | // production servers. 12 | var client = Client('http://$localhost:8080/') 13 | ..connectivityMonitor = FlutterConnectivityMonitor(); 14 | 15 | void main() async { 16 | WidgetsFlutterBinding.ensureInitialized(); 17 | await initializeServerpodClient(); 18 | runApp(const MyApp()); 19 | } 20 | 21 | class MyApp extends StatelessWidget { 22 | const MyApp({super.key}); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return MaterialApp( 27 | debugShowCheckedModeBanner: false, 28 | title: 'Serverpod Demo', 29 | theme: ThemeData( 30 | primarySwatch: Colors.blue, 31 | ), 32 | home: const HomeScreen(), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/screens/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_flutter/functions/initialize_auth.dart'; 2 | import 'package:chat_app_serverpod_flutter/screens/chat_screen.dart'; 3 | import 'package:chat_app_serverpod_flutter/screens/sign_in_page.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class HomeScreen extends StatefulWidget { 7 | const HomeScreen({super.key}); 8 | 9 | @override 10 | State createState() => _HomeScreenState(); 11 | } 12 | 13 | class _HomeScreenState extends State { 14 | @override 15 | void initState() { 16 | super.initState(); 17 | sessionManager.addListener(() { 18 | setState(() {}); 19 | }); 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | // body: ChatScreen(), 26 | body: sessionManager.isSignedIn ? const ChatScreen() : const SignInPage(), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/screens/sign_in_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_flutter/functions/initialize_auth.dart'; 2 | import 'package:chat_app_serverpod_flutter/widgets/sign_in_widget.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; // Make sure to add this dependency 5 | 6 | class SignInPage extends StatefulWidget { 7 | const SignInPage({super.key}); 8 | 9 | @override 10 | State createState() => _SignInPageState(); 11 | } 12 | 13 | class _SignInPageState extends State { 14 | bool isConnected = false; 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | 20 | //This monitor works mostly on stram connection. So using it here may useless. Just dummy. 21 | client.connectivityMonitor?.addListener((e) { 22 | setState(() { 23 | isConnected = e; 24 | }); 25 | }); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | body: Container( 32 | decoration: const BoxDecoration( 33 | gradient: LinearGradient( 34 | colors: [Color(0xFF00C9FF), Color(0xFF92FE9D)], // Gradient colors 35 | begin: Alignment.topLeft, 36 | end: Alignment.bottomRight, 37 | ), 38 | ), 39 | child: Center( 40 | child: Column( 41 | mainAxisAlignment: MainAxisAlignment.center, 42 | children: [ 43 | const Text( 44 | 'Welcome to the ChatRoom made with Serverpod', 45 | style: TextStyle( 46 | fontSize: 24, 47 | fontWeight: FontWeight.bold, 48 | color: Colors.white, 49 | ), 50 | textAlign: TextAlign.center, 51 | ), 52 | const SizedBox(height: 20), 53 | const SignInWidget(), 54 | const SizedBox(height: 20), 55 | Row( 56 | mainAxisAlignment: MainAxisAlignment.center, 57 | children: [ 58 | Icon( 59 | isConnected 60 | ? FontAwesomeIcons.solidCheckCircle 61 | : FontAwesomeIcons.solidCheckCircle, 62 | color: Colors.greenAccent, 63 | size: 20, 64 | ), 65 | const SizedBox(width: 10), 66 | Text( 67 | isConnected 68 | ? 'Server Status: Online' 69 | : 'Server Status: Offline', 70 | style: TextStyle( 71 | fontSize: 18, 72 | fontWeight: FontWeight.bold, 73 | color: Colors.white, 74 | ), 75 | ), 76 | ], 77 | ), 78 | const SizedBox(height: 20), 79 | const Text( 80 | 'Version 1.0', 81 | style: TextStyle( 82 | fontSize: 16, 83 | color: Colors.white70, 84 | ), 85 | ), 86 | ], 87 | ), 88 | ), 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/utils/data.dart: -------------------------------------------------------------------------------- 1 | import 'package:chatview/chatview.dart'; 2 | 3 | class Data { 4 | static const profileImage = 5 | "https://raw.githubusercontent.com/SimformSolutionsPvtLtd/flutter_showcaseview/master/example/assets/simform.png"; 6 | static final messageList = [ 7 | Message( 8 | id: '1', 9 | message: "Hi!", 10 | createdAt: DateTime.now(), 11 | sendBy: '1', // userId of who sends the message 12 | status: MessageStatus.read, 13 | ), 14 | Message( 15 | id: '2', 16 | message: "Hi!", 17 | createdAt: DateTime.now(), 18 | sendBy: '2', 19 | status: MessageStatus.read, 20 | ), 21 | Message( 22 | id: '3', 23 | message: "We can meet?I am free", 24 | createdAt: DateTime.now(), 25 | sendBy: '1', 26 | status: MessageStatus.read, 27 | ), 28 | Message( 29 | id: '4', 30 | message: "Can you write the time and place of the meeting?", 31 | createdAt: DateTime.now(), 32 | sendBy: '1', 33 | status: MessageStatus.read, 34 | ), 35 | Message( 36 | id: '5', 37 | message: "That's fine", 38 | createdAt: DateTime.now(), 39 | sendBy: '2', 40 | reaction: Reaction(reactions: ['\u{2764}'], reactedUserIds: ['1']), 41 | status: MessageStatus.read, 42 | ), 43 | Message( 44 | id: '6', 45 | message: "When to go ?", 46 | createdAt: DateTime.now(), 47 | sendBy: '3', 48 | status: MessageStatus.read, 49 | ), 50 | Message( 51 | id: '7', 52 | message: "I guess Simform will reply", 53 | createdAt: DateTime.now(), 54 | sendBy: '4', 55 | status: MessageStatus.read, 56 | ), 57 | Message( 58 | id: '8', 59 | message: "Hii", 60 | createdAt: DateTime.now(), 61 | sendBy: '2', 62 | reaction: Reaction( 63 | reactions: ['\u{2764}', '\u{1F44D}', '\u{1F44D}'], 64 | reactedUserIds: ['2', '3', '4'], 65 | ), 66 | status: MessageStatus.read, 67 | replyMessage: const ReplyMessage( 68 | message: "Can you write the time and place of the meeting?", 69 | replyTo: '1', 70 | replyBy: '2', 71 | messageId: '4', 72 | ), 73 | ), 74 | Message( 75 | id: '9', 76 | message: "Done", 77 | createdAt: DateTime.now(), 78 | sendBy: '1', 79 | status: MessageStatus.read, 80 | reaction: Reaction( 81 | reactions: [ 82 | '\u{2764}', 83 | '\u{2764}', 84 | '\u{2764}', 85 | ], 86 | reactedUserIds: ['2', '3', '4'], 87 | ), 88 | ), 89 | Message( 90 | id: '10', 91 | message: "Thank you!!", 92 | status: MessageStatus.read, 93 | createdAt: DateTime.now(), 94 | sendBy: '1', 95 | reaction: Reaction( 96 | reactions: ['\u{2764}', '\u{2764}', '\u{2764}', '\u{2764}'], 97 | reactedUserIds: ['2', '4', '3', '1'], 98 | ), 99 | ), 100 | Message( 101 | id: '11', 102 | message: "https://miro.medium.com/max/1000/0*s7of7kWnf9fDg4XM.jpeg", 103 | createdAt: DateTime.now(), 104 | messageType: MessageType.image, 105 | sendBy: '1', 106 | reaction: Reaction(reactions: ['\u{2764}'], reactedUserIds: ['2']), 107 | status: MessageStatus.read, 108 | ), 109 | Message( 110 | id: '12', 111 | message: "🤩🤩", 112 | createdAt: DateTime.now(), 113 | sendBy: '2', 114 | status: MessageStatus.read, 115 | ), 116 | ]; 117 | } 118 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/utils/methods.dart: -------------------------------------------------------------------------------- 1 | import 'package:chatview/chatview.dart'; 2 | 3 | ReplyMessage toFormat(Map json) { 4 | return ReplyMessage( 5 | messageId: json['id'] ?? '', 6 | message: json['message'] ?? '', 7 | replyBy: json['replyBy'] ?? '', 8 | replyTo: json['replyTo'] ?? '', 9 | messageType: MessageType.text, 10 | voiceMessageDuration: null); 11 | } 12 | 13 | Map toDeFormat(ReplyMessage json) { 14 | return { 15 | 'message': json.message, 16 | 'replyBy': json.replyBy, 17 | 'replyTo': json.replyTo, 18 | 'id': json.messageId, 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/lib/widgets/sign_in_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_flutter/main.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:serverpod_auth_email_flutter/serverpod_auth_email_flutter.dart'; 4 | 5 | class SignInWidget extends StatelessWidget { 6 | const SignInWidget({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Dialog( 12 | child: Container( 13 | width: 260, 14 | padding: const EdgeInsets.all(16), 15 | child: Column( 16 | mainAxisSize: MainAxisSize.min, 17 | crossAxisAlignment: CrossAxisAlignment.stretch, 18 | children: [ 19 | SignInWithEmailButton( 20 | caller: client.modules.auth, 21 | ), 22 | ], 23 | ), 24 | ), 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) emoji_picker_flutter_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "EmojiPickerFlutterPlugin"); 16 | emoji_picker_flutter_plugin_register_with_registrar(emoji_picker_flutter_registrar); 17 | g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); 19 | file_selector_plugin_register_with_registrar(file_selector_linux_registrar); 20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | emoji_picker_flutter 7 | file_selector_linux 8 | url_launcher_linux 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import connectivity_plus 9 | import emoji_picker_flutter 10 | import file_picker 11 | import file_selector_macos 12 | import path_provider_foundation 13 | import shared_preferences_foundation 14 | import sqflite_darwin 15 | import url_launcher_macos 16 | 17 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 18 | ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) 19 | EmojiPickerFlutterPlugin.register(with: registry.registrar(forPlugin: "EmojiPickerFlutterPlugin")) 20 | FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) 21 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 22 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 23 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 24 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 25 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 26 | } 27 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = chat_app_serverpod_flutter 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.chatAppServerpodFlutter 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.client 10 | 11 | com.apple.security.network.server 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chat_app_serverpod_flutter 2 | description: A new Flutter project with Serverpod. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: '>=3.2.0 <4.0.0' 22 | flutter: '>=3.16.0' 23 | 24 | dependencies: 25 | flutter: 26 | sdk: flutter 27 | serverpod_flutter: 2.8.0 28 | chat_app_serverpod_client: 29 | path: ../chat_app_serverpod_client 30 | serverpod_auth_email_flutter: ^2.8.0 31 | serverpod_auth_shared_flutter: ^2.8.0 32 | 33 | 34 | # The following adds the Cupertino Icons font to your application. 35 | # Use with the CupertinoIcons class for iOS style icons. 36 | cupertino_icons: ^1.0.5 37 | chatview: ^2.4.1 38 | font_awesome_flutter: ^10.7.0 39 | 40 | dev_dependencies: 41 | flutter_lints: ^5.0.0 42 | flutter_test: 43 | sdk: flutter 44 | 45 | # For information on the generic Dart part of this file, see the 46 | # following page: https://dart.dev/tools/pub/pubspec 47 | 48 | # The following section is specific to Flutter. 49 | flutter: 50 | 51 | # The following line ensures that the Material Icons font is 52 | # included with your application, so that you can use the icons in 53 | # the material Icons class. 54 | uses-material-design: true 55 | 56 | # To add assets to your application, add an assets section, like this: 57 | # assets: 58 | # - images/a_dot_burr.jpeg 59 | # - images/a_dot_ham.jpeg 60 | 61 | # An image asset can refer to one or more resolution-specific "variants", see 62 | # https://flutter.dev/assets-and-images/#resolution-aware. 63 | 64 | # For details regarding adding assets from package dependencies, see 65 | # https://flutter.dev/assets-and-images/#from-packages 66 | 67 | # To add custom fonts to your application, add a fonts section here, 68 | # in this "flutter" section. Each entry in this list should have a 69 | # "family" key with the font family name, and a "fonts" key with a 70 | # list giving the asset and other descriptors for the font. For 71 | # example: 72 | # fonts: 73 | # - family: Schyler 74 | # fonts: 75 | # - asset: fonts/Schyler-Regular.ttf 76 | # - asset: fonts/Schyler-Italic.ttf 77 | # style: italic 78 | # - family: Trajan Pro 79 | # fonts: 80 | # - asset: fonts/TrajanPro.ttf 81 | # - asset: fonts/TrajanPro_Bold.ttf 82 | # weight: 700 83 | # 84 | # For details regarding fonts from package dependencies, 85 | # see https://flutter.dev/custom-fonts/#from-packages 86 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | // import 'package:flutter/material.dart'; 9 | // import 'package:flutter_test/flutter_test.dart'; 10 | // 11 | // import 'package:PROJECTNAME_flutter/main.dart'; 12 | 13 | void main() { 14 | // Add your app tests here 15 | } 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/web/favicon.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/web/icons/Icon-192.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/web/icons/Icon-512.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | chat_app_serverpod_flutter 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chat_app_serverpod_flutter", 3 | "short_name": "chat_app_serverpod_flutter", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void RegisterPlugins(flutter::PluginRegistry* registry) { 15 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 16 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 17 | EmojiPickerFlutterPluginCApiRegisterWithRegistrar( 18 | registry->GetRegistrarForPlugin("EmojiPickerFlutterPluginCApi")); 19 | FileSelectorWindowsRegisterWithRegistrar( 20 | registry->GetRegistrarForPlugin("FileSelectorWindows")); 21 | UrlLauncherWindowsRegisterWithRegistrar( 22 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 23 | } 24 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | connectivity_plus 7 | emoji_picker_flutter 8 | file_selector_windows 9 | url_launcher_windows 10 | ) 11 | 12 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 13 | ) 14 | 15 | set(PLUGIN_BUNDLED_LIBRARIES) 16 | 17 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 18 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 19 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 22 | endforeach(plugin) 23 | 24 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 25 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 26 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 27 | endforeach(ffi_plugin) 28 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "chat_app_serverpod_flutter" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "chat_app_serverpod_flutter" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "chat_app_serverpod_flutter.exe" "\0" 98 | VALUE "ProductName", "chat_app_serverpod_flutter" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"chat_app_serverpod_flutter", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_flutter/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | unsigned int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length == 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /chat_app_serverpod_flutter/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_server/.DS_Store -------------------------------------------------------------------------------- /chat_app_serverpod_server/.gcloudignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | 11 | # Passwords file 12 | config/passwords.yaml 13 | 14 | # Firebase service account key for Firebase auth 15 | config/firebase_service_account_key.json 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dart:3.2.5 AS build 2 | 3 | WORKDIR /app 4 | COPY . . 5 | 6 | RUN dart pub get 7 | RUN dart compile exe bin/main.dart -o bin/server 8 | 9 | FROM alpine:latest 10 | 11 | ENV runmode=production 12 | ENV serverid=default 13 | ENV logging=normal 14 | ENV role=monolith 15 | 16 | COPY --from=build /runtime/ / 17 | COPY --from=build /app/bin/server server 18 | COPY --from=build /app/config/ config/ 19 | COPY --from=build /app/web/ web/ 20 | 21 | EXPOSE 8080 22 | EXPOSE 8081 23 | EXPOSE 8082 24 | 25 | ENTRYPOINT ./server --mode=$runmode --server-id=$serverid --logging=$logging --role=$role 26 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/README.md: -------------------------------------------------------------------------------- 1 | # chat_app_serverpod_server 2 | 3 | This is the starting point for your Serverpod server. 4 | 5 | To run your server, you first need to start Postgres and Redis. It's easiest to do with Docker. 6 | 7 | docker compose up --build --detach 8 | 9 | Then you can start the Serverpod server. 10 | 11 | dart bin/main.dart 12 | 13 | When you are finished, you can shut down Serverpod with `Ctrl-C`, then stop Postgres and Redis. 14 | 15 | docker compose stop 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the static analysis results for your project (errors, 2 | # warnings, and lints). 3 | # 4 | # This enables the 'recommended' set of lints from `package:lints`. 5 | # This set helps identify many issues that may lead to problems when running 6 | # or consuming Dart code, and enforces writing Dart using a single, idiomatic 7 | # style and format. 8 | # 9 | # If you want a smaller set of lints you can change this to specify 10 | # 'package:lints/core.yaml'. These are just the most critical lints 11 | # (the recommended set includes the core lints). 12 | # The core lints are also what is used by pub.dev for scoring packages. 13 | 14 | include: package:lints/recommended.yaml 15 | 16 | # Uncomment the following section to specify additional rules. 17 | 18 | # linter: 19 | # rules: 20 | # - camel_case_types 21 | 22 | # analyzer: 23 | # exclude: 24 | # - path/to/excluded/files/** 25 | 26 | # For more information about the core and recommended set of lints, see 27 | # https://dart.dev/go/core-lints 28 | 29 | # For additional information about configuring this file, see 30 | # https://dart.dev/guides/language/analysis-options 31 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_server/server.dart'; 2 | 3 | /// This is the starting point for your Serverpod server. Typically, there is 4 | /// no need to modify this file. 5 | void main(List args) { 6 | run(args); 7 | } 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/config/development.yaml: -------------------------------------------------------------------------------- 1 | # This is the configuration file for your local development environment. By 2 | # default, it runs a single server on port 8080. To set up your server, you will 3 | # need to add the name of the database you are connecting to and the user name. 4 | # The password for the database is stored in the config/passwords.yaml. 5 | # 6 | # When running your server locally, the server ports are the same as the public 7 | # facing ports. 8 | 9 | # Configuration for the main API server. 10 | apiServer: 11 | port: 8080 12 | publicHost: localhost 13 | publicPort: 8080 14 | publicScheme: http 15 | 16 | # Configuration for the Insights server. 17 | insightsServer: 18 | port: 8081 19 | publicHost: localhost 20 | publicPort: 8081 21 | publicScheme: http 22 | 23 | # Configuration for the web server. 24 | webServer: 25 | port: 8082 26 | publicHost: localhost 27 | publicPort: 8082 28 | publicScheme: http 29 | 30 | # This is the database setup for your server. 31 | database: 32 | host: localhost 33 | port: 8090 34 | name: chat_app_serverpod 35 | user: postgres 36 | 37 | # This is the setup for Redis. 38 | redis: 39 | enabled: false 40 | host: localhost 41 | port: 8091 -------------------------------------------------------------------------------- /chat_app_serverpod_server/config/generator.yaml: -------------------------------------------------------------------------------- 1 | type: server 2 | 3 | client_package_path: ../chat_app_serverpod_client 4 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/config/production.yaml: -------------------------------------------------------------------------------- 1 | # This is the configuration file for your production environment. 2 | # Typically, you will want to route the traffic through a load balancer 3 | # which adds SSL security through https. If you use Serverpod's standard 4 | # Terraform scripts to deploy your server, all you need to change in 5 | # this file is the examplepod.com domain name. 6 | 7 | # Configuration for the main API server. 8 | apiServer: 9 | port: 8080 10 | publicHost: api.examplepod.com 11 | publicPort: 443 12 | publicScheme: https 13 | 14 | # Configuration for the Insights server. 15 | insightsServer: 16 | port: 8081 17 | publicHost: insights.examplepod.com 18 | publicPort: 443 19 | publicScheme: https 20 | 21 | # Configuration for the web server. 22 | webServer: 23 | port: 8082 24 | publicHost: app.examplepod.com 25 | publicPort: 443 26 | publicScheme: https 27 | 28 | # This is the database setup for your servers. The default for the Google Cloud 29 | # Engine Terraform configuration is to connect on a private IP address. 30 | # If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you 31 | # connect on the public IP of the database e.g. database.examplepod.com. 32 | database: 33 | host: database.private-production.examplepod.com 34 | port: 5432 35 | name: serverpod 36 | user: postgres 37 | 38 | # This is the setup for Redis. The default for the Google Cloud Engine Terraform 39 | # configuration is to connect on a private IP address. 40 | # If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you 41 | # connect on the public IP of the database e.g. redis.examplepod.com. 42 | redis: 43 | enabled: false 44 | host: redis.private-production.examplepod.com 45 | port: 6379 46 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/config/staging.yaml: -------------------------------------------------------------------------------- 1 | # This is the configuration file for your staging environment. The staging 2 | # environment is meant to resemble the production environment as much as 3 | # possible and may connect to production databases services and data. You use it 4 | # for final testing before deploying the production server. 5 | # 6 | # Typically, you will want to route the traffic through a load balancer 7 | # which adds SSL security through https. If you use Serverpod's standard 8 | # Terraform scripts to deploy your server, all you need to change in 9 | # this file is the examplepod.com domain name. 10 | 11 | # Configuration for the main API server. 12 | apiServer: 13 | port: 8080 14 | publicHost: api-staging.examplepod.com 15 | publicPort: 443 16 | publicScheme: https 17 | 18 | # Configuration for the Insights server. 19 | insightsServer: 20 | port: 8081 21 | publicHost: insights-staging.examplepod.com 22 | publicPort: 443 23 | publicScheme: https 24 | 25 | # Configuration for the web server. 26 | webServer: 27 | port: 8082 28 | publicHost: app-staging.examplepod.com 29 | publicPort: 443 30 | publicScheme: https 31 | 32 | # This is the database setup for your servers. The default for the Google Cloud 33 | # Engine Terraform configuration is to connect on a private IP address. 34 | # If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you 35 | # connect on the public IP of the database e.g. database-staging.examplepod.com. 36 | database: 37 | host: database.private-staging.examplepod.com 38 | port: 5432 39 | name: serverpod 40 | user: postgres 41 | 42 | # This is the setup for Redis. The default for the Google Cloud Engine Terraform 43 | # configuration is to connect on a private IP address. 44 | # If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you 45 | # connect on the public IP of the database e.g. redis-staging.examplepod.com. 46 | redis: 47 | enabled: false 48 | host: redis.private-staging.examplepod.com 49 | port: 6379 50 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_server/deploy/.DS_Store -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/scripts/appspec.yml: -------------------------------------------------------------------------------- 1 | version: 0.0 2 | os: linux 3 | files: 4 | - source: /vendor/ 5 | destination: /home/ec2-user/serverpod/upload/vendor/ 6 | - source: /chat_app_serverpod_server/ 7 | destination: /home/ec2-user/serverpod/upload/chat_app_serverpod_server/ 8 | hooks: 9 | BeforeInstall: 10 | - location: chat_app_serverpod_server/deploy/aws/scripts/install_dependencies 11 | timeout: 300 12 | runas: root 13 | ApplicationStart: 14 | - location: chat_app_serverpod_server/deploy/aws/scripts/start_server 15 | timeout: 300 16 | runas: root 17 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/scripts/install_dependencies: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cat > /lib/systemd/system/serverpod.service << EOF 3 | [Unit] 4 | Description=Serverpod server 5 | After=multi-user.target 6 | 7 | [Service] 8 | User=ec2-user 9 | WorkingDirectory=/home/ec2-user 10 | ExecStart=/home/ec2-user/serverpod/active/chat_app_serverpod_server/deploy/aws/scripts/run_serverpod 11 | Restart=always 12 | 13 | [Install] 14 | WantedBy=muti-user.target 15 | WantedBy=network-online.target 16 | EOF 17 | 18 | systemctl daemon-reload 19 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/scripts/run_serverpod: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | RUNMODE=$(cat /home/ec2-user/runmode) 3 | SERVER_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) 4 | cd /home/ec2-user/serverpod/active/chat_app_serverpod_server 5 | /usr/lib/dart/bin/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 6 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/scripts/start_server: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Make sure permissions are correct for the serverpod directory 4 | chown -R ec2-user:ec2-user /home/ec2-user/serverpod 5 | 6 | # Run pub get as ec2-user 7 | cd /home/ec2-user/serverpod/upload/chat_app_serverpod_server/ 8 | sudo -u ec2-user /usr/lib/dart/bin/dart pub get 9 | 10 | # Set correct permissions for start script 11 | chmod 755 deploy/aws/scripts/run_serverpod 12 | 13 | # Stop the server if it's running, copy files, and restart 14 | systemctl stop serverpod 15 | 16 | rm -rf /home/ec2-user/serverpod/active/ 17 | cp -rp /home/ec2-user/serverpod/upload/ /home/ec2-user/serverpod/active/ 18 | 19 | systemctl start serverpod 20 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/cloudfront-web-staging.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | alb_origin_id_staging = "${var.project_name}-web-staging" 3 | } 4 | 5 | resource "aws_cloudfront_distribution" "web_staging" { 6 | count = var.enable_staging_server ? 1 : 0 7 | 8 | origin { 9 | origin_id = local.alb_origin_id_staging 10 | domain_name = aws_lb.serverpod_staging[0].dns_name 11 | custom_origin_config { 12 | http_port = 80 13 | https_port = 443 14 | origin_protocol_policy = "http-only" 15 | origin_ssl_protocols = ["SSLv3"] 16 | } 17 | } 18 | enabled = true 19 | 20 | aliases = ["${var.subdomain_web_staging}.${var.top_domain}"] 21 | 22 | default_cache_behavior { 23 | allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] 24 | cached_methods = ["HEAD", "GET"] 25 | target_origin_id = local.alb_origin_id_staging 26 | 27 | forwarded_values { 28 | query_string = true 29 | 30 | cookies { 31 | forward = "all" 32 | } 33 | 34 | headers = ["*"] 35 | } 36 | 37 | viewer_protocol_policy = "redirect-to-https" 38 | min_ttl = 0 39 | default_ttl = 0 40 | max_ttl = 0 41 | } 42 | 43 | price_class = "PriceClass_100" 44 | 45 | viewer_certificate { 46 | acm_certificate_arn = var.cloudfront_certificate_arn 47 | ssl_support_method = "sni-only" 48 | } 49 | 50 | restrictions { 51 | geo_restriction { 52 | restriction_type = "none" 53 | } 54 | } 55 | } 56 | 57 | resource "aws_route53_record" "web_staging" { 58 | count = var.enable_staging_server ? 1 : 0 59 | 60 | zone_id = var.hosted_zone_id 61 | name = "${var.subdomain_web_staging}.${var.top_domain}" 62 | type = "CNAME" 63 | ttl = "300" 64 | records = ["${aws_cloudfront_distribution.web_staging[0].domain_name}"] 65 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/cloudfront-web.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | alb_origin_id = "${var.project_name}-web" 3 | } 4 | 5 | resource "aws_cloudfront_distribution" "web" { 6 | origin { 7 | origin_id = local.alb_origin_id 8 | domain_name = aws_lb.serverpod.dns_name 9 | custom_origin_config { 10 | http_port = 80 11 | https_port = 443 12 | origin_protocol_policy = "http-only" 13 | origin_ssl_protocols = ["SSLv3"] 14 | } 15 | } 16 | enabled = true 17 | 18 | aliases = ["${var.subdomain_web}.${var.top_domain}", "${var.top_domain}"] 19 | 20 | default_cache_behavior { 21 | allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] 22 | cached_methods = ["HEAD", "GET"] 23 | target_origin_id = local.alb_origin_id 24 | 25 | forwarded_values { 26 | query_string = true 27 | 28 | cookies { 29 | forward = "all" 30 | } 31 | 32 | headers = ["*"] 33 | } 34 | 35 | viewer_protocol_policy = "redirect-to-https" 36 | min_ttl = 0 37 | default_ttl = 0 38 | max_ttl = 0 39 | } 40 | 41 | price_class = "PriceClass_100" 42 | 43 | viewer_certificate { 44 | acm_certificate_arn = var.cloudfront_certificate_arn 45 | ssl_support_method = "sni-only" 46 | } 47 | 48 | restrictions { 49 | geo_restriction { 50 | restriction_type = "none" 51 | } 52 | } 53 | } 54 | 55 | resource "aws_route53_record" "web" { 56 | zone_id = var.hosted_zone_id 57 | name = "${var.subdomain_web}.${var.top_domain}" 58 | type = "CNAME" 59 | ttl = "300" 60 | records = ["${aws_cloudfront_distribution.web.domain_name}"] 61 | } 62 | 63 | resource "aws_route53_record" "web_top_domain" { 64 | count = var.use_top_domain_for_web ? 1 : 0 65 | zone_id = var.hosted_zone_id 66 | name = var.top_domain 67 | type = "A" 68 | alias { 69 | name = aws_cloudfront_distribution.web.domain_name 70 | zone_id = aws_cloudfront_distribution.web.hosted_zone_id 71 | evaluate_target_health = false 72 | } 73 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/code-deploy.tf: -------------------------------------------------------------------------------- 1 | 2 | # Code deploy setup 3 | 4 | resource "aws_iam_instance_profile" "codedeploy_profile" { 5 | name = "${var.project_name}-codedeploy-profile" 6 | role = aws_iam_role.codedeploy_role.name 7 | } 8 | 9 | resource "aws_iam_role" "codedeploy_role" { 10 | name = "${var.project_name}-codedeploy-role" 11 | 12 | assume_role_policy = <> /etc/profile.d/script.sh 18 | 19 | # Install CodeDeploy agent 20 | echo "Installing CodeDeploy agent" 21 | cd /home/ec2-user 22 | wget https://aws-codedeploy-us-west-2.s3.us-west-2.amazonaws.com/latest/install 23 | chmod +x ./install 24 | ./install auto 25 | rm install 26 | 27 | # Set runmode 28 | echo "Setting runmode" 29 | echo ${runmode} > /home/ec2-user/runmode 30 | chown ec2-user:ec2-user /home/ec2-user/runmode 31 | 32 | echo "Setup done" 33 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/instances.tf: -------------------------------------------------------------------------------- 1 | 2 | # EC2 auto scaling cluster and security groups 3 | 4 | data "aws_availability_zones" "available" { 5 | state = "available" 6 | } 7 | 8 | # TODO: Fix? 9 | data "aws_ami" "amazon-linux" { 10 | most_recent = true 11 | owners = ["amazon"] 12 | 13 | filter { 14 | name = "name" 15 | values = ["amzn-ami-hvm-*-x86_64-ebs"] 16 | } 17 | } 18 | 19 | resource "aws_launch_configuration" "serverpod" { 20 | name_prefix = "${var.project_name}-" 21 | image_id = var.instance_ami 22 | # image_id = data.aws_ami.amazon-linux.id 23 | instance_type = var.instance_type 24 | user_data = templatefile("init-script.sh", { runmode = "production" }) 25 | 26 | security_groups = [ 27 | aws_security_group.serverpod.id, 28 | aws_security_group.ssh.id 29 | ] 30 | 31 | iam_instance_profile = aws_iam_instance_profile.codedeploy_profile.name 32 | 33 | lifecycle { 34 | create_before_destroy = true 35 | } 36 | } 37 | 38 | resource "aws_autoscaling_group" "serverpod" { 39 | min_size = var.autoscaling_min_size 40 | max_size = var.autoscaling_max_size 41 | desired_capacity = var.autoscaling_desired_capacity 42 | launch_configuration = aws_launch_configuration.serverpod.name 43 | vpc_zone_identifier = module.vpc.public_subnets 44 | 45 | target_group_arns = [ 46 | aws_lb_target_group.api.arn, 47 | aws_lb_target_group.insights.arn, 48 | aws_lb_target_group.web.arn 49 | ] 50 | 51 | tag { 52 | key = "Name" 53 | value = "${var.project_name}-serverpod" 54 | propagate_at_launch = true 55 | } 56 | 57 | tag { 58 | key = "CodeDeploy" 59 | value = var.project_name 60 | propagate_at_launch = true 61 | } 62 | } 63 | 64 | resource "aws_security_group" "serverpod" { 65 | name = "${var.project_name}-serverpod" 66 | 67 | ingress { 68 | from_port = 8080 69 | to_port = 8082 70 | protocol = "tcp" 71 | security_groups = [aws_security_group.api.id] 72 | } 73 | 74 | egress { 75 | from_port = 0 76 | to_port = 0 77 | protocol = "-1" 78 | cidr_blocks = ["0.0.0.0/0"] 79 | } 80 | 81 | vpc_id = module.vpc.vpc_id 82 | } 83 | 84 | resource "aws_security_group" "ssh" { 85 | name = "${var.project_name}-ssh" 86 | 87 | ingress { 88 | from_port = 22 89 | to_port = 22 90 | protocol = "tcp" 91 | cidr_blocks = ["0.0.0.0/0"] 92 | } 93 | 94 | egress { 95 | from_port = 0 96 | to_port = 0 97 | protocol = "-1" 98 | cidr_blocks = ["0.0.0.0/0"] 99 | } 100 | 101 | vpc_id = module.vpc.vpc_id 102 | } 103 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/main.tf: -------------------------------------------------------------------------------- 1 | # Terraform and AWS setup 2 | 3 | terraform { 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = "~> 4.13" 8 | } 9 | } 10 | 11 | required_version = ">= 1.1.9" 12 | } 13 | 14 | provider "aws" { 15 | # profile = "default" 16 | region = var.aws_region 17 | } 18 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/redis.tf: -------------------------------------------------------------------------------- 1 | resource "aws_elasticache_cluster" "redis" { 2 | count = var.enable_redis ? 1 : 0 3 | 4 | cluster_id = var.project_name 5 | engine = "redis" 6 | node_type = "cache.t4g.micro" 7 | num_cache_nodes = 1 8 | engine_version = "6.x" 9 | port = 6379 10 | apply_immediately = true 11 | security_group_ids = [aws_security_group.redis[0].id] 12 | subnet_group_name = aws_elasticache_subnet_group.redis[0].name 13 | } 14 | 15 | resource "aws_route53_record" "redis" { 16 | count = var.enable_redis ? 1 : 0 17 | 18 | zone_id = var.hosted_zone_id 19 | name = "${var.subdomain_redis}.${var.top_domain}" 20 | type = "CNAME" 21 | ttl = "300" 22 | records = ["${aws_elasticache_cluster.redis[0].cache_nodes[0].address}"] 23 | } 24 | 25 | # Makes Redis accessible from the serverpod only. 26 | resource "aws_security_group" "redis" { 27 | count = var.enable_redis ? 1 : 0 28 | 29 | name = "${var.project_name}-redis" 30 | ingress { 31 | from_port = 6379 32 | to_port = 6379 33 | protocol = "tcp" 34 | security_groups = [aws_security_group.serverpod.id] 35 | } 36 | 37 | vpc_id = module.vpc.vpc_id 38 | } 39 | 40 | resource "aws_elasticache_subnet_group" "redis" { 41 | count = var.enable_redis ? 1 : 0 42 | 43 | name = "${var.project_name}-subnet" 44 | subnet_ids = module.vpc.public_subnets 45 | } 46 | 47 | # Staging 48 | resource "aws_elasticache_cluster" "redis_staging" { 49 | count = var.enable_redis && var.enable_staging_server ? 1 : 0 50 | 51 | cluster_id = var.project_name 52 | engine = "redis" 53 | node_type = "cache.t4g.micro" 54 | num_cache_nodes = 1 55 | engine_version = "6.x" 56 | port = 6379 57 | apply_immediately = true 58 | security_group_ids = [aws_security_group.redis[0].id] 59 | subnet_group_name = aws_elasticache_subnet_group.redis[0].name 60 | } 61 | 62 | resource "aws_route53_record" "redis_staging" { 63 | count = var.enable_redis && var.enable_staging_server ? 1 : 0 64 | 65 | zone_id = var.hosted_zone_id 66 | name = "${var.subdomain_redis_staging}.${var.top_domain}" 67 | type = "CNAME" 68 | ttl = "300" 69 | records = ["${aws_elasticache_cluster.redis_staging[0].cache_nodes[0].address}"] 70 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/staging.tf: -------------------------------------------------------------------------------- 1 | resource "aws_launch_configuration" "staging" { 2 | count = var.enable_staging_server ? 1 : 0 3 | 4 | name_prefix = "${var.project_name}-staging-" 5 | image_id = var.instance_ami 6 | # image_id = data.aws_ami.amazon-linux.id 7 | instance_type = var.staging_instance_type 8 | user_data = templatefile("init-script.sh", { runmode = "staging" }) 9 | 10 | security_groups = [ 11 | aws_security_group.serverpod.id, 12 | aws_security_group.ssh.id 13 | ] 14 | 15 | iam_instance_profile = aws_iam_instance_profile.codedeploy_profile.name 16 | 17 | lifecycle { 18 | create_before_destroy = true 19 | } 20 | } 21 | 22 | resource "aws_autoscaling_group" "staging" { 23 | count = var.enable_staging_server ? 1 : 0 24 | 25 | min_size = var.staging_autoscaling_min_size 26 | max_size = var.staging_autoscaling_max_size 27 | desired_capacity = var.staging_autoscaling_desired_capacity 28 | launch_configuration = aws_launch_configuration.staging[0].name 29 | vpc_zone_identifier = module.vpc.public_subnets 30 | 31 | target_group_arns = [ 32 | aws_lb_target_group.api_staging[0].arn, 33 | aws_lb_target_group.insights_staging[0].arn, 34 | aws_lb_target_group.web_staging[0].arn 35 | ] 36 | 37 | tag { 38 | key = "Name" 39 | value = "${var.project_name}-serverpod-staging" 40 | propagate_at_launch = true 41 | } 42 | 43 | tag { 44 | key = "CodeDeploy" 45 | value = "${var.project_name}-staging" 46 | propagate_at_launch = true 47 | } 48 | } 49 | 50 | resource "aws_codedeploy_deployment_group" "staging" { 51 | count = var.enable_staging_server ? 1 : 0 52 | 53 | app_name = aws_codedeploy_app.serverpod.name 54 | deployment_group_name = "${var.project_name}-staging-group" 55 | service_role_arn = aws_iam_role.codedeploy_role.arn 56 | autoscaling_groups = [aws_autoscaling_group.staging[0].id] 57 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/storage.tf: -------------------------------------------------------------------------------- 1 | # S3 buckets 2 | resource "aws_s3_bucket" "public_storage" { 3 | bucket = var.public_storage_bucket_name 4 | force_destroy = true 5 | 6 | tags = { 7 | Name = "${var.project_name} public storage" 8 | } 9 | } 10 | 11 | resource "aws_s3_bucket_acl" "public_storage" { 12 | bucket = aws_s3_bucket.public_storage.id 13 | acl = "private" 14 | } 15 | 16 | resource "aws_s3_bucket" "private_storage" { 17 | bucket = var.private_storage_bucket_name 18 | force_destroy = true 19 | 20 | tags = { 21 | Name = "${var.project_name} private storage" 22 | } 23 | } 24 | 25 | resource "aws_s3_bucket_acl" "private_storage" { 26 | bucket = aws_s3_bucket.private_storage.id 27 | acl = "private" 28 | } 29 | 30 | locals { 31 | s3_origin_id = "${var.project_name}-storage" 32 | } 33 | 34 | resource "aws_cloudfront_distribution" "public_storage" { 35 | origin { 36 | origin_id = local.s3_origin_id 37 | domain_name = aws_s3_bucket.public_storage.bucket_regional_domain_name 38 | } 39 | enabled = true 40 | 41 | aliases = ["${var.subdomain_storage}.${var.top_domain}"] 42 | 43 | default_cache_behavior { 44 | allowed_methods = ["GET", "HEAD"] 45 | cached_methods = ["GET", "HEAD"] 46 | target_origin_id = local.s3_origin_id 47 | 48 | forwarded_values { 49 | query_string = false 50 | cookies { 51 | forward = "none" 52 | } 53 | } 54 | viewer_protocol_policy = "redirect-to-https" 55 | min_ttl = 0 56 | default_ttl = 3600 57 | max_ttl = 86400 58 | } 59 | 60 | price_class = "PriceClass_100" 61 | 62 | viewer_certificate { 63 | acm_certificate_arn = var.cloudfront_certificate_arn 64 | ssl_support_method = "sni-only" 65 | } 66 | 67 | restrictions { 68 | geo_restriction { 69 | restriction_type = "none" 70 | } 71 | } 72 | } 73 | 74 | resource "aws_route53_record" "public_storage" { 75 | zone_id = var.hosted_zone_id 76 | name = "${var.subdomain_storage}.${var.top_domain}" 77 | type = "CNAME" 78 | ttl = "300" 79 | records = ["${aws_cloudfront_distribution.public_storage.domain_name}"] 80 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/aws/terraform/vpc.tf: -------------------------------------------------------------------------------- 1 | module "vpc" { 2 | source = "terraform-aws-modules/vpc/aws" 3 | version = "2.77.0" 4 | 5 | name = "${var.project_name}-vpc" 6 | cidr = "10.0.0.0/16" 7 | 8 | azs = data.aws_availability_zones.available.names 9 | public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] 10 | enable_dns_hostnames = true 11 | enable_dns_support = true 12 | 13 | # create_database_subnet_group = true 14 | # create_database_subnet_route_table = true 15 | # create_database_internet_gateway_route = true 16 | 17 | # create_elasticache_subnet_group = true 18 | } 19 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/gcp/console_gcr/cloud-run-deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # These are the variables that need to be set to be able to deploy to cloud run. 4 | # You can find the values in the Google Cloud Console. 5 | DATABASE_INSTANCE_CONNECTION_NAME="" 6 | SERVICE_ACCOUNT="" 7 | 8 | # Optionally configure the region and runmode (staging is also viable). 9 | REGION="us-central1" 10 | RUNMODE="production" 11 | 12 | 13 | # Check that we are running the script from the correct directory. 14 | if [ ! -f config/production.yaml ]; then 15 | echo "Run this script from the root of your server directory (e.g., mypod/mypod_server)." 16 | exit 1 17 | fi 18 | 19 | 20 | # Deploy the API server. 21 | echo "Deploying API server..." 22 | 23 | gcloud run deploy serverpod-api \ 24 | --source=. \ 25 | --region=$REGION \ 26 | --platform=managed \ 27 | --service-account=$SERVICE_ACCOUNT \ 28 | --port=8080 \ 29 | --set-cloudsql-instances=$DATABASE_INSTANCE_CONNECTION_NAME \ 30 | --execution-environment=gen2 \ 31 | --set-env-vars="runmode=$RUNMODE" \ 32 | --set-env-vars="role=serverless" \ 33 | --allow-unauthenticated 34 | 35 | 36 | # Deploy the Insights server. This is used by the Serverpod Insights app. It 37 | # can provide run time information and logs from the API server. 38 | echo "Deploying Insights server..." 39 | 40 | gcloud run deploy serverpod-insights \ 41 | --source=. \ 42 | --region=$REGION \ 43 | --platform=managed \ 44 | --service-account=$SERVICE_ACCOUNT \ 45 | --port=8081 \ 46 | --set-cloudsql-instances=$DATABASE_INSTANCE_CONNECTION_NAME \ 47 | --execution-environment=gen2 \ 48 | --set-env-vars="runmode=$RUNMODE" \ 49 | --set-env-vars="role=serverless" \ 50 | --allow-unauthenticated 51 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/gcp/terraform_gce/config.auto.tfvars: -------------------------------------------------------------------------------- 1 | # This is the main configuration file. You can deploy your Serverpod by only 2 | # doing changes to this file. Serverpod uses a minimal setup by default, but 3 | # you can edit the main.tf file to choose higher tiers for database and your 4 | # managed instances or enable additional services like Redis. 5 | # 6 | # You can find complete setup instructions at: 7 | # https://docs.serverpod.dev/ 8 | 9 | # The Project ID from the Google Cloud Console. 10 | project = "" 11 | 12 | # The service account email address authorized by your Google Cloud Console. 13 | service_account_email = "" 14 | 15 | # The name of your DNS zone. 16 | dns_managed_zone = "" 17 | 18 | # The top domain of your DNS zone. e.g. "examplepod.com" 19 | top_domain = "" 20 | 21 | # The region and zone to use for the deployment. Default values work. 22 | region = "us-central1" 23 | zone = "us-central1-c" 24 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/gcp/terraform_gce/main.tf: -------------------------------------------------------------------------------- 1 | # Set up and configure Terraform and the Google Cloud provider. 2 | terraform { 3 | required_providers { 4 | google = { 5 | source = "hashicorp/google" 6 | version = "4.51.0" 7 | } 8 | } 9 | } 10 | 11 | provider "google" { 12 | credentials = file("credentials.json") 13 | 14 | project = var.project 15 | region = var.region 16 | zone = var.zone 17 | } 18 | 19 | # Add a Serverpod module configured for production. Full documentation on all 20 | # options is available at: 21 | # https://github.com/serverpod/terraform-google-serverpod-cloud-engine 22 | 23 | module "serverpod_production" { 24 | # References the Serverpod module from GitHub. 25 | source = "github.com/serverpod/terraform-google-serverpod-cloud-engine?ref=stable-1.1" 26 | 27 | # Required parameters. 28 | project = var.project 29 | service_account_email = var.service_account_email 30 | 31 | runmode = "production" 32 | 33 | region = var.region 34 | zone = var.zone 35 | 36 | dns_managed_zone = var.dns_managed_zone 37 | top_domain = var.top_domain 38 | 39 | # Size of the auto scaling group. 40 | autoscaling_min_size = 1 41 | autoscaling_max_size = 2 42 | 43 | # Password for the production database. 44 | database_password = var.DATABASE_PASSWORD_PRODUCTION 45 | 46 | # Adds Cloud Storage buckets for file uploads. 47 | enable_storage = true 48 | 49 | # Adds Redis for caching and communication between servers. 50 | enable_redis = false 51 | 52 | # Makes it possible to SSH into the individual server instances. 53 | enable_ssh = true 54 | } 55 | 56 | 57 | # If you want to set up a staging environment, you can add a second module 58 | # configured for staging. Just uncomment the following code and change the 59 | # parameters as needed (default options should work too). 60 | 61 | # module "serverpod_staging" { 62 | # # References the Serverpod module from GitHub. 63 | # source = "github.com/serverpod/terraform-google-serverpod-cloud-engine?ref=stable-1.1" 64 | 65 | # # Required parameters. 66 | # project = var.project 67 | # service_account_email = var.service_account_email 68 | 69 | # runmode = "staging" 70 | 71 | # region = var.region 72 | # zone = var.zone 73 | 74 | # dns_managed_zone = var.dns_managed_zone 75 | # top_domain = var.top_domain 76 | 77 | # # Prefix for the staging, added to all subdomains. 78 | # subdomain_prefix = "staging-" 79 | 80 | # # Size of the auto scaling group. 81 | # autoscaling_min_size = 1 82 | # autoscaling_max_size = 2 83 | 84 | # # Password for the production database. 85 | # database_password = var.DATABASE_PASSWORD_STAGING 86 | 87 | # # Adds Cloud Storage buckets for file uploads. 88 | # enable_storage = true 89 | 90 | # # Adds Redis for caching and communication between servers. 91 | # enable_redis = false 92 | 93 | # # Makes it possible to SSH into the individual server instances. 94 | # enable_ssh = true 95 | # } 96 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/deploy/gcp/terraform_gce/variables.tf: -------------------------------------------------------------------------------- 1 | # Project setup. 2 | 3 | variable "project" { 4 | type = string 5 | } 6 | 7 | variable "service_account_email" { 8 | type = string 9 | } 10 | 11 | variable "dns_managed_zone" { 12 | type = string 13 | } 14 | 15 | variable "top_domain" { 16 | type = string 17 | } 18 | 19 | variable "region" { 20 | type = string 21 | default = "us-central1" 22 | } 23 | 24 | variable "zone" { 25 | type = string 26 | default = "us-central1-c" 27 | } 28 | 29 | # Database 30 | 31 | variable "DATABASE_PASSWORD_PRODUCTION" { 32 | description = "The production database password, you can find it in the config/passwords.yaml file." 33 | type = string 34 | } 35 | 36 | variable "DATABASE_PASSWORD_STAGING" { 37 | 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)." 38 | type = string 39 | } 40 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | postgres: 5 | image: postgres:14.1 6 | ports: 7 | - '8090:5432' 8 | environment: 9 | POSTGRES_USER: postgres 10 | POSTGRES_DB: chat_app_serverpod 11 | POSTGRES_PASSWORD: "hj2il5BMOFiyiNZWRoVdAeukDZz4gfow" 12 | volumes: 13 | - chat_app_serverpod_data:/var/lib/postgresql/data 14 | redis: 15 | image: redis:6.2.6 16 | ports: 17 | - '8091:6379' 18 | command: redis-server --requirepass "5Ic8Cmys70N9sXB94acr219JXMJDTqmm" 19 | environment: 20 | - REDIS_REPLICATION_MODE=master 21 | volumes: 22 | chat_app_serverpod_data: 23 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_server/lib/.DS_Store -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/server.dart: -------------------------------------------------------------------------------- 1 | import 'package:mailer/mailer.dart' as mail; 2 | import 'package:mailer/smtp_server/gmail.dart'; 3 | import 'package:serverpod/serverpod.dart'; 4 | import 'package:serverpod_auth_server/serverpod_auth_server.dart' as auth; 5 | 6 | import 'package:chat_app_serverpod_server/src/web/routes/root.dart'; 7 | 8 | import 'src/generated/protocol.dart'; 9 | import 'src/generated/endpoints.dart'; 10 | 11 | void run(List args) async { 12 | final pod = Serverpod( 13 | args, 14 | Protocol(), 15 | Endpoints(), 16 | authenticationHandler: auth.authenticationHandler, 17 | ); 18 | // Configuration for sign in with email. 19 | auth.AuthConfig.set(auth.AuthConfig( 20 | sendValidationEmail: (session, email, validationCode) async { 21 | // Retrieve the credentials 22 | final gmailEmail = session.serverpod.getPassword('gmailEmail')!; 23 | final gmailPassword = session.serverpod.getPassword('gmailPassword')!; 24 | 25 | // Create a SMTP client for Gmail. 26 | final smtpServer = gmail(gmailEmail, gmailPassword); 27 | 28 | // Create an email message with the validation code. 29 | final message = mail.Message() 30 | ..from = mail.Address(gmailEmail) 31 | ..recipients.add(email) 32 | ..subject = 'Verification code for Serverpod' 33 | ..html = 'Your verification code is: $validationCode'; 34 | 35 | // Send the email message. 36 | try { 37 | await mail.send(message, smtpServer); 38 | } catch (_) { 39 | // Return false if the email could not be sent. 40 | return false; 41 | } 42 | 43 | return true; 44 | }, 45 | sendPasswordResetEmail: (session, userInfo, validationCode) async { 46 | // Retrieve the credentials 47 | final gmailEmail = session.serverpod.getPassword('gmailEmail')!; 48 | final gmailPassword = session.serverpod.getPassword('gmailPassword')!; 49 | 50 | // Create a SMTP client for Gmail. 51 | final smtpServer = gmail(gmailEmail, gmailPassword); 52 | 53 | // Create an email message with the password reset link. 54 | final message = mail.Message() 55 | ..from = mail.Address(gmailEmail) 56 | ..recipients.add(userInfo.email!) 57 | ..subject = 'Password reset link for Serverpod' 58 | ..html = 'Here is your password reset code: $validationCode>'; 59 | 60 | // Send the email message. 61 | try { 62 | await mail.send(message, smtpServer); 63 | } catch (_) { 64 | // Return false if the email could not be sent. 65 | return false; 66 | } 67 | 68 | return true; 69 | }, 70 | )); 71 | pod.webServer.addRoute(RouteRoot(), '/'); 72 | pod.webServer.addRoute(RouteRoot(), '/index.html'); 73 | 74 | pod.webServer.addRoute( 75 | RouteStaticDirectory(serverDirectory: 'static', basePath: '/'), 76 | '/*', 77 | ); 78 | 79 | await pod.start(); 80 | } 81 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_server/lib/src/.DS_Store -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/endpoints/chat_endpoint.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_server/src/generated/message.chat.dart'; 2 | import 'package:serverpod/serverpod.dart'; 3 | 4 | class MessageEndpoint extends Endpoint { 5 | Future sendMessage(Session session, Message msg) async { 6 | session.log('Received message update: ${msg.toString()}'); 7 | return await Message.db.insertRow(session, msg); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/endpoints/example_endpoint.dart: -------------------------------------------------------------------------------- 1 | import 'package:serverpod/serverpod.dart'; 2 | 3 | // This is an example endpoint of your server. It's best practice to use the 4 | // `Endpoint` ending of the class name, but it will be removed when accessing 5 | // the endpoint from the client. I.e., this endpoint can be accessed through 6 | // `client.example` on the client side. 7 | 8 | // After adding or modifying an endpoint, you will need to run 9 | // `serverpod generate` to update the server and client code. 10 | class ExampleEndpoint extends Endpoint { 11 | // You create methods in your endpoint which are accessible from the client by 12 | // creating a public method with `Session` as its first parameter. 13 | // `bool`, `int`, `double`, `String`, `UuidValue`, `Duration`, `DateTime`, `ByteData`, 14 | // and other serializable classes, exceptions and enums from your from your `protocol` directory. 15 | // The methods should return a typed future; the same types as for the parameters are 16 | // supported. The `session` object provides access to the database, logging, 17 | // passwords, and information about the request being made to the server. 18 | Future hello(Session session, String name) async { 19 | return 'Hello $name'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/endpoints/type_endpoint.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_server/src/generated/protocol.dart'; 2 | import 'package:serverpod/serverpod.dart'; 3 | 4 | class TypingIndicatorEndpoint extends Endpoint { 5 | @override 6 | Future streamOpened(StreamingSession session) async { 7 | session.log('Typing Indicator Stream Opened'); 8 | session.messages.addListener( 9 | 'typing_indicator', 10 | (message) { 11 | session.log('New Person typing: ${message.toJson()}'); 12 | sendStreamMessage(session, message); 13 | }, 14 | ); 15 | return super.streamOpened(session); 16 | } 17 | 18 | @override 19 | Future handleStreamMessage( 20 | StreamingSession session, 21 | SerializableModel message, 22 | ) async { 23 | session.log('Received message in stream: ${message.toJson()}'); 24 | if (message is TypingIndicator) { 25 | session.log('Received new typing indications: ${message.toJson()}'); 26 | 27 | session.messages.postMessage('typing_indicator', message); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/endpoints/user_endpoint.dart: -------------------------------------------------------------------------------- 1 | import 'package:serverpod/serverpod.dart'; 2 | import 'package:serverpod_auth_server/module.dart' as auth; 3 | 4 | class UserEndpoint extends Endpoint { 5 | Future> getAllUsers(Session session) async { 6 | // Query the UserInfo table to get all users 7 | var users = await auth.UserInfo.db.find(session); 8 | return users; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/endpoints/usermessage_endpoint.dart: -------------------------------------------------------------------------------- 1 | import 'package:chat_app_serverpod_server/src/generated/protocol.dart'; 2 | import 'package:serverpod/serverpod.dart'; 3 | 4 | class UsermessageEndpoint extends Endpoint { 5 | Future sendNewMessage( 6 | Session session, UserMessage message) async { 7 | return await UserMessage.db.insertRow(session, message); 8 | } 9 | 10 | Future> fetchAllMessages(Session session) async { 11 | return await UserMessage.db.find(session); 12 | } 13 | 14 | @override 15 | Future streamOpened(StreamingSession session) async { 16 | session.log('Chat user common stream opened'); 17 | session.messages.addListener( 18 | 'chat_room_serverpod', 19 | (message) { 20 | session.log('Received message update in stream: ${message.toJson()}'); 21 | sendStreamMessage(session, message); 22 | }, 23 | ); 24 | return super.streamOpened(session); 25 | } 26 | 27 | @override 28 | Future handleStreamMessage( 29 | StreamingSession session, 30 | SerializableModel message, 31 | ) async { 32 | session.log('Received message in stream: ${message.toJson()}'); 33 | if (message is UserMessage) { 34 | session 35 | .log('Received message for posting in stream: ${message.toJson()}'); 36 | 37 | var existingMessages = await UserMessage.db.find( 38 | session, 39 | where: (t) => t.id.equals(message.id), 40 | ); 41 | 42 | if (existingMessages.isNotEmpty) { 43 | UserMessage updated = await UserMessage.db.updateRow(session, message); 44 | session.log('Updated existing message: ${message.toJson()}'); 45 | session.messages.postMessage('chat_room_serverpod', updated); 46 | } else { 47 | session.log('Trying to insert with ID: ${message.id}'); 48 | UserMessage inserted = await UserMessage.db.insertRow(session, message); 49 | session.log('Inserted new message: ${message.toJson()}'); 50 | session.messages.postMessage('chat_room_serverpod', inserted); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/future_calls/example_future_call.dart: -------------------------------------------------------------------------------- 1 | import 'package:serverpod/serverpod.dart'; 2 | 3 | // Future calls are calls that will be invoked at a later time. An example is if 4 | // you want to send a drip-email campaign after a user signs up. You can 5 | // schedule a future call for a day, a week, or a month. The calls are stored in 6 | // the database, so they will persist even if the server is restarted. 7 | // 8 | // To add a future call to your server, you need to register it in the 9 | // `server.dart` file. Schedule the call using the 10 | // `session.serverpod.futureCallWithDelay` or `session.serverpod.futureCallAtTime` 11 | // methods. You can optionally pass a serializable object together with the 12 | // call. 13 | 14 | class ExampleFutureCall extends FutureCall { 15 | @override 16 | Future invoke(Session session, SerializableModel? object) async { 17 | // Do something interesting in the future here. 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/generated/example.dart: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ 2 | /* To generate run: "serverpod generate" */ 3 | 4 | // ignore_for_file: implementation_imports 5 | // ignore_for_file: library_private_types_in_public_api 6 | // ignore_for_file: non_constant_identifier_names 7 | // ignore_for_file: public_member_api_docs 8 | // ignore_for_file: type_literal_in_constant_pattern 9 | // ignore_for_file: use_super_parameters 10 | 11 | // ignore_for_file: no_leading_underscores_for_library_prefixes 12 | import 'package:serverpod/serverpod.dart' as _i1; 13 | 14 | abstract class Example 15 | implements _i1.SerializableModel, _i1.ProtocolSerialization { 16 | Example._({ 17 | required this.name, 18 | required this.data, 19 | }); 20 | 21 | factory Example({ 22 | required String name, 23 | required int data, 24 | }) = _ExampleImpl; 25 | 26 | factory Example.fromJson(Map jsonSerialization) { 27 | return Example( 28 | name: jsonSerialization['name'] as String, 29 | data: jsonSerialization['data'] as int, 30 | ); 31 | } 32 | 33 | String name; 34 | 35 | int data; 36 | 37 | /// Returns a shallow copy of this [Example] 38 | /// with some or all fields replaced by the given arguments. 39 | @_i1.useResult 40 | Example copyWith({ 41 | String? name, 42 | int? data, 43 | }); 44 | @override 45 | Map toJson() { 46 | return { 47 | 'name': name, 48 | 'data': data, 49 | }; 50 | } 51 | 52 | @override 53 | Map toJsonForProtocol() { 54 | return { 55 | 'name': name, 56 | 'data': data, 57 | }; 58 | } 59 | 60 | @override 61 | String toString() { 62 | return _i1.SerializationManager.encode(this); 63 | } 64 | } 65 | 66 | class _ExampleImpl extends Example { 67 | _ExampleImpl({ 68 | required String name, 69 | required int data, 70 | }) : super._( 71 | name: name, 72 | data: data, 73 | ); 74 | 75 | /// Returns a shallow copy of this [Example] 76 | /// with some or all fields replaced by the given arguments. 77 | @_i1.useResult 78 | @override 79 | Example copyWith({ 80 | String? name, 81 | int? data, 82 | }) { 83 | return Example( 84 | name: name ?? this.name, 85 | data: data ?? this.data, 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/generated/protocol.yaml: -------------------------------------------------------------------------------- 1 | message: 2 | - sendMessage: 3 | example: 4 | - hello: 5 | typingIndicator: 6 | user: 7 | - getAllUsers: 8 | usermessage: 9 | - sendNewMessage: 10 | - fetchAllMessages: 11 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/generated/typing.chat.dart: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ 2 | /* To generate run: "serverpod generate" */ 3 | 4 | // ignore_for_file: implementation_imports 5 | // ignore_for_file: library_private_types_in_public_api 6 | // ignore_for_file: non_constant_identifier_names 7 | // ignore_for_file: public_member_api_docs 8 | // ignore_for_file: type_literal_in_constant_pattern 9 | // ignore_for_file: use_super_parameters 10 | 11 | // ignore_for_file: no_leading_underscores_for_library_prefixes 12 | import 'package:serverpod/serverpod.dart' as _i1; 13 | 14 | abstract class TypingIndicator 15 | implements _i1.SerializableModel, _i1.ProtocolSerialization { 16 | TypingIndicator._({ 17 | required this.typerID, 18 | required this.status, 19 | }); 20 | 21 | factory TypingIndicator({ 22 | required int typerID, 23 | required bool status, 24 | }) = _TypingIndicatorImpl; 25 | 26 | factory TypingIndicator.fromJson(Map jsonSerialization) { 27 | return TypingIndicator( 28 | typerID: jsonSerialization['typerID'] as int, 29 | status: jsonSerialization['status'] as bool, 30 | ); 31 | } 32 | 33 | int typerID; 34 | 35 | bool status; 36 | 37 | /// Returns a shallow copy of this [TypingIndicator] 38 | /// with some or all fields replaced by the given arguments. 39 | @_i1.useResult 40 | TypingIndicator copyWith({ 41 | int? typerID, 42 | bool? status, 43 | }); 44 | @override 45 | Map toJson() { 46 | return { 47 | 'typerID': typerID, 48 | 'status': status, 49 | }; 50 | } 51 | 52 | @override 53 | Map toJsonForProtocol() { 54 | return { 55 | 'typerID': typerID, 56 | 'status': status, 57 | }; 58 | } 59 | 60 | @override 61 | String toString() { 62 | return _i1.SerializationManager.encode(this); 63 | } 64 | } 65 | 66 | class _TypingIndicatorImpl extends TypingIndicator { 67 | _TypingIndicatorImpl({ 68 | required int typerID, 69 | required bool status, 70 | }) : super._( 71 | typerID: typerID, 72 | status: status, 73 | ); 74 | 75 | /// Returns a shallow copy of this [TypingIndicator] 76 | /// with some or all fields replaced by the given arguments. 77 | @_i1.useResult 78 | @override 79 | TypingIndicator copyWith({ 80 | int? typerID, 81 | bool? status, 82 | }) { 83 | return TypingIndicator( 84 | typerID: typerID ?? this.typerID, 85 | status: status ?? this.status, 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/models/chat.yaml: -------------------------------------------------------------------------------- 1 | class: Chat 2 | table: chat 3 | fields: 4 | text: String 5 | sender: String 6 | sent: DateTime? 7 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/models/example.spy.yaml: -------------------------------------------------------------------------------- 1 | # Yaml-files in the `protocol` directory specify which serializable objects 2 | # should be generated. When you add or modify a file, you will need to run 3 | # `serverpod generate` to make the generated classes available in the server and 4 | # client. 5 | # 6 | # Please consult the documentation for more information on what you can add to 7 | # your yaml-files. 8 | 9 | 10 | # Name of the class to generate. 11 | class: Example 12 | 13 | # Add the table key, if this class represents a row in the database. 14 | #table: example 15 | 16 | # The fields (and columns if connected to the database) of the class. Supported types are 17 | # `bool`, `int`, `double`, `String`, `UuidValue`, `Duration`, `DateTime`, `ByteData`, 18 | # and other serializable classes, exceptions and enums. 19 | # You can also add lists of objects and types have support for null safety. 20 | # Eg. `List?` or `List`. 21 | fields: 22 | name: String 23 | data: int -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/models/message.chat.yaml: -------------------------------------------------------------------------------- 1 | class: Message 2 | table: messages 3 | fields: 4 | text: String 5 | sender: String 6 | receiver: String 7 | sent: DateTime? 8 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/models/typing.chat.yaml: -------------------------------------------------------------------------------- 1 | class: TypingIndicator 2 | fields: 3 | typerID: int 4 | status: bool -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/models/usermessage.chat.yaml: -------------------------------------------------------------------------------- 1 | class: UserMessage 2 | table: usermessage 3 | fields: 4 | message: String 5 | sender: String 6 | sent: DateTime? 7 | status: String 8 | reactions: List? 9 | reactionsUsers: List? 10 | replyMessages: Map? 11 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/web/routes/root.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:chat_app_serverpod_server/src/web/widgets/default_page_widget.dart'; 4 | import 'package:serverpod/serverpod.dart'; 5 | 6 | class RouteRoot extends WidgetRoute { 7 | @override 8 | Future build(Session session, HttpRequest request) async { 9 | return DefaultPageWidget(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/lib/src/web/widgets/default_page_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:serverpod/serverpod.dart'; 2 | 3 | class DefaultPageWidget extends Widget { 4 | DefaultPageWidget() : super(name: 'default') { 5 | values = { 6 | 'served': DateTime.now(), 7 | 'runmode': Serverpod.instance.runMode, 8 | }; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_server/migrations/.DS_Store -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240619170842342/definition_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleName": "chat_app_serverpod", 3 | "tables": [], 4 | "installedModules": [ 5 | { 6 | "module": "serverpod", 7 | "version": "20240516151843329" 8 | } 9 | ], 10 | "migrationApiVersion": 1 11 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240619173629236/definition_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleName": "chat_app_serverpod", 3 | "tables": [ 4 | { 5 | "name": "chat", 6 | "dartName": "Chat", 7 | "module": "chat_app_serverpod", 8 | "schema": "public", 9 | "columns": [ 10 | { 11 | "name": "id", 12 | "columnType": 6, 13 | "isNullable": false, 14 | "columnDefault": "nextval('chat_id_seq'::regclass)", 15 | "dartType": "int?" 16 | }, 17 | { 18 | "name": "text", 19 | "columnType": 0, 20 | "isNullable": false, 21 | "dartType": "String" 22 | }, 23 | { 24 | "name": "sender", 25 | "columnType": 0, 26 | "isNullable": false, 27 | "dartType": "String" 28 | }, 29 | { 30 | "name": "sent", 31 | "columnType": 4, 32 | "isNullable": true, 33 | "dartType": "DateTime?" 34 | } 35 | ], 36 | "foreignKeys": [], 37 | "indexes": [ 38 | { 39 | "indexName": "chat_pkey", 40 | "elements": [ 41 | { 42 | "type": 0, 43 | "definition": "id" 44 | } 45 | ], 46 | "type": "btree", 47 | "isUnique": true, 48 | "isPrimary": true 49 | } 50 | ], 51 | "managed": true 52 | }, 53 | { 54 | "name": "messages", 55 | "dartName": "Message", 56 | "module": "chat_app_serverpod", 57 | "schema": "public", 58 | "columns": [ 59 | { 60 | "name": "id", 61 | "columnType": 6, 62 | "isNullable": false, 63 | "columnDefault": "nextval('messages_id_seq'::regclass)", 64 | "dartType": "int?" 65 | }, 66 | { 67 | "name": "text", 68 | "columnType": 0, 69 | "isNullable": false, 70 | "dartType": "String" 71 | }, 72 | { 73 | "name": "sender", 74 | "columnType": 0, 75 | "isNullable": false, 76 | "dartType": "String" 77 | }, 78 | { 79 | "name": "sent", 80 | "columnType": 4, 81 | "isNullable": true, 82 | "dartType": "DateTime?" 83 | } 84 | ], 85 | "foreignKeys": [], 86 | "indexes": [ 87 | { 88 | "indexName": "messages_pkey", 89 | "elements": [ 90 | { 91 | "type": 0, 92 | "definition": "id" 93 | } 94 | ], 95 | "type": "btree", 96 | "isUnique": true, 97 | "isPrimary": true 98 | } 99 | ], 100 | "managed": true 101 | } 102 | ], 103 | "installedModules": [ 104 | { 105 | "module": "serverpod", 106 | "version": "20240516151843329" 107 | }, 108 | { 109 | "module": "chat_app_serverpod", 110 | "version": "20240619170842342" 111 | } 112 | ], 113 | "migrationApiVersion": 1 114 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240619173629236/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [ 3 | { 4 | "type": "createTable", 5 | "createTable": { 6 | "name": "chat", 7 | "dartName": "Chat", 8 | "module": "chat_app_serverpod", 9 | "schema": "public", 10 | "columns": [ 11 | { 12 | "name": "id", 13 | "columnType": 6, 14 | "isNullable": false, 15 | "columnDefault": "nextval('chat_id_seq'::regclass)", 16 | "dartType": "int?" 17 | }, 18 | { 19 | "name": "text", 20 | "columnType": 0, 21 | "isNullable": false, 22 | "dartType": "String" 23 | }, 24 | { 25 | "name": "sender", 26 | "columnType": 0, 27 | "isNullable": false, 28 | "dartType": "String" 29 | }, 30 | { 31 | "name": "sent", 32 | "columnType": 4, 33 | "isNullable": true, 34 | "dartType": "DateTime?" 35 | } 36 | ], 37 | "foreignKeys": [], 38 | "indexes": [ 39 | { 40 | "indexName": "chat_pkey", 41 | "elements": [ 42 | { 43 | "type": 0, 44 | "definition": "id" 45 | } 46 | ], 47 | "type": "btree", 48 | "isUnique": true, 49 | "isPrimary": true 50 | } 51 | ], 52 | "managed": true 53 | } 54 | }, 55 | { 56 | "type": "createTable", 57 | "createTable": { 58 | "name": "messages", 59 | "dartName": "Message", 60 | "module": "chat_app_serverpod", 61 | "schema": "public", 62 | "columns": [ 63 | { 64 | "name": "id", 65 | "columnType": 6, 66 | "isNullable": false, 67 | "columnDefault": "nextval('messages_id_seq'::regclass)", 68 | "dartType": "int?" 69 | }, 70 | { 71 | "name": "text", 72 | "columnType": 0, 73 | "isNullable": false, 74 | "dartType": "String" 75 | }, 76 | { 77 | "name": "sender", 78 | "columnType": 0, 79 | "isNullable": false, 80 | "dartType": "String" 81 | }, 82 | { 83 | "name": "sent", 84 | "columnType": 4, 85 | "isNullable": true, 86 | "dartType": "DateTime?" 87 | } 88 | ], 89 | "foreignKeys": [], 90 | "indexes": [ 91 | { 92 | "indexName": "messages_pkey", 93 | "elements": [ 94 | { 95 | "type": 0, 96 | "definition": "id" 97 | } 98 | ], 99 | "type": "btree", 100 | "isUnique": true, 101 | "isPrimary": true 102 | } 103 | ], 104 | "managed": true 105 | } 106 | } 107 | ], 108 | "warnings": [], 109 | "migrationApiVersion": 1 110 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240619173629236/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | -- 4 | -- ACTION CREATE TABLE 5 | -- 6 | CREATE TABLE "chat" ( 7 | "id" bigserial PRIMARY KEY, 8 | "text" text NOT NULL, 9 | "sender" text NOT NULL, 10 | "sent" timestamp without time zone 11 | ); 12 | 13 | -- 14 | -- ACTION CREATE TABLE 15 | -- 16 | CREATE TABLE "messages" ( 17 | "id" bigserial PRIMARY KEY, 18 | "text" text NOT NULL, 19 | "sender" text NOT NULL, 20 | "sent" timestamp without time zone 21 | ); 22 | 23 | 24 | -- 25 | -- MIGRATION VERSION FOR chat_app_serverpod 26 | -- 27 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 28 | VALUES ('chat_app_serverpod', '20240619173629236', now()) 29 | ON CONFLICT ("module") 30 | DO UPDATE SET "version" = '20240619173629236', "timestamp" = now(); 31 | 32 | -- 33 | -- MIGRATION VERSION FOR serverpod 34 | -- 35 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 36 | VALUES ('serverpod', '20240516151843329', now()) 37 | ON CONFLICT ("module") 38 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 39 | 40 | 41 | COMMIT; 42 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620053531204/definition_project.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleName": "chat_app_serverpod", 3 | "tables": [ 4 | { 5 | "name": "chat", 6 | "dartName": "Chat", 7 | "module": "chat_app_serverpod", 8 | "schema": "public", 9 | "columns": [ 10 | { 11 | "name": "id", 12 | "columnType": 6, 13 | "isNullable": false, 14 | "columnDefault": "nextval('chat_id_seq'::regclass)", 15 | "dartType": "int?" 16 | }, 17 | { 18 | "name": "text", 19 | "columnType": 0, 20 | "isNullable": false, 21 | "dartType": "String" 22 | }, 23 | { 24 | "name": "sender", 25 | "columnType": 0, 26 | "isNullable": false, 27 | "dartType": "String" 28 | }, 29 | { 30 | "name": "sent", 31 | "columnType": 4, 32 | "isNullable": true, 33 | "dartType": "DateTime?" 34 | } 35 | ], 36 | "foreignKeys": [], 37 | "indexes": [ 38 | { 39 | "indexName": "chat_pkey", 40 | "elements": [ 41 | { 42 | "type": 0, 43 | "definition": "id" 44 | } 45 | ], 46 | "type": "btree", 47 | "isUnique": true, 48 | "isPrimary": true 49 | } 50 | ], 51 | "managed": true 52 | }, 53 | { 54 | "name": "messages", 55 | "dartName": "Message", 56 | "module": "chat_app_serverpod", 57 | "schema": "public", 58 | "columns": [ 59 | { 60 | "name": "id", 61 | "columnType": 6, 62 | "isNullable": false, 63 | "columnDefault": "nextval('messages_id_seq'::regclass)", 64 | "dartType": "int?" 65 | }, 66 | { 67 | "name": "text", 68 | "columnType": 0, 69 | "isNullable": false, 70 | "dartType": "String" 71 | }, 72 | { 73 | "name": "sender", 74 | "columnType": 0, 75 | "isNullable": false, 76 | "dartType": "String" 77 | }, 78 | { 79 | "name": "sent", 80 | "columnType": 4, 81 | "isNullable": true, 82 | "dartType": "DateTime?" 83 | } 84 | ], 85 | "foreignKeys": [], 86 | "indexes": [ 87 | { 88 | "indexName": "messages_pkey", 89 | "elements": [ 90 | { 91 | "type": 0, 92 | "definition": "id" 93 | } 94 | ], 95 | "type": "btree", 96 | "isUnique": true, 97 | "isPrimary": true 98 | } 99 | ], 100 | "managed": true 101 | } 102 | ], 103 | "installedModules": [ 104 | { 105 | "module": "serverpod", 106 | "version": "20240516151843329" 107 | }, 108 | { 109 | "module": "serverpod_auth", 110 | "version": "20240520102713718" 111 | }, 112 | { 113 | "module": "chat_app_serverpod", 114 | "version": "20240619173629236" 115 | } 116 | ], 117 | "migrationApiVersion": 1 118 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620192018041/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | -- 4 | -- ACTION DROP TABLE 5 | -- 6 | DROP TABLE "messages" CASCADE; 7 | 8 | -- 9 | -- ACTION CREATE TABLE 10 | -- 11 | CREATE TABLE "messages" ( 12 | "id" bigserial PRIMARY KEY, 13 | "text" text NOT NULL, 14 | "sender" text NOT NULL, 15 | "receiver" text NOT NULL, 16 | "sent" timestamp without time zone 17 | ); 18 | 19 | -- 20 | -- ACTION CREATE TABLE 21 | -- 22 | CREATE TABLE "usermessage" ( 23 | "id" bigserial PRIMARY KEY, 24 | "message" text NOT NULL, 25 | "sender" text NOT NULL, 26 | "sent" timestamp without time zone, 27 | "status" text NOT NULL, 28 | "reactions" json, 29 | "reactionsUsers" json, 30 | "replyMessages" json NOT NULL 31 | ); 32 | 33 | 34 | -- 35 | -- MIGRATION VERSION FOR chat_app_serverpod 36 | -- 37 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 38 | VALUES ('chat_app_serverpod', '20240620192018041', now()) 39 | ON CONFLICT ("module") 40 | DO UPDATE SET "version" = '20240620192018041', "timestamp" = now(); 41 | 42 | -- 43 | -- MIGRATION VERSION FOR serverpod 44 | -- 45 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 46 | VALUES ('serverpod', '20240516151843329', now()) 47 | ON CONFLICT ("module") 48 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 49 | 50 | -- 51 | -- MIGRATION VERSION FOR serverpod_auth 52 | -- 53 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 54 | VALUES ('serverpod_auth', '20240520102713718', now()) 55 | ON CONFLICT ("module") 56 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 57 | 58 | 59 | COMMIT; 60 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620194328033/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [ 3 | { 4 | "type": "alterTable", 5 | "alterTable": { 6 | "name": "usermessage", 7 | "schema": "public", 8 | "addColumns": [], 9 | "deleteColumns": [], 10 | "modifyColumns": [ 11 | { 12 | "columnName": "replyMessages", 13 | "addNullable": true, 14 | "removeNullable": false, 15 | "changeDefault": false 16 | } 17 | ], 18 | "addIndexes": [], 19 | "deleteIndexes": [], 20 | "addForeignKeys": [], 21 | "deleteForeignKeys": [], 22 | "warnings": [] 23 | } 24 | } 25 | ], 26 | "warnings": [], 27 | "migrationApiVersion": 1 28 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620194328033/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | -- 4 | -- ACTION ALTER TABLE 5 | -- 6 | ALTER TABLE "usermessage" ALTER COLUMN "replyMessages" DROP NOT NULL; 7 | 8 | -- 9 | -- MIGRATION VERSION FOR chat_app_serverpod 10 | -- 11 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 12 | VALUES ('chat_app_serverpod', '20240620194328033', now()) 13 | ON CONFLICT ("module") 14 | DO UPDATE SET "version" = '20240620194328033', "timestamp" = now(); 15 | 16 | -- 17 | -- MIGRATION VERSION FOR serverpod 18 | -- 19 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 20 | VALUES ('serverpod', '20240516151843329', now()) 21 | ON CONFLICT ("module") 22 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 23 | 24 | -- 25 | -- MIGRATION VERSION FOR serverpod_auth 26 | -- 27 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 28 | VALUES ('serverpod_auth', '20240520102713718', now()) 29 | ON CONFLICT ("module") 30 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 31 | 32 | 33 | COMMIT; 34 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620200953666/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "warnings": [], 4 | "migrationApiVersion": 1 5 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620200953666/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | 4 | -- 5 | -- MIGRATION VERSION FOR chat_app_serverpod 6 | -- 7 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 8 | VALUES ('chat_app_serverpod', '20240620200953666', now()) 9 | ON CONFLICT ("module") 10 | DO UPDATE SET "version" = '20240620200953666', "timestamp" = now(); 11 | 12 | -- 13 | -- MIGRATION VERSION FOR serverpod 14 | -- 15 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 16 | VALUES ('serverpod', '20240516151843329', now()) 17 | ON CONFLICT ("module") 18 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 19 | 20 | -- 21 | -- MIGRATION VERSION FOR serverpod_auth 22 | -- 23 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 24 | VALUES ('serverpod_auth', '20240520102713718', now()) 25 | ON CONFLICT ("module") 26 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 27 | 28 | 29 | COMMIT; 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620201147929/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "warnings": [], 4 | "migrationApiVersion": 1 5 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620201147929/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | 4 | -- 5 | -- MIGRATION VERSION FOR chat_app_serverpod 6 | -- 7 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 8 | VALUES ('chat_app_serverpod', '20240620201147929', now()) 9 | ON CONFLICT ("module") 10 | DO UPDATE SET "version" = '20240620201147929', "timestamp" = now(); 11 | 12 | -- 13 | -- MIGRATION VERSION FOR serverpod 14 | -- 15 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 16 | VALUES ('serverpod', '20240516151843329', now()) 17 | ON CONFLICT ("module") 18 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 19 | 20 | -- 21 | -- MIGRATION VERSION FOR serverpod_auth 22 | -- 23 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 24 | VALUES ('serverpod_auth', '20240520102713718', now()) 25 | ON CONFLICT ("module") 26 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 27 | 28 | 29 | COMMIT; 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620205227936/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "warnings": [], 4 | "migrationApiVersion": 1 5 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240620205227936/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | 4 | -- 5 | -- MIGRATION VERSION FOR chat_app_serverpod 6 | -- 7 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 8 | VALUES ('chat_app_serverpod', '20240620205227936', now()) 9 | ON CONFLICT ("module") 10 | DO UPDATE SET "version" = '20240620205227936', "timestamp" = now(); 11 | 12 | -- 13 | -- MIGRATION VERSION FOR serverpod 14 | -- 15 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 16 | VALUES ('serverpod', '20240516151843329', now()) 17 | ON CONFLICT ("module") 18 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 19 | 20 | -- 21 | -- MIGRATION VERSION FOR serverpod_auth 22 | -- 23 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 24 | VALUES ('serverpod_auth', '20240520102713718', now()) 25 | ON CONFLICT ("module") 26 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 27 | 28 | 29 | COMMIT; 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240621045412320/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "warnings": [], 4 | "migrationApiVersion": 1 5 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240621045412320/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | 4 | -- 5 | -- MIGRATION VERSION FOR chat_app_serverpod 6 | -- 7 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 8 | VALUES ('chat_app_serverpod', '20240621045412320', now()) 9 | ON CONFLICT ("module") 10 | DO UPDATE SET "version" = '20240621045412320', "timestamp" = now(); 11 | 12 | -- 13 | -- MIGRATION VERSION FOR serverpod 14 | -- 15 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 16 | VALUES ('serverpod', '20240516151843329', now()) 17 | ON CONFLICT ("module") 18 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 19 | 20 | -- 21 | -- MIGRATION VERSION FOR serverpod_auth 22 | -- 23 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 24 | VALUES ('serverpod_auth', '20240520102713718', now()) 25 | ON CONFLICT ("module") 26 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 27 | 28 | 29 | COMMIT; 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240621071106181/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "warnings": [], 4 | "migrationApiVersion": 1 5 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240621071106181/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | 4 | -- 5 | -- MIGRATION VERSION FOR chat_app_serverpod 6 | -- 7 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 8 | VALUES ('chat_app_serverpod', '20240621071106181', now()) 9 | ON CONFLICT ("module") 10 | DO UPDATE SET "version" = '20240621071106181', "timestamp" = now(); 11 | 12 | -- 13 | -- MIGRATION VERSION FOR serverpod 14 | -- 15 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 16 | VALUES ('serverpod', '20240516151843329', now()) 17 | ON CONFLICT ("module") 18 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 19 | 20 | -- 21 | -- MIGRATION VERSION FOR serverpod_auth 22 | -- 23 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 24 | VALUES ('serverpod_auth', '20240520102713718', now()) 25 | ON CONFLICT ("module") 26 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 27 | 28 | 29 | COMMIT; 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240621071616007/migration.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "warnings": [], 4 | "migrationApiVersion": 1 5 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/20240621071616007/migration.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | 3 | 4 | -- 5 | -- MIGRATION VERSION FOR chat_app_serverpod 6 | -- 7 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 8 | VALUES ('chat_app_serverpod', '20240621071616007', now()) 9 | ON CONFLICT ("module") 10 | DO UPDATE SET "version" = '20240621071616007', "timestamp" = now(); 11 | 12 | -- 13 | -- MIGRATION VERSION FOR serverpod 14 | -- 15 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 16 | VALUES ('serverpod', '20240516151843329', now()) 17 | ON CONFLICT ("module") 18 | DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 19 | 20 | -- 21 | -- MIGRATION VERSION FOR serverpod_auth 22 | -- 23 | INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") 24 | VALUES ('serverpod_auth', '20240520102713718', now()) 25 | ON CONFLICT ("module") 26 | DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); 27 | 28 | 29 | COMMIT; 30 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/migrations/migration_registry.txt: -------------------------------------------------------------------------------- 1 | ### AUTOMATICALLY GENERATED DO NOT MODIFY 2 | ### 3 | ### This file is generated by Serverpod when creating a migration, do not modify it 4 | ### manually. If a collision is detected in this file when doing a code merge, resolve 5 | ### the conflict by removing and recreating the conflicting migration. 6 | 7 | 20240619170842342 8 | 20240619173629236 9 | 20240620053531204 10 | 20240620192018041 11 | 20240620194328033 12 | 20240620200953666 13 | 20240620201147929 14 | 20240620205227936 15 | 20240621045412320 16 | 20240621071106181 17 | 20240621071616007 18 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: chat_app_serverpod_server 2 | description: Starting point for a Serverpod server. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=3.2.0 <4.0.0' 8 | 9 | dependencies: 10 | mailer: ^6.1.0 11 | serverpod: 2.8.0 12 | serverpod_auth_server: 2.8.0 13 | 14 | dev_dependencies: 15 | lints: ^5.1.1 16 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanvir-robin/Chat-app-serverpod/bc4de553510bfc01e45644e8e83f42be018b497f/chat_app_serverpod_server/web/.DS_Store -------------------------------------------------------------------------------- /chat_app_serverpod_server/web/static/css/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | box-sizing: border-box; 3 | font-size: 14px; 4 | font-family: Arial, Helvetica, sans-serif; 5 | background: url('/images/background.svg') no-repeat center center fixed; 6 | -webkit-background-size: cover; 7 | -moz-background-size: cover; 8 | -o-background-size: cover; 9 | background-size: cover; 10 | } 11 | 12 | *, *:before, *:after { 13 | box-sizing: inherit; 14 | } 15 | 16 | body, h1, h2, h3, h4, h5, h6, p, ol, ul { 17 | margin: 0; 18 | padding: 0; 19 | font-weight: normal; 20 | } 21 | 22 | ol, ul { 23 | list-style: none; 24 | } 25 | 26 | img { 27 | max-width: 100%; 28 | height: auto; 29 | } 30 | 31 | body { 32 | padding: 16px; 33 | } 34 | 35 | hr { 36 | margin-top: 16px; margin-bottom: 16px; 37 | border: 0; 38 | height: 1px; 39 | background: #999; 40 | } 41 | 42 | .content { 43 | min-width: 300px; 44 | position: absolute; 45 | left: 50%; 46 | top: 50%; 47 | -webkit-transform: translate(-50%, -50%); 48 | transform: translate(-50%, -50%); 49 | background-color: white; 50 | border-radius: 8px; 51 | padding: 16px; 52 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 53 | } 54 | 55 | .logo-box a { 56 | text-decoration: none; 57 | font-weight: bold; 58 | color: #666; 59 | } 60 | 61 | .logo-box { 62 | text-align: center; 63 | } 64 | 65 | .info-box p { 66 | margin-top: 2px; 67 | } 68 | 69 | .link-box { 70 | text-align: center; 71 | color: #999; 72 | } 73 | 74 | .link-box a { 75 | text-decoration: none; 76 | } -------------------------------------------------------------------------------- /chat_app_serverpod_server/web/static/images/background.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /chat_app_serverpod_server/web/templates/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Built with Serverpod 6 | 7 | 8 | 9 |
10 | 14 |
15 |
16 |

Served at: {{served}}

17 |

Run mode: {{runmode}}

18 |
19 |
20 | 27 |
28 | 29 | --------------------------------------------------------------------------------