diff --git a/.cdk/config.ts b/.cdk/config.ts
index 1d759726dd..10b662c4da 100644
--- a/.cdk/config.ts
+++ b/.cdk/config.ts
@@ -41,11 +41,6 @@ export const apps: { [key: string]: { stg?: Options; prd?: Options } } = {
sslCert: sunnyCert
}
},
- scoutgameadmin: {
- prd: {
- sslCert: scoutgameCert
- }
- },
scoutgame: {
prd: {
sslCert: scoutgameCert
diff --git a/.ebextensions/scoutgameadmin/00_env_vars.config b/.ebextensions/scoutgameadmin/00_env_vars.config
deleted file mode 100644
index c19a70f988..0000000000
--- a/.ebextensions/scoutgameadmin/00_env_vars.config
+++ /dev/null
@@ -1,14 +0,0 @@
-# Do not put any env var or secrets used by the app here. Put in .ebstalk.apps.env/scoutgame.env
-# This file should only have
-# - env variables referenced in docker-compose file
-# - variables needed for the .platform/hooks/predeploy/01_pull_secrets.sh script to run
-
-option_settings:
- aws:elasticbeanstalk:application:environment:
- COMPOSE_PROJECT_NAME: "prd"
- COMPOSE_PROFILES: "prd-scoutgameadmin"
- EBSTALK_ENV_FILE: "scoutgameadmin.env"
- SERVICE_ENV: "prd" # this sets the value of datadog env tag
- SERVICE_NAME: "scoutgameadmin"
- IMGNAME: "scoutgameadmin"
- IMGTAG: ""
diff --git a/.ebextensions/scoutgameadmin/01_filesystem.config b/.ebextensions/scoutgameadmin/01_filesystem.config
deleted file mode 100644
index 4949bef643..0000000000
--- a/.ebextensions/scoutgameadmin/01_filesystem.config
+++ /dev/null
@@ -1,4 +0,0 @@
-option_settings:
- aws:autoscaling:launchconfiguration:
- RootVolumeType: gp2
- RootVolumeSize: "24"
diff --git a/.ebextensions/scoutgameadmin/02_autoscaling.config b/.ebextensions/scoutgameadmin/02_autoscaling.config
deleted file mode 100644
index 426d0643f5..0000000000
--- a/.ebextensions/scoutgameadmin/02_autoscaling.config
+++ /dev/null
@@ -1,7 +0,0 @@
-# this configures Beanstalk to restart the app if the app's health check fails
-Resources:
- AWSEBAutoScalingGroup:
- Type: "AWS::AutoScaling::AutoScalingGroup"
- Properties:
- HealthCheckType: ELB
- HealthCheckGracePeriod: 300
\ No newline at end of file
diff --git a/.ebextensions/scoutgameadmin/03_env_health_ignore_400.config b/.ebextensions/scoutgameadmin/03_env_health_ignore_400.config
deleted file mode 100644
index 3bca1866a8..0000000000
--- a/.ebextensions/scoutgameadmin/03_env_health_ignore_400.config
+++ /dev/null
@@ -1,13 +0,0 @@
-option_settings:
- aws:elasticbeanstalk:healthreporting:system:
- SystemType: enhanced
- ConfigDocument:
- Rules:
- Environment:
- Application:
- ApplicationRequests4xx:
- Enabled: false
- ELB:
- ELBRequests4xx:
- Enabled: false
- Version: 1
\ No newline at end of file
diff --git a/.ebextensions/scoutgameadmin/06_cloudwatch_alarm.config b/.ebextensions/scoutgameadmin/06_cloudwatch_alarm.config
deleted file mode 100644
index a8a41b011f..0000000000
--- a/.ebextensions/scoutgameadmin/06_cloudwatch_alarm.config
+++ /dev/null
@@ -1,21 +0,0 @@
-# Adding alarm for degraded state
-Resources:
- EnvHealthAlarm:
- Type: "AWS::CloudWatch::Alarm"
- Properties:
- AlarmDescription: "A CloudWatch Alarm that triggers when an Elastic Beanstalk Environment is unhealthy."
- Namespace: "AWS/ElasticBeanstalk"
- MetricName: "EnvironmentHealth"
- Dimensions:
- - Name: EnvironmentName
- Value: { "Ref" : "AWSEBEnvironmentName" }
- Statistic: "Average"
- Period: "300"
- EvaluationPeriods: "2"
- Threshold: "19" # a value between 15 and 20. 15 is warning, 20 is degraded
- ComparisonOperator: "GreaterThanOrEqualToThreshold"
- AlarmActions:
- - "arn:aws:sns:us-east-1:310849459438:Production-Alerts"
- OKActions:
- - "arn:aws:sns:us-east-1:310849459438:Production-Alerts"
- TreatMissingData: "notBreaching"
\ No newline at end of file
diff --git a/.ebextensions/scoutgameadmin/07_http-to-https.config b/.ebextensions/scoutgameadmin/07_http-to-https.config
deleted file mode 100644
index 97a78c9c3d..0000000000
--- a/.ebextensions/scoutgameadmin/07_http-to-https.config
+++ /dev/null
@@ -1,42 +0,0 @@
-# source: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-httpredirect.html
-
-###################################################################################################
-#### Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-####
-#### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
-#### except in compliance with the License. A copy of the License is located at
-####
-#### http://aws.amazon.com/apache2.0/
-####
-#### or in the "license" file accompanying this file. This file is distributed on an "AS IS"
-#### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#### License for the specific language governing permissions and limitations under the License.
-###################################################################################################
-
-###################################################################################################
-#### This configuration file modifies the default port 80 listener attached to an Application Load Balancer
-#### to automatically redirect incoming connections on HTTP to HTTPS.
-#### This will not work with an environment using the load balancer type Classic or Network.
-#### A prerequisite is that the 443 listener has already been created.
-#### Please use the below link for more information about creating an Application Load Balancer on
-#### the Elastic Beanstalk console.
-#### https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb.html#environments-cfg-alb-console
-###################################################################################################
-
-Resources:
- AWSEBV2LoadBalancerListener:
- Type: AWS::ElasticLoadBalancingV2::Listener
- Properties:
- LoadBalancerArn:
- Ref: AWSEBV2LoadBalancer
- Port: 80
- Protocol: HTTP
- DefaultActions:
- - Type: redirect
- RedirectConfig:
- Host: "#{host}"
- Path: "/#{path}"
- Port: "443"
- Protocol: "HTTPS"
- Query: "#{query}"
- StatusCode: "HTTP_301"
\ No newline at end of file
diff --git a/.ebstalk.apps.env/scoutgameadmin.env b/.ebstalk.apps.env/scoutgameadmin.env
deleted file mode 100644
index 8bbb4c828b..0000000000
--- a/.ebstalk.apps.env/scoutgameadmin.env
+++ /dev/null
@@ -1,34 +0,0 @@
-DOMAIN="https://admin.scoutgame.xyz"
-REACT_APP_APP_ENV="production"
-NODE_ENV="production"
-DATABASE_URL="{{pull:secretsmanager:/io.cv.app/prd/db:SecretString:database_url}}"
-AUTH_COOKIE="scoutadmin-session"
-AUTH_SECRET="{{pull:secretsmanager:/io.cv.app/prd/auth_secret:SecretString:auth_secret}}"
-# apis
-GITHUB_ACCESS_TOKEN="{{pull:secretsmanager:/io.cv.app/prd/github:SecretString:scoutgame_github_access_token}}"
-NEYNAR_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/neynar:SecretString:neynar_api_key}}"
-REACT_APP_DECENT_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/decent:SecretString:decent_api_key}}"
-ALCHEMY_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/alchemy:SecretString:alchemy_api_key}}"
-AIRSTACK_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/farcaster:SecretString:airstack_api_key}}"
-TALENT_PROTOCOL_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/talent:SecretString:api_key}}"
-WARPCAST_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/farcaster:SecretString:warpcast_api_key_chris}}"
-
-REACT_APP_BUILDER_NFT_CONTRACT_ADDRESS="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:builder_smart_contract_address}}"
-
-BUILDER_SMART_CONTRACT_MINTER_PRIVKEY="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:builder_smart_contract_minter_privkey}}"
-
-SCOUTGAME_CONTRACT_NAME="prd"
-SCOUTGAME_S3_BUCKET="scoutgame.public"
-S3_UPLOAD_REGION="{{pull:secretsmanager:/io.cv.app/prd/aws/s3:SecretString:region}}"
-S3_UPLOAD_SECRET="{{pull:secretsmanager:/io.cv.app/prd/aws/s3:SecretString:access_key_secret}}"
-S3_UPLOAD_KEY="{{pull:secretsmanager:/io.cv.app/prd/aws/s3:SecretString:access_key}}"
-
-# Scout protocol season 2
-SCOUTGAME_METADATA_PATH_PREFIX="prd"
-REACT_APP_SCOUTPROTOCOL_CONTRACT_ADDRESS="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:scoutprotocol_contract_address}}"
-SCOUTPROTOCOL_CLAIMS_MANAGER_PRIVKEY="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:scoutprotocol_claims_manager_privkey}}"
-SCOUTPROTOCOL_EAS_ATTESTER_PRIVKEY="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:scoutprotocol_eas_attester_privkey}}"
-
-# Attestation schemas
-REACT_APP_SCOUTPROTOCOL_PROFILE_EAS_SCHEMAID="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:scoutprotocol_profile_eas_schemaid}}"
-REACT_APP_SCOUTPROTOCOL_CONTRIBUTION_RECEIPT_EAS_SCHEMAID="{{pull:secretsmanager:/io.cv.app/prd/buildernft:SecretString:scoutprotocol_contribution_receipt_eas_schemaid}}"
diff --git a/.eslintrc.json b/.eslintrc.json
index 6a6f372712..ac59e71034 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -83,7 +83,6 @@
"./apps/farcaster/",
"./apps/scoutgame/",
"./apps/scoutgametelegram/",
- "./apps/scoutgameadmin/",
"./apps/scoutgamecron/",
"./apps/sunnyawards/",
"./apps/waitlist/",
@@ -208,4 +207,4 @@
}
}
]
-}
\ No newline at end of file
+}
diff --git a/.github/actions/build_docker_image/action.yml b/.github/actions/build_docker_image/action.yml
index e88d9d66af..370816c7b2 100644
--- a/.github/actions/build_docker_image/action.yml
+++ b/.github/actions/build_docker_image/action.yml
@@ -36,7 +36,6 @@ runs:
rm -rf apps/sunnyawards/.next/cache
rm -rf apps/farcaster/.next/cache
rm -rf apps/scoutgametelegram/.next/cache
- rm -rf apps/scoutgameadmin/.next/cache
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
diff --git a/.github/workflows/deploy_scoutgameadmin.yml b/.github/workflows/deploy_scoutgameadmin.yml
deleted file mode 100644
index e7d8ccf2a6..0000000000
--- a/.github/workflows/deploy_scoutgameadmin.yml
+++ /dev/null
@@ -1,278 +0,0 @@
-name: Scoutgame Scout Game Admin CI
-
-on:
- push:
- branches: [main]
- paths:
- - '.cdk/**'
- - 'docker-compose.yml'
- - '.ebextensions/scoutgameadmin/**'
- - '.ebstalk.apps.env/scoutgameadmin.env'
- - '.github/actions/**'
- - '.github/workflows/deploy_scoutgameadmin.yml'
- - 'package.json'
- - 'package-lock.json'
- - 'apps/scoutgameadmin/**'
- - 'packages/**'
- pull_request:
- types: [labeled, opened, synchronize]
- branches: ['**']
- paths:
- - '.cdk/**'
- - 'docker-compose.yml'
- - '.ebextensions/scoutgameadmin/**'
- - '.ebstalk.apps.env/scoutgameadmin.env'
- - '.github/actions/**'
- - '.github/workflows/deploy_scoutgameadmin.yml'
- - 'package.json'
- - 'package-lock.json'
- - 'apps/scoutgameadmin/**'
- - 'packages/**'
- workflow_dispatch:
- inputs:
- core_pkg_version:
- description: 'Core pkg version to update to'
- required: true
-
-concurrency:
- group: ci-scoutgameadmin-${{ github.event_name }}-${{ github.ref }}
-
-jobs:
- build:
- name: Build Scout Game Admin
- runs-on: ubuntu-latest
- outputs:
- head_commit_message: ${{ steps.setup_variables.outputs.commit_message }}
- deploy_staging: ${{ steps.setup_variables.outputs.deploy_staging }}
- skip_tests: ${{ steps.setup_variables.outputs.skip_tests }}
- steps:
- - name: Print Triggering event context payload
- env:
- workflow_event_context: ${{ toJSON(github.event) }}
- run: |
- echo "$workflow_event_context"
- echo "Workflow and code ref: ${{github.ref}}"
-
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Setup variables
- id: setup_variables
- # source https://github.com/orgs/community/discussions/28474
- run: |
- echo "commit_message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
- echo "deploy_staging=${{(github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy-scoutgameadmin') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgameadmin'))}}" >> $GITHUB_OUTPUT
- echo "skip_tests=${{ contains(env.commit_message, 'skip-tests') }}" >> $GITHUB_OUTPUT
-
- - name: Install dependencies
- uses: ./.github/actions/install
- with:
- core_pkg_version: ${{ inputs.core_pkg_version }}
- commit_core_pkg_upgrade: true
-
- - name: Build app
- uses: ./.github/actions/build_app
- with:
- app_name: scoutgameadmin
-
- test-scoutgameadmin:
- name: Test apps
- runs-on: ubuntu-latest
- needs: build
- if: ${{ github.event.action != 'labeled' && needs.build.outputs.skip_tests != 'true' }}
- # Postgres setup copied from https://gist.github.com/2color/537f8ef13ecec80059abb007839a6878
- services:
- postgres:
- image: postgres
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- --hostname postgres
- ports:
- # Maps tcp port 5432 on service container to the host
- - 5432:5432
-
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Restore dependencies from cache
- uses: ./.github/actions/install
-
- - name: Setup test database
- run: npx dotenv -e .env.test.local -- npm run prisma:reset
-
- - name: Restore app from cache
- uses: ./.github/actions/build_app
- with:
- app_name: scoutgameadmin
-
- - name: Typecheck app
- run: npm run typecheck -w apps/scoutgameadmin
-
- - name: Run app tests
- run: npm run scoutgameadmin:test
-
- upload-docker:
- name: Upload Docker image
- runs-on: ubuntu-latest
- # run whether previous jobs were successful or skipped
- if: |
- github.ref == 'refs/heads/main' || needs.build.outputs.deploy_staging == 'true'
- needs: build
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Install dependencies
- uses: ./.github/actions/install
-
- - name: Restore app from cache
- uses: ./.github/actions/build_app
- with:
- app_name: scoutgameadmin
-
- - name: Update Dockerfile
- run: |
- rm Dockerfile && mv apps/scoutgameadmin/Dockerfile Dockerfile
-
- - name: Build and Push Docker image
- id: docker_build_push
- uses: ./.github/actions/build_docker_image
- env:
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: us-east-1
- with:
- ecr_registry: scoutgameadmin
-
- upload-static-assets:
- name: Upload assets in production
- runs-on: ubuntu-latest
- # run whether previous jobs were successful or skipped
- if: github.ref == 'refs/heads/main' && !(failure() || cancelled())
- needs: build
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Install dependencies
- uses: ./.github/actions/install
- with:
- app_name: scoutgameadmin
-
- - name: Calculate Build ID
- id: get_build_id
- run: |
- build_id=${{ hashFiles('package-lock.json', 'apps/**/*.[jt]s', 'lib/**/*.[jt]s') }}
- echo "build_id=$build_id" >> $GITHUB_OUTPUT
-
- - name: Restore app from cache
- uses: ./.github/actions/build_app
- with:
- app_name: scoutgameadmin
-
- - name: Configure AWS credentials
- uses: aws-actions/configure-aws-credentials@v4
- with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- aws-region: us-east-1
-
- deploy-production:
- name: Deploy to production
- # run whether previous jobs were successful or skipped
- if: github.ref == 'refs/heads/main' && !(failure() || cancelled())
- needs: [test-scoutgameadmin, upload-docker, upload-static-assets]
- runs-on: ubuntu-latest
- strategy:
- matrix:
- include:
- - stack: prd-scoutgameadmin
- ebextensions: scoutgameadmin
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Inject slug/short variables
- uses: rlespinasse/github-slug-action@v4.x
- with:
- short-length: 7
-
- # we need to bring back node_modules which includes tsconfig-paths which is used by CDK files
- - name: Install dependencies
- uses: ./.github/actions/install
- with:
- app_name: scoutgameadmin
-
- - name: Set the docker compose env variables
- uses: mikefarah/yq@master
- with:
- cmd: |
- mv .ebextensions .ebextensions_tmp && mv .ebextensions_tmp/${{ matrix.ebextensions }} .ebextensions
- yq -I 4 -i '
- with(.option_settings."aws:elasticbeanstalk:application:environment";
- .IMGTAG = "${{ github.run_id }}-${{ env.GITHUB_SHA_SHORT }}")
- ' .ebextensions/00_env_vars.config
-
- - name: Configure AWS credentials
- uses: aws-actions/configure-aws-credentials@v4
- with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- aws-region: us-east-1
-
- - name: Package and deploy
- run: |
- cat files_to_zip.txt | zip --symlinks -r@ ${{ matrix.stack }}.zip
- npx aws-cdk deploy --method=direct -c name=${{ matrix.stack }}
-
- deploy-staging:
- name: Deploy to staging
-
- if: needs.build.outputs.deploy_staging == 'true'
- runs-on: ubuntu-latest
- # prevent staging deploys + cleanup running in parallel
- concurrency: staging-${{ github.ref }}
- needs: [build, upload-docker]
- steps:
- - uses: actions/checkout@v4
-
- - uses: ./.github/actions/deploy_staging
- env:
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- app_name: scoutgameadmin
-
- discord-alert:
- name: Notify Discord of failure
- runs-on: ubuntu-latest
- if: github.ref == 'refs/heads/main' && failure()
- # pass in all steps so we can check if any failed
- needs: [test-scoutgameadmin, upload-docker, upload-static-assets, upload-docker, deploy-production]
- steps:
- - name: If any of prev jobs failed notify discord
- if: contains(needs.*.result, 'failure')
- uses: sarisia/actions-status-discord@v1
- with:
- webhook: ${{ secrets.DISCORD_WARNINGS_WEBHOOK }}
- status: 'failure'
- content: 'Hey <@&1027309276454207519>'
- title: 'Scout Game Admin deploy workflow failed'
- description: |
- Failed workflow URL: https://github.com/charmverse/app.charmverse.io/actions/runs/${{ github.run_id }}
- color: '16515843'
- url: 'https://github.com/charmverse/app.charmverse.io/actions/runs/${{ github.run_id }}'
- username: GitHub Actions
- avatar_url: 'https://github.githubassets.com/images/modules/logos_page/Octocat.png'
diff --git a/.github/workflows/destroy_staging.yml b/.github/workflows/destroy_staging.yml
index a0cff91f7b..ffdb8d8a10 100644
--- a/.github/workflows/destroy_staging.yml
+++ b/.github/workflows/destroy_staging.yml
@@ -11,7 +11,7 @@ jobs:
clean-up:
if: |
(github.event.action == 'unlabeled' && startsWith(github.event.label.name, ':rocket: deploy')) ||
- (github.event.action == 'closed' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-ceramic') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgame') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-sunnyawards') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgameadmin') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-farcaster') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-cron') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-waitlist') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-websockets') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgamecron')))
+ (github.event.action == 'closed' && (contains(github.event.pull_request.labels.*.name, ':rocket: deploy') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-ceramic') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgame') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-sunnyawards') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-farcaster') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-cron') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-waitlist') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-websockets') || contains(github.event.pull_request.labels.*.name, ':rocket: deploy-scoutgamecron')))
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
@@ -47,7 +47,7 @@ jobs:
run: |
stage_name_suffix="${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}"
- for app in ceramic scoutgameadmin cron farcaster scoutgame scoutgamecron scoutgametelegram sunnyawards waitlist webapp websockets; do
+ for app in ceramic cron farcaster scoutgame scoutgamecron scoutgametelegram sunnyawards waitlist webapp websockets; do
# sanitize and trim string so that it can be used as a valid subdomain. Includes removing hyphens at the start and end of the name
stage_name=`echo "stg-${app}-${stage_name_suffix}" | sed -E -e 's/[^a-zA-Z0-9-]+//g' -e 's/(.{40}).*/\1/' -e 's/^-/0/' -e 's/-$/0/'`
@@ -87,12 +87,6 @@ jobs:
token: ${{ steps.get-token.outputs.token }}
environment: ${{ steps.destroy_aws_stack.outputs.scoutgamecron_env }}
- - name: Delete Scout Game Admin Github deployment
- uses: strumwolf/delete-deployment-environment@v3
- with:
- token: ${{ steps.get-token.outputs.token }}
- environment: ${{ steps.destroy_aws_stack.outputs.scoutgameadmin_env }}
-
- name: Delete Scout Game Telegram Github deployment
uses: strumwolf/delete-deployment-environment@v3
with:
diff --git a/apps/scoutgameadmin/Dockerfile b/apps/scoutgameadmin/Dockerfile
deleted file mode 100644
index 80609e5b88..0000000000
--- a/apps/scoutgameadmin/Dockerfile
+++ /dev/null
@@ -1,36 +0,0 @@
-#syntax=docker/dockerfile:1.7-labs
-
-# Use node-slim because node-alpine does not seem to supports the `sharp` npm library that gets built
-FROM node:18.19.0-slim AS base-app
-
-# useful for node-alpine
-# RUN apk add --no-cache libc6-compat git
-RUN apt update
-RUN apt install openssl -y
-
-WORKDIR /app
-
-# Copy dependencies
-COPY --parents @connect-shared \
- apps/*/package.json \
- packages/*/package.json \
- node_modules \
- package.json \
- apps/scoutgameadmin/node_modules \
- apps/scoutgameadmin/package.json \
- .
-
-# Copy compiled code
-COPY --parents apps/*/.next apps/*/public .
-
-ENV PORT=3000
-
-# Next.js collects completely anonymous telemetry data about general usage.
-# Learn more here: https://nextjs.org/telemetry
-# Uncomment the following line in case you want to disable telemetry.
-ENV NEXT_TELEMETRY_DISABLED=1
-ENV LOG_LEVEL=debug
-
-EXPOSE 3000
-# need something to keep docker container running until docker-compose runs its command
-CMD ["tail", "-f", "/dev/null"]
diff --git a/apps/scoutgameadmin/README.md b/apps/scoutgameadmin/README.md
deleted file mode 100644
index 835b2f0ac7..0000000000
--- a/apps/scoutgameadmin/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# connect.charmverse.io Coming Soon
diff --git a/apps/scoutgameadmin/app/(general)/contract/page.tsx b/apps/scoutgameadmin/app/(general)/contract/page.tsx
deleted file mode 100644
index ea97eba49f..0000000000
--- a/apps/scoutgameadmin/app/(general)/contract/page.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ContractDashboard } from 'components/contract/ContractDashboard';
-import { aggregateProtocolData } from 'lib/contract/aggregateProtocolData';
-import { getContractData } from 'lib/contract/getContractData';
-import { getUserFromSession } from 'lib/session/getUserFromSession';
-
-export const dynamic = 'force-dynamic';
-
-export default async function Dashboard({
- searchParams
-}: {
- searchParams: { [key: string]: string | string[] | undefined };
-}) {
- const tab = searchParams.tab as string;
- const seasonOneData = await getContractData();
- return ;
-}
diff --git a/apps/scoutgameadmin/app/(general)/farcaster/page.tsx b/apps/scoutgameadmin/app/(general)/farcaster/page.tsx
deleted file mode 100644
index 7469799fae..0000000000
--- a/apps/scoutgameadmin/app/(general)/farcaster/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { FarcasterDashboard } from 'components/farcaster/FarcasterDashboard';
-import { getUserFromSession } from 'lib/session/getUserFromSession';
-
-export const dynamic = 'force-dynamic';
-
-export default async function DashboardPage() {
- const user = await getUserFromSession();
- return ;
-}
diff --git a/apps/scoutgameadmin/app/(general)/layout.tsx b/apps/scoutgameadmin/app/(general)/layout.tsx
deleted file mode 100644
index 717a82cd0c..0000000000
--- a/apps/scoutgameadmin/app/(general)/layout.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Box } from '@mui/material';
-import type { ReactNode } from 'react';
-
-import { Header } from 'components/common/Header';
-import { StickyFooter } from 'components/common/StickyFooter';
-import { getUserFromSession } from 'lib/session/getUserFromSession';
-
-export default async function Layout({
- children
-}: Readonly<{
- children: ReactNode;
-}>) {
- const user = await getUserFromSession();
-
- return (
-
-
-
- {children}
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/app/(general)/repos/page.tsx b/apps/scoutgameadmin/app/(general)/repos/page.tsx
deleted file mode 100644
index 640d04610b..0000000000
--- a/apps/scoutgameadmin/app/(general)/repos/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { ReposDashboard } from 'components/repos/ReposDashboard';
-import { getRepos } from 'lib/repos/getRepos';
-
-export const dynamic = 'force-dynamic';
-
-export default async function Dashboard() {
- const repos = await getRepos();
- return ;
-}
diff --git a/apps/scoutgameadmin/app/(general)/template.tsx b/apps/scoutgameadmin/app/(general)/template.tsx
deleted file mode 100644
index f8b52b4fe4..0000000000
--- a/apps/scoutgameadmin/app/(general)/template.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Box } from '@mui/material';
-import type { ReactNode } from 'react';
-
-export default function Template({ children }: { children: ReactNode }) {
- return {children};
-}
diff --git a/apps/scoutgameadmin/app/(general)/users/page.tsx b/apps/scoutgameadmin/app/(general)/users/page.tsx
deleted file mode 100644
index 049605e638..0000000000
--- a/apps/scoutgameadmin/app/(general)/users/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { UsersDashboard } from 'components/users/UsersDashboard';
-import { getUsers } from 'lib/users/getUsers';
-
-export const dynamic = 'force-dynamic';
-
-export default async function Dashboard() {
- const users = await getUsers();
- return ;
-}
diff --git a/apps/scoutgameadmin/app/(info)/layout.tsx b/apps/scoutgameadmin/app/(info)/layout.tsx
deleted file mode 100644
index aac2da63a7..0000000000
--- a/apps/scoutgameadmin/app/(info)/layout.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Box } from '@mui/material';
-import type { ReactNode } from 'react';
-
-import 'theme/styles.scss';
-
-export default function Layout({
- children
-}: Readonly<{
- children: ReactNode;
-}>) {
- return (
-
-
- {children}
-
-
- );
-}
diff --git a/apps/scoutgameadmin/app/(info)/login/page.tsx b/apps/scoutgameadmin/app/(info)/login/page.tsx
deleted file mode 100644
index bc8af047e4..0000000000
--- a/apps/scoutgameadmin/app/(info)/login/page.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { Metadata } from 'next';
-
-import { LoginPage as LoginPageComponent } from 'components/login/LoginPage';
-
-export const metadata: Metadata = {
- title: 'Login to Scout Game Admin'
-};
-
-export default async function LoginPage() {
- return ;
-}
diff --git a/apps/scoutgameadmin/app/(info)/template.tsx b/apps/scoutgameadmin/app/(info)/template.tsx
deleted file mode 100644
index 0693c1773d..0000000000
--- a/apps/scoutgameadmin/app/(info)/template.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Box } from '@mui/material';
-import type { ReactNode } from 'react';
-
-export default function Template({ children }: { children: ReactNode }) {
- return {children};
-}
diff --git a/apps/scoutgameadmin/app/api/blockchain/scout-events/route.ts b/apps/scoutgameadmin/app/api/blockchain/scout-events/route.ts
deleted file mode 100644
index 3ae09b8fd6..0000000000
--- a/apps/scoutgameadmin/app/api/blockchain/scout-events/route.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { getOnchainPurchaseEvents } from '@packages/scoutgame/builderNfts/getOnchainPurchaseEvents';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-export type RequestParams = {
- chainId: string;
- txHash: string;
-};
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const scoutId = searchParams.get('scoutId');
- if (!scoutId) {
- return NextResponse.json({ message: 'Missing scoutId' }, { status: 400 });
- }
- const userPurchases = await getOnchainPurchaseEvents({ scoutId });
- return NextResponse.json(userPurchases);
-}
diff --git a/apps/scoutgameadmin/app/api/blockchain/transaction-status/route.ts b/apps/scoutgameadmin/app/api/blockchain/transaction-status/route.ts
deleted file mode 100644
index 6277152e2b..0000000000
--- a/apps/scoutgameadmin/app/api/blockchain/transaction-status/route.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getTransactionStatusFromDecent } from '@packages/blockchain/waitForDecentTransactionSettlement';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-export type RequestParams = {
- chainId: string;
- txHash: string;
-};
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const chainId = searchParams.get('chainId');
- const txHash = searchParams.get('txHash');
- if (!chainId || !txHash) {
- return NextResponse.json({ message: 'Missing chainId or txHash' }, { status: 400 });
- }
- const status = await getTransactionStatusFromDecent({
- sourceTxHash: txHash,
- sourceTxHashChainId: Number(chainId)
- });
- return NextResponse.json(status);
-}
diff --git a/apps/scoutgameadmin/app/api/github/delete-strike/route.ts b/apps/scoutgameadmin/app/api/github/delete-strike/route.ts
deleted file mode 100644
index ead2df1093..0000000000
--- a/apps/scoutgameadmin/app/api/github/delete-strike/route.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { log } from '@charmverse/core/log';
-import { prisma } from '@charmverse/core/prisma-client';
-import type { NextRequest } from 'next/server';
-
-export async function DELETE(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const strikeId = searchParams.get('strikeId');
- if (!strikeId) {
- return Response.json({ error: 'Strike ID is required' }, { status: 400 });
- }
- // Delete the strike
- const strike = await prisma.builderStrike.update({
- where: {
- id: strikeId
- },
- data: {
- deletedAt: new Date()
- }
- });
-
- log.info('Builder strike marked as deleted', { builderId: strike.builderId, strikeId });
-
- return Response.json({ success: true });
-}
diff --git a/apps/scoutgameadmin/app/api/github/search-repos/route.ts b/apps/scoutgameadmin/app/api/github/search-repos/route.ts
deleted file mode 100644
index 5c4765468e..0000000000
--- a/apps/scoutgameadmin/app/api/github/search-repos/route.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import { getReposByOwner } from '@packages/github/getReposByOwner';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-export type RepoSearchResult = {
- id: number;
- url: string;
- fullName: string;
- exists: boolean;
-};
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const owner = searchParams.get('owner');
- if (!owner || owner.length < 2) {
- return NextResponse.json([]);
- }
- try {
- const repos = await getReposByOwner(owner);
- const existing = await prisma.githubRepo.findMany({
- where: {
- id: {
- in: repos.map((repo) => repo.id)
- }
- }
- });
- const result: RepoSearchResult[] = repos.map((repo) => ({
- id: repo.id,
- fullName: repo.full_name,
- url: repo.html_url,
- exists: existing.some((e) => e.id === repo.id)
- }));
- return NextResponse.json(result);
- } catch (error) {
- if ((error as Error).message?.includes('HTTP error! status: 404')) {
- return NextResponse.json({ message: 'Repository owner not found' }, { status: 404 });
- }
- return NextResponse.json({ message: (error as Error).message || 'Something went wrong' }, { status: 500 });
- }
-}
diff --git a/apps/scoutgameadmin/app/api/github/user-stats/route.ts b/apps/scoutgameadmin/app/api/github/user-stats/route.ts
deleted file mode 100644
index b0e87e0a14..0000000000
--- a/apps/scoutgameadmin/app/api/github/user-stats/route.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import type { BuilderStrike, GithubEvent } from '@charmverse/core/prisma-client';
-import { prisma } from '@charmverse/core/prisma-client';
-import { getCommitsByUser } from '@packages/github/getCommitsByUser';
-import { DateTime } from 'luxon';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-type Commit = {
- url: string;
- date: string;
- repo: string;
- title: string;
-};
-
-export type GithubUserStats = {
- afterDate: string;
- commits: number;
- builderStrikes: (Pick & {
- githubEvent: GithubEvent & { repo: { owner: string; name: string } };
- })[];
- lastCommit?: Commit;
-};
-
-const afterDate = DateTime.utc().minus({ months: 3 }).toJSDate();
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const login = searchParams.get('login');
- if (!login || login.length < 2) {
- return NextResponse.json({ commits: 0, builderStrikes: [] });
- }
- try {
- const builderStrikes = await prisma.builderStrike.findMany({
- where: {
- builder: {
- githubUser: {
- some: {
- login
- }
- }
- }
- },
- orderBy: {
- createdAt: 'desc'
- },
- select: {
- id: true,
- createdAt: true,
- deletedAt: true,
- githubEvent: {
- include: {
- repo: true
- }
- }
- }
- });
- const commits = await getCommitsByUser({ login, after: afterDate });
- const lastCommit = commits[0];
- const result: GithubUserStats = {
- afterDate: afterDate.toISOString(),
- commits: commits.length,
- builderStrikes: builderStrikes.map((strike) => ({
- ...strike,
- githubEvent: strike.githubEvent! // TODO: make this required in the db?
- })),
- lastCommit: lastCommit
- ? {
- url: lastCommit.html_url,
- title: lastCommit.commit.message,
- date: lastCommit.commit.author.date,
- repo: lastCommit.repository.full_name
- }
- : undefined
- };
- return NextResponse.json(result);
- } catch (error) {
- if ((error as Error).message?.includes('HTTP error! status: 404')) {
- return NextResponse.json({ message: 'User not found' }, { status: 404 });
- }
- return NextResponse.json({ message: (error as Error).message || 'Something went wrong' }, { status: 500 });
- }
-}
diff --git a/apps/scoutgameadmin/app/api/health/route.ts b/apps/scoutgameadmin/app/api/health/route.ts
deleted file mode 100644
index 900a4d5649..0000000000
--- a/apps/scoutgameadmin/app/api/health/route.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export function GET() {
- return new Response('ok');
-}
diff --git a/apps/scoutgameadmin/app/api/partners/celo/route.ts b/apps/scoutgameadmin/app/api/partners/celo/route.ts
deleted file mode 100644
index 44852d4aab..0000000000
--- a/apps/scoutgameadmin/app/api/partners/celo/route.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getLastWeek } from '@packages/scoutgame/dates';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-import { getBuildersForPartner } from 'lib/partners/getBuildersForPartner';
-
-export const dynamic = 'force-dynamic';
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const rows = await getBuildersForPartner({
- week: lastWeek,
- bonusPartner: 'celo'
- });
-
- return respondWithTSV(rows, `partners-export_celo_${lastWeek}.tsv`);
-}
diff --git a/apps/scoutgameadmin/app/api/partners/game7/route.ts b/apps/scoutgameadmin/app/api/partners/game7/route.ts
deleted file mode 100644
index 0d0cc46477..0000000000
--- a/apps/scoutgameadmin/app/api/partners/game7/route.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { getLastWeek } from '@packages/scoutgame/dates';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-import { getBuildersForPartner } from 'lib/partners/getBuildersForPartner';
-
-export const dynamic = 'force-dynamic';
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const rows = await getBuildersForPartner({
- week: lastWeek,
- bonusPartner: 'game7'
- });
- return respondWithTSV(rows, `partners-export_game7_${lastWeek}.tsv`);
-}
diff --git a/apps/scoutgameadmin/app/api/partners/lit_protocol/route.ts b/apps/scoutgameadmin/app/api/partners/lit_protocol/route.ts
deleted file mode 100644
index d13cc49545..0000000000
--- a/apps/scoutgameadmin/app/api/partners/lit_protocol/route.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getLastWeek } from '@packages/scoutgame/dates';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-import { getBuildersForPartner } from 'lib/partners/getBuildersForPartner';
-
-export const dynamic = 'force-dynamic';
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const rows = await getBuildersForPartner({
- week: lastWeek,
- bonusPartner: 'lit_protocol'
- });
-
- return respondWithTSV(rows, `partners-export_lit_${lastWeek}.tsv`);
-}
diff --git a/apps/scoutgameadmin/app/api/partners/moxie/route.ts b/apps/scoutgameadmin/app/api/partners/moxie/route.ts
deleted file mode 100644
index 142e6012af..0000000000
--- a/apps/scoutgameadmin/app/api/partners/moxie/route.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import { currentSeason, getLastWeek } from '@packages/scoutgame/dates';
-import { airstackRequest } from '@packages/scoutgame/moxie/airstackRequest';
-import { getMoxieFanToken } from '@packages/scoutgame/moxie/getMoxieFanToken';
-import { uniq } from 'lodash';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-
-export const dynamic = 'force-dynamic';
-
-type MoxieBonusRow = {
- 'Builder FID': number;
- 'Builder path': string;
- 'Builder event': string;
- 'Scout FID': number;
- 'Scout email': string;
- 'Scout path': string;
-};
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const builders = await prisma.scout.findMany({
- where: {
- builderStatus: 'approved'
- },
- orderBy: {
- farcasterId: 'asc'
- },
- select: {
- farcasterId: true,
- path: true,
- events: {
- where: {
- type: {
- in: ['merged_pull_request', 'daily_commit']
- },
- week: lastWeek
- }
- },
- builderNfts: {
- where: {
- season: currentSeason
- },
- select: {
- nftSoldEvents: {
- select: {
- scout: {
- select: {
- farcasterId: true,
- path: true
- }
- }
- }
- }
- }
- }
- }
- });
- const rows: MoxieBonusRow[] = [];
-
- await Promise.all(
- builders.map(async (builder) => {
- if (builder.farcasterId && builder.events.length > 0) {
- // TODO: record moxie fan token data so we dont have to look it up again
- const moxieNft = await getMoxieFanToken(builder.farcasterId);
- if (moxieNft) {
- const scoutFids = builder.builderNfts
- .map((nft) => nft.nftSoldEvents.map((e) => e.scout.farcasterId))
- .flat()
- .filter(Boolean);
- for (const scoutFid of uniq(scoutFids)) {
- const fanTokenAmount = await getMoxieFanTokenAmount({
- builderFid: builder.farcasterId,
- scoutFid: scoutFid!
- });
- const scout = await prisma.scout.findUnique({
- where: {
- farcasterId: scoutFid!
- }
- });
- if (fanTokenAmount && scout) {
- // console.log('found scout with fan token', builder.farcasterId, scoutFid, fanTokenAmount);
- rows.push({
- 'Scout FID': scoutFid!,
- 'Scout email': scout.email || '',
- 'Scout path': scout.path!,
- 'Builder FID': builder.farcasterId,
- 'Builder path': builder.path!,
- 'Builder event':
- (builder.events[0]!.type === 'merged_pull_request' ? `PR on ` : `Commit on `) +
- builder.events[0]!.createdAt.toDateString()
- });
- }
- }
- }
- }
- })
- );
-
- return respondWithTSV(rows, `partners-export_moxie_${lastWeek}.tsv`);
-}
-
-export async function getMoxieFanTokenAmount({
- builderFid,
- scoutFid
-}: {
- builderFid: number;
- scoutFid: number;
-}): Promise {
- const query = `
- query GetPortfolioInfo {
- MoxieUserPortfolios(
- input: {
- filter: {
- fid: {_eq: "${scoutFid}"},
- fanTokenSymbol: {
- # Fan Token to check, symbol will be based on types:
- # - User: fid:
- # - Channel: cid:
- # - Network: id:farcaster
- _eq: "fid:${builderFid}"
- }
- }
- }
- ) {
- MoxieUserPortfolio {
- amount: totalUnlockedAmount
- }
- }
- }
- `;
- const data = await airstackRequest(query);
- // console.log('data', data);
- return data.data.MoxieUserPortfolios.MoxieUserPortfolio?.[0]?.amount || 0;
-}
diff --git a/apps/scoutgameadmin/app/api/partners/op_supersim/route.ts b/apps/scoutgameadmin/app/api/partners/op_supersim/route.ts
deleted file mode 100644
index 0306d40759..0000000000
--- a/apps/scoutgameadmin/app/api/partners/op_supersim/route.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { getLastWeek } from '@packages/scoutgame/dates';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-import { getBuildersForPartner } from 'lib/partners/getBuildersForPartner';
-
-export const dynamic = 'force-dynamic';
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const rows = await getBuildersForPartner({
- week: lastWeek,
- bonusPartner: 'op_supersim'
- });
-
- return respondWithTSV(rows, `partners-export_supersim_${lastWeek}.tsv`);
-}
diff --git a/apps/scoutgameadmin/app/api/partners/optimism/route.ts b/apps/scoutgameadmin/app/api/partners/optimism/route.ts
deleted file mode 100644
index d52f2a45a3..0000000000
--- a/apps/scoutgameadmin/app/api/partners/optimism/route.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getLastWeek } from '@packages/scoutgame/dates';
-import { getRankedNewScoutsForPastWeek } from '@packages/scoutgame/scouts/getNewScouts';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-
-export const dynamic = 'force-dynamic';
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const scouts = await getRankedNewScoutsForPastWeek({
- week: lastWeek
- });
-
- const rows = scouts.slice(0, 10).map((scout) => ({
- Path: `https://scoutgame.xyz/u/${scout.path}`,
- 'Display Name': scout.displayName,
- 'Points Earned': scout.pointsEarned,
- Wallet: scout.scoutWallet?.[0]?.address
- }));
-
- return respondWithTSV(rows, `partners-export_optimism_new_scouts_${lastWeek}.tsv`);
-}
diff --git a/apps/scoutgameadmin/app/api/partners/talent/route.ts b/apps/scoutgameadmin/app/api/partners/talent/route.ts
deleted file mode 100644
index e1ebce92d8..0000000000
--- a/apps/scoutgameadmin/app/api/partners/talent/route.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import type { Scout } from '@charmverse/core/prisma';
-import { prisma } from '@charmverse/core/prisma-client';
-import { getBuildersLeaderboard } from '@packages/scoutgame/builders/getBuildersLeaderboard';
-import { getLastWeek } from '@packages/scoutgame/dates';
-import { getTalentProfile } from '@packages/scoutgame/talent/getTalentProfile';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-
-export const dynamic = 'force-dynamic';
-
-const minimumTalentScore = 75;
-
-export async function GET() {
- const lastWeek = getLastWeek();
- const topBuilders = await getBuildersLeaderboard({
- week: lastWeek
- });
-
- const buildersWithTalent: {
- wallet: string;
- score: number;
- rank: number;
- builder: Pick;
- }[] = [];
-
- for (const builder of topBuilders) {
- const fullBuilder = await prisma.scout.findUniqueOrThrow({
- where: {
- id: builder.builder.id
- },
- select: {
- farcasterId: true,
- displayName: true,
- path: true,
- email: true,
- talentProfile: {
- select: {
- id: true,
- score: true,
- address: true
- }
- },
- scoutWallet: {
- select: {
- address: true
- }
- }
- }
- });
-
- const { scoutWallet, farcasterId } = fullBuilder;
-
- if (fullBuilder.talentProfile) {
- const talentProfile = fullBuilder.talentProfile;
- if (talentProfile.score >= minimumTalentScore) {
- buildersWithTalent.push({
- rank: builder.rank,
- builder: fullBuilder,
- score: talentProfile.score,
- wallet: talentProfile.address
- });
- }
- } else {
- const wallets = scoutWallet.map((wallet) => wallet.address);
- const talentProfile = await getTalentProfile({
- farcasterId,
- wallets,
- minimumTalentScore
- });
-
- if (talentProfile) {
- buildersWithTalent.push({
- ...talentProfile,
- rank: builder.rank,
- builder: fullBuilder,
- score: talentProfile.score
- });
- }
- }
-
- // grab the first 5 builders with 'talent'
- if (buildersWithTalent.length >= 5) {
- break;
- }
- }
-
- const rows = buildersWithTalent.map(({ builder, rank, wallet, score }) => ({
- 'User Name': builder.displayName,
- 'Profile Link': `https://scoutgame.xyz/u/${builder.path}`,
- Email: builder.email,
- 'Wallet Address': wallet,
- 'Scout Game Rank': rank,
- 'Talent Score': score
- }));
-
- return respondWithTSV(rows, `partners-export_talent_${lastWeek}.tsv`);
-}
diff --git a/apps/scoutgameadmin/app/api/repos/export/route.ts b/apps/scoutgameadmin/app/api/repos/export/route.ts
deleted file mode 100644
index 2aea7aa9b8..0000000000
--- a/apps/scoutgameadmin/app/api/repos/export/route.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import { stringify } from 'csv-stringify/sync';
-import { NextResponse } from 'next/server';
-
-const columns = ['id', 'owner', 'name', 'url'];
-
-export const dynamic = 'force-dynamic';
-
-export async function GET() {
- const rows = await prisma.githubRepo.findMany();
- const exportString = stringify(rows, { header: true, columns });
- return NextResponse.json(exportString);
- // return new Response(exportString, {
- // status: 200,
- // headers: {
- // 'Content-Type': 'text/tsv',
- // 'Content-Disposition': 'attachment; filename=github_repos.tsv'
- // }
- // });
-}
diff --git a/apps/scoutgameadmin/app/api/repos/route.ts b/apps/scoutgameadmin/app/api/repos/route.ts
deleted file mode 100644
index fd3887f900..0000000000
--- a/apps/scoutgameadmin/app/api/repos/route.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { log } from '@charmverse/core/log';
-import { importReposByUser } from '@packages/scoutgame/importReposByUser';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-import { getRepos } from 'lib/repos/getRepos';
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const searchString = searchParams.get('searchString');
- const repos = await getRepos({ searchString: searchString || undefined });
- return NextResponse.json(repos);
-}
-
-export async function POST(request: NextRequest) {
- const { owner } = await request.json();
-
- await importReposByUser(owner);
-
- return NextResponse.json({ success: true });
-}
diff --git a/apps/scoutgameadmin/app/api/users/create-builder/route.ts b/apps/scoutgameadmin/app/api/users/create-builder/route.ts
deleted file mode 100644
index d204fd600a..0000000000
--- a/apps/scoutgameadmin/app/api/users/create-builder/route.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { log } from '@charmverse/core/log';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-import { createBuilder } from 'lib/users/createBuilder';
-
-export async function POST(request: NextRequest) {
- const params = await request.json();
- const newUser = await createBuilder(params);
- log.info('Approved new builder', { newUser });
- return NextResponse.json({ success: true });
-}
diff --git a/apps/scoutgameadmin/app/api/users/export/route.ts b/apps/scoutgameadmin/app/api/users/export/route.ts
deleted file mode 100644
index c9b4ffcbcd..0000000000
--- a/apps/scoutgameadmin/app/api/users/export/route.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import { currentSeason } from '@packages/scoutgame/dates';
-import type { NextRequest } from 'next/server';
-
-import { respondWithTSV } from 'lib/nextjs/respondWithTSV';
-
-export const dynamic = 'force-dynamic';
-
-type ScoutWithGithubUser = {
- id: string;
- path: string;
- createdAt: string;
- email?: string;
- tokenId?: number;
- optedInToMarketing?: string;
- builderStatus?: string;
- githubLogin?: string;
- fid?: number;
- farcasterName?: string;
- currentBalance: number;
- nftsPurchased: number;
- nftsSold: number;
- pointsEarnedAsScout: number;
- pointsEarnedAsBuilder: number;
- weeklyBuilderRank?: number;
-};
-
-export async function GET() {
- const users = await prisma.scout.findMany({
- select: {
- id: true,
- path: true,
- sendMarketing: true,
- createdAt: true,
- avatar: true,
- email: true,
- builderStatus: true,
- farcasterId: true,
- farcasterName: true,
- currentBalance: true,
- githubUser: true,
- userSeasonStats: true,
- userWeeklyStats: true,
- builderNfts: {
- where: {
- season: currentSeason
- }
- }
- }
- });
- const rows: ScoutWithGithubUser[] = users.map((user) => ({
- id: user.id,
- path: user.path!,
- createdAt: user.createdAt.toDateString(),
- email: user.email || undefined,
- optedInToMarketing: user.sendMarketing ? 'Yes' : '',
- // avatar: user.avatar || '',
- builderStatus: user.builderStatus || undefined,
- tokenId: user.builderNfts[0]?.tokenId || undefined,
- fid: user.farcasterId || undefined,
- farcasterName: user.farcasterName || undefined,
- githubLogin: user.githubUser[0]?.login,
- currentBalance: user.currentBalance,
- pointsEarnedAsScout: user.userSeasonStats[0]?.pointsEarnedAsScout || 0,
- pointsEarnedAsBuilder: user.userSeasonStats[0]?.pointsEarnedAsBuilder || 0,
- nftsPurchased: user.userSeasonStats[0]?.nftsPurchased || 0,
- nftsSold: user.userSeasonStats[0]?.nftsSold || 0,
- weeklyBuilderRank: user.userWeeklyStats[0]?.rank || undefined
- }));
-
- return respondWithTSV(rows, 'scout_users_export.tsv');
-}
diff --git a/apps/scoutgameadmin/app/api/users/get-user/route.ts b/apps/scoutgameadmin/app/api/users/get-user/route.ts
deleted file mode 100644
index e2fc5884c3..0000000000
--- a/apps/scoutgameadmin/app/api/users/get-user/route.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-import { getUser } from 'lib/users/getUser';
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const userId = searchParams.get('userId');
- if (!userId) {
- return NextResponse.json({ error: 'userId is required' }, { status: 400 });
- }
- const user = await getUser(userId);
- return NextResponse.json(user);
-}
diff --git a/apps/scoutgameadmin/app/api/users/route.ts b/apps/scoutgameadmin/app/api/users/route.ts
deleted file mode 100644
index c7d1e3a723..0000000000
--- a/apps/scoutgameadmin/app/api/users/route.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { log } from '@charmverse/core/log';
-import type { BuilderStatus } from '@charmverse/core/prisma';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-import { createUser } from 'lib/users/createUser';
-import type { SortOrder, SortField } from 'lib/users/getUsers';
-import { getUsers } from 'lib/users/getUsers';
-import { searchForUser } from 'lib/users/searchForUser';
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const builderStatus = searchParams.get('builderStatus') as BuilderStatus | undefined;
- const searchString = searchParams.get('searchString');
- const sortOrder = searchParams.get('sortOrder') as SortOrder | undefined;
- const sortField = searchParams.get('sortField') as SortField | undefined;
- const repos = await getUsers({
- searchString: searchString || undefined,
- sortOrder,
- sortField,
- builderStatus
- });
- return NextResponse.json(repos);
-}
-
-export async function POST(request: NextRequest) {
- const params = await request.json();
- const user = await searchForUser(params);
- if (!user) {
- throw new Error(`User not found: ${params.searchString}`);
- }
- const newUser = await createUser(user);
- log.info('Created new user', { newUser });
- return NextResponse.json({ success: true });
-}
diff --git a/apps/scoutgameadmin/app/api/users/search-for-user/route.ts b/apps/scoutgameadmin/app/api/users/search-for-user/route.ts
deleted file mode 100644
index 42a4885f94..0000000000
--- a/apps/scoutgameadmin/app/api/users/search-for-user/route.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-import { searchForUser } from 'lib/users/searchForUser';
-
-export async function GET(request: NextRequest) {
- const { searchParams } = new URL(request.url);
- const searchString = searchParams.get('searchString');
- const user = await searchForUser({ searchString: searchString || '' });
- return NextResponse.json(user);
-}
diff --git a/apps/scoutgameadmin/app/layout.tsx b/apps/scoutgameadmin/app/layout.tsx
deleted file mode 100644
index 3c09a950fe..0000000000
--- a/apps/scoutgameadmin/app/layout.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import type { Metadata, Viewport } from 'next';
-import Script from 'next/script';
-import type { ReactNode } from 'react';
-
-import { AppProviders } from 'components/common/AppProviders';
-
-import 'theme/styles.scss';
-
-const appName = 'Scout Game Admin';
-
-export const metadata: Metadata = {
- applicationName: appName,
- icons: {
- icon: ['/favicon.ico'],
- apple: ['/favicon.ico']
- },
- title: appName,
- formatDetection: {
- telephone: false
- },
- openGraph: {
- type: 'website',
- siteName: appName,
- images: 'https://scoutgame.xyz/images/manifest/scoutgame-logo-256.png',
- title: appName,
- description: 'Scout. Build. Win.'
- },
- twitter: {
- card: 'summary',
- title: appName,
- description: 'Scout. Build. Win.'
- }
-};
-export const viewport: Viewport = {
- themeColor: '#000',
- userScalable: false
-};
-export default async function RootLayout({
- children
-}: Readonly<{
- children: ReactNode;
-}>) {
- return (
-
-
- {/* load env vars for the frontend - note that the parent body tag is required for React to not complain */}
-
- {children}
-
-
- );
-}
diff --git a/apps/scoutgameadmin/app/manifest.ts b/apps/scoutgameadmin/app/manifest.ts
deleted file mode 100644
index 2b876d49dc..0000000000
--- a/apps/scoutgameadmin/app/manifest.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { MetadataRoute } from 'next';
-
-export default function manifest(): MetadataRoute.Manifest {
- return {
- id: 'scoutgame',
- name: 'Scout Game - Onchain builder network',
- short_name: 'Scout Game',
- description: 'Onchain network for connecting web3 developers, projects, organizations',
- start_url: '/',
- display: 'standalone',
- background_color: '#191919',
- theme_color: '#8742FF',
- orientation: 'portrait',
- lang: 'en',
- icons: [
- {
- src: '/images/manifest/scoutgame-logo-192.png',
- type: 'image/png',
- sizes: '192x192'
- },
- {
- src: '/images/manifest/scoutgame-logo-256.png',
- type: 'image/png',
- sizes: '256x256'
- },
- {
- src: '/images/manifest/scoutgame-logo-512.png',
- type: 'image/png',
- sizes: '512x512'
- }
- ],
- screenshots: []
- };
-}
diff --git a/apps/scoutgameadmin/app/not-found.tsx b/apps/scoutgameadmin/app/not-found.tsx
deleted file mode 100644
index 703f4eaf5e..0000000000
--- a/apps/scoutgameadmin/app/not-found.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { NotFoundPage } from '@connect-shared/components/common/NotFoundPage';
-
-export default function NotFound() {
- return ;
-}
diff --git a/apps/scoutgameadmin/app/page.tsx b/apps/scoutgameadmin/app/page.tsx
deleted file mode 100644
index 86d9c54986..0000000000
--- a/apps/scoutgameadmin/app/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { redirect } from 'next/navigation';
-
-export default async function Dashboard() {
- redirect('/repos');
-}
diff --git a/apps/scoutgameadmin/app/robots.ts b/apps/scoutgameadmin/app/robots.ts
deleted file mode 100644
index 6728ed3c9d..0000000000
--- a/apps/scoutgameadmin/app/robots.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import type { MetadataRoute } from 'next';
-
-export default function robots(): MetadataRoute.Robots {
- return {
- rules: {
- userAgent: '*',
- allow: '/'
- }
- };
-}
diff --git a/apps/scoutgameadmin/app/template.tsx b/apps/scoutgameadmin/app/template.tsx
deleted file mode 100644
index 0693c1773d..0000000000
--- a/apps/scoutgameadmin/app/template.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Box } from '@mui/material';
-import type { ReactNode } from 'react';
-
-export default function Template({ children }: { children: ReactNode }) {
- return {children};
-}
diff --git a/apps/scoutgameadmin/components/common/AppProviders.tsx b/apps/scoutgameadmin/components/common/AppProviders.tsx
deleted file mode 100644
index 2ba10a9a35..0000000000
--- a/apps/scoutgameadmin/components/common/AppProviders.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import 'server-only';
-
-import CssBaseline from '@mui/material/CssBaseline';
-import { ThemeProvider } from '@mui/material/styles';
-import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
-import type { ReactNode } from 'react';
-
-import theme from 'theme/theme';
-
-export function AppProviders({ children }: { children: ReactNode }) {
- return (
-
-
-
- {children}
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/common/FileDownloadButton.tsx b/apps/scoutgameadmin/components/common/FileDownloadButton.tsx
deleted file mode 100644
index 859f6a95c9..0000000000
--- a/apps/scoutgameadmin/components/common/FileDownloadButton.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-'use client';
-
-import { LoadingButton } from '@mui/lab';
-import type { ButtonProps } from '@mui/material';
-import type { ReactNode } from 'react';
-
-import { useGETtrigger } from 'hooks/api/helpers';
-
-export function FileDownloadButton({
- children,
- src,
- filename,
- onComplete,
- ...props
-}: {
- children: ReactNode;
- src: string;
- filename: string;
- onComplete?: () => void;
-} & ButtonProps) {
- const { trigger, isMutating, error } = useGETtrigger(src);
- async function onClick() {
- const response = await trigger();
- const url = window.URL.createObjectURL(new Blob([response], { type: 'text/tsv' }));
- const link = document.createElement('a');
- link.href = url;
- link.setAttribute('download', filename);
- document.body.appendChild(link);
- link.click();
- link.remove();
- onComplete?.();
- }
- return (
-
- {children}
-
- );
-}
diff --git a/apps/scoutgameadmin/components/common/Header.tsx b/apps/scoutgameadmin/components/common/Header.tsx
deleted file mode 100644
index d25ebb5fba..0000000000
--- a/apps/scoutgameadmin/components/common/Header.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-'use client';
-
-import { log } from '@charmverse/core/log';
-import type { Scout } from '@charmverse/core/prisma';
-import { revalidatePathAction } from '@connect-shared/lib/actions/revalidatePathAction';
-import { logoutAction } from '@connect-shared/lib/session/logoutAction';
-import { Avatar, Box, Container, IconButton, Menu, MenuItem, Toolbar, AppBar, Stack } from '@mui/material';
-import Image from 'next/image';
-import Link from 'next/link';
-import { useRouter } from 'next/navigation';
-import { useAction } from 'next-safe-action/hooks';
-import type { MouseEvent } from 'react';
-import { useState } from 'react';
-
-import { Hidden } from 'components/common/Hidden';
-import { SiteNavigation } from 'components/common/SiteNavigation';
-
-export function Header({ user }: { user: Pick | null }) {
- const router = useRouter();
-
- const [anchorElUser, setAnchorElUser] = useState(null);
-
- const { execute: logoutUser, isExecuting: isExecutingLogout } = useAction(logoutAction, {
- onSuccess: async () => {
- revalidatePathAction();
- router.push('/');
- },
- onError(err) {
- log.error('Error on logout', { error: err.error.serverError });
- }
- });
-
- const handleOpenUserMenu = (event: MouseEvent) => {
- setAnchorElUser(event.currentTarget);
- };
-
- const handleCloseUserMenu = () => {
- setAnchorElUser(null);
- };
-
- return (
-
-
-
- <>
-
-
-
-
-
-
-
-
-
-
-
-
- >
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/common/Hidden.tsx b/apps/scoutgameadmin/components/common/Hidden.tsx
deleted file mode 100644
index e120f02a3a..0000000000
--- a/apps/scoutgameadmin/components/common/Hidden.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import { log } from '@charmverse/core/log';
-import { Box } from '@mui/material';
-import type { PropsWithChildren } from '@packages/utils/react';
-
-// props based on https://mui.com/material-ui/api/hidden/
-type Props = {
- mdDown?: boolean;
- mdUp?: boolean;
- display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'grid' | 'table' | 'table-cell';
-};
-
-// TODO: just use class names?
-export function getSXProps({ display = 'block', mdDown, mdUp }: Props) {
- if (mdDown) {
- return { display: { xs: 'none', md: display } };
- }
- if (mdUp) {
- return { display: { xs: display, md: 'none' } };
- }
- log.warn('Hidden component must have either mdDown or mdUp prop');
- return {};
-}
-
-// replace a deprecated Hidden component
-export function Hidden({ children, mdDown, mdUp }: PropsWithChildren) {
- return {children};
-}
diff --git a/apps/scoutgameadmin/components/common/MenuItemNoAction.tsx b/apps/scoutgameadmin/components/common/MenuItemNoAction.tsx
deleted file mode 100644
index 4829e9c183..0000000000
--- a/apps/scoutgameadmin/components/common/MenuItemNoAction.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { TypographyProps } from '@mui/material';
-import { ListItem, Typography } from '@mui/material';
-
-export function MenuItemNoAction({ children, ...props }: { children: React.ReactNode } & TypographyProps) {
- return (
- e.stopPropagation()}>
-
- {children}
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/common/SiteNavigation.tsx b/apps/scoutgameadmin/components/common/SiteNavigation.tsx
deleted file mode 100644
index b737a7c3db..0000000000
--- a/apps/scoutgameadmin/components/common/SiteNavigation.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-'use client';
-
-import { BottomNavigation, BottomNavigationAction, styled } from '@mui/material';
-import Link from 'next/link';
-import { usePathname } from 'next/navigation';
-import { FaGithubAlt } from 'react-icons/fa';
-import { HiOutlineUsers } from 'react-icons/hi2';
-import { MdDocumentScanner } from 'react-icons/md';
-import { SiFarcaster } from 'react-icons/si';
-
-const StyledBottomNavigation = styled(BottomNavigation, {
- shouldForwardProp: (prop) => prop !== 'topNav'
-})<{ topNav?: boolean }>(({ theme, topNav }) => ({
- background: topNav
- ? 'transparent'
- : 'linear-gradient(88.35deg, #96CDFF 0%, #A06CD5 29.5%, #96CDFF 75.47%, #A06CD5 100%)',
- '& > a': {
- color: topNav ? theme.palette.text.primary : theme.palette.common.black,
- gap: '2px',
- width: topNav ? '110px' : 'auto',
- transition: 'background-color 0.3s ease',
- '&:hover': {
- backgroundColor: 'rgba(255, 255, 255, 0.1)'
- },
- '&.Mui-selected': {
- color: theme.palette.text.primary,
- backgroundColor: topNav ? theme.palette.primary.main : 'rgba(44, 0, 90, 0.25)'
- },
- '&.MuiButtonBase-root': {
- minWidth: '60px'
- },
- '& .MuiBottomNavigationAction-label': {
- fontSize: '.75rem'
- }
- }
-}));
-export function SiteNavigation({ topNav, isAuthenticated = false }: { topNav?: boolean; isAuthenticated?: boolean }) {
- const pathname = usePathname();
- const value = getActiveButton(pathname);
- return (
-
- }
- LinkComponent={Link}
- />
- }
- LinkComponent={Link}
- />
- }
- LinkComponent={Link}
- />
- }
- LinkComponent={Link}
- />
-
- );
-}
-
-function getActiveButton(pathname: string) {
- return pathname.split('/')[1].split('?')[0];
-}
diff --git a/apps/scoutgameadmin/components/common/StickyFooter.tsx b/apps/scoutgameadmin/components/common/StickyFooter.tsx
deleted file mode 100644
index 090fc98744..0000000000
--- a/apps/scoutgameadmin/components/common/StickyFooter.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Box } from '@mui/material';
-
-import { Hidden } from 'components/common/Hidden';
-import { SiteNavigation } from 'components/common/SiteNavigation';
-
-export function StickyFooter({ isAuthenticated }: { isAuthenticated?: boolean }) {
- return (
-
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/contract/ContractDashboard.tsx b/apps/scoutgameadmin/components/contract/ContractDashboard.tsx
deleted file mode 100644
index 0496703eac..0000000000
--- a/apps/scoutgameadmin/components/contract/ContractDashboard.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { Tabs, Tab, Box, Container } from '@mui/material';
-import Link from 'next/link';
-
-import { WagmiProvider } from 'components/providers/wagmi/WagmiProvider';
-import type { BuilderNFTContractData } from 'lib/contract/getContractData';
-
-import { ProtocolContract } from './ProtocolContract';
-import { SeasonOneView } from './SeasonOneView';
-
-export function ContractDashboard({
- seasonOne,
- currentTab = 'seasonOne'
-}: {
- seasonOne: BuilderNFTContractData;
- currentTab?: string;
-}) {
- return (
-
-
-
-
-
-
- {currentTab === 'seasonOne' && }
- {currentTab === 'protocol' && (
-
-
-
- )}
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/contract/ProtocolContract.tsx b/apps/scoutgameadmin/components/contract/ProtocolContract.tsx
deleted file mode 100644
index 7e5807c482..0000000000
--- a/apps/scoutgameadmin/components/contract/ProtocolContract.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import 'server-only';
-
-import { aggregateProtocolData } from 'lib/contract/aggregateProtocolData';
-import { getUserFromSession } from 'lib/session/getUserFromSession';
-
-import { ProtocolContractView } from './ProtocolContractView';
-
-export async function ProtocolContract() {
- const user = await getUserFromSession();
- const protocolData = await aggregateProtocolData({ userId: user?.id });
-
- return ;
-}
diff --git a/apps/scoutgameadmin/components/contract/ProtocolContractView.tsx b/apps/scoutgameadmin/components/contract/ProtocolContractView.tsx
deleted file mode 100644
index 8fa569d297..0000000000
--- a/apps/scoutgameadmin/components/contract/ProtocolContractView.tsx
+++ /dev/null
@@ -1,184 +0,0 @@
-import { contributionSchemaDefinition, scoutGameUserProfileSchemaDefinition } from '@charmverse/core/protocol';
-import { Box, Button, Divider, Grid2, IconButton, Typography } from '@mui/material';
-import { ProtocolImplementationClient } from '@packages/scoutgame/protocol/clients/ProtocolImplementationClient';
-import { scoutGameAttestationChain } from '@packages/scoutgameattestations/constants';
-import Link from 'next/link';
-import { MdLaunch } from 'react-icons/md';
-import { useSendTransaction, useWalletClient } from 'wagmi';
-
-import type { ProtocolData } from 'lib/contract/aggregateProtocolData';
-
-function ContractLink({
- address,
- linkType = 'address',
- title,
- subtitle
-}: {
- address: string;
- linkType?: 'address' | 'token' | 'contract';
- title: string;
- subtitle?: string;
-}) {
- return (
-
- {title}
- {subtitle && {subtitle}}
-
- {address}
-
-
-
-
-
- );
-}
-
-function EASSchemaLink({ schemaId, title, subtitle }: { schemaId: string; title: string; subtitle?: string }) {
- return (
-
- {title}
- {subtitle && {subtitle}}
-
- {schemaId}
-
-
-
-
-
- );
-}
-
-function SectionTitle({ title }: { title: string }) {
- return (
-
- {title}
-
- );
-}
-
-function GridDivider() {
- return (
-
-
-
- );
-}
-
-export function ProtocolContractView(data: ProtocolData) {
- const itemSizeTwoColumnMd = { xs: 12, md: 6 };
- const itemSizeThreeColumnMd = { xs: 12, md: 4 };
-
- // const { sendTransactionAsync } = useSendTransaction();
-
- const { data: walletClient } = useWalletClient();
-
- async function claimTokens(claimData: ProtocolData['merkleRoots'][number]) {
- if (!claimData.testClaim || !walletClient) {
- return;
- }
-
- const client = new ProtocolImplementationClient({
- contractAddress: data.proxy,
- walletClient: walletClient as any,
- chain: scoutGameAttestationChain
- });
-
- await client.claim({
- args: {
- week: claimData.week,
- amount: BigInt(claimData.testClaim.claim.amount),
- proofs: claimData.testClaim.proofs
- }
- });
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {data.merkleRoots.map((root) => (
-
- Merkle Root for week {root.week}
- {!root.root && Week not processed}
- {root.root &&
- (root.publishedOnchain ? (
- Published onchain
- ) : (
- Awaiting publication
- ))}
-
- {root.testClaim && (
-
- )}
-
- ))}
-
- {/*
-
-
-
- Upgrade contract
-
-
- */}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/contract/SeasonOneView.tsx b/apps/scoutgameadmin/components/contract/SeasonOneView.tsx
deleted file mode 100644
index 45381957a2..0000000000
--- a/apps/scoutgameadmin/components/contract/SeasonOneView.tsx
+++ /dev/null
@@ -1,144 +0,0 @@
-import { Box, Divider, Grid2, IconButton, Typography } from '@mui/material';
-import Link from 'next/link';
-import { MdLaunch } from 'react-icons/md';
-
-import type { BuilderNFTContractData } from 'lib/contract/getContractData';
-
-function ContractLink({
- address,
- linkType = 'address',
- title,
- subtitle
-}: {
- address: string;
- linkType?: 'address' | 'token' | 'contract';
- title: string;
- subtitle?: string;
-}) {
- return (
-
- {title}
- {subtitle && {subtitle}}
-
- {address}
-
-
-
-
-
- );
-}
-
-function SectionTitle({ title }: { title: string }) {
- return (
-
- {title}
-
- );
-}
-
-function GridDivider() {
- return (
-
-
-
- );
-}
-
-export function SeasonOneView(data: BuilderNFTContractData) {
- const itemSizeTwoColumnMd = { xs: 12, md: 6 };
- const itemSizeThreeColumnMd = { xs: 12, md: 4 };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Registered builder NFTs
-
- {data.totalSupply.toString()}
-
-
-
- {/* Currently, this is the balance of the proceeds receiver wallet. Once we start moving funds, we should look at logs instead */}
- Sales
-
- {Number(data.receiverUsdcBalance).toLocaleString('en-US')} USD
-
-
-
- {/* Currently, this is the balance of the proceeds receiver wallet. Once we start moving funds, we should look at logs instead */}
- Unique NFT holders
-
- {Number(data.nftSalesData.uniqueHolders).toLocaleString('en-US')}
-
-
-
- {/* Currently, this is the balance of the proceeds receiver wallet. Once we start moving funds, we should look at logs instead */}
- Total NFTs minted
-
- {Number(data.nftSalesData.totalNftsSold).toLocaleString('en-US')}
-
-
-
- {/* Currently, this is the balance of the proceeds receiver wallet. Once we start moving funds, we should look at logs instead */}
- NFTs paid with points
-
- {Number(data.nftSalesData.nftsPaidWithPoints).toLocaleString('en-US')}
-
-
-
- {/* Currently, this is the balance of the proceeds receiver wallet. Once we start moving funds, we should look at logs instead */}
- NFTs paid with crypto
-
- {Number(data.nftSalesData.nftsPaidWithCrypto).toLocaleString('en-US')}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/farcaster/FarcasterDashboard.tsx b/apps/scoutgameadmin/components/farcaster/FarcasterDashboard.tsx
deleted file mode 100644
index f80059a727..0000000000
--- a/apps/scoutgameadmin/components/farcaster/FarcasterDashboard.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-'use client';
-
-import { Add as AddIcon, Clear as ClearIcon } from '@mui/icons-material';
-import { LoadingButton } from '@mui/lab';
-import { CircularProgress, Container, Paper, Stack, TextField, Box, Typography } from '@mui/material';
-import { useAction } from 'next-safe-action/hooks';
-import React, { useState, useMemo } from 'react';
-import { useForm } from 'react-hook-form';
-
-import { useSearchUsers } from 'hooks/api/users';
-import { useDebouncedValue } from 'hooks/useDebouncedValue';
-import type { SuccessResponse, APIErrorResponse, InvalidInputResponse } from 'lib/farcaster/sendMessagesAction';
-import { sendMessagesAction } from 'lib/farcaster/sendMessagesAction';
-import type { SortField, SortOrder } from 'lib/users/getUsers';
-
-type FarcasterFormInputs = {
- messageContent: string;
- recipients: string;
-};
-
-export function FarcasterDashboard() {
- const {
- register,
- reset,
- handleSubmit,
- formState: { errors }
- } = useForm();
-
- const { executeAsync: sendMessages, hasErrored, isExecuting: isSending, result } = useAction(sendMessagesAction);
-
- const onSubmit = async (data: FarcasterFormInputs) => {
- // Handle form submission
- const recipients = data.recipients
- .split(/[\s,]+/)
- .map((recipient) => recipient.trim())
- .filter(Boolean);
- await sendMessages({ message: data.messageContent, recipients });
- };
- return (
-
-
- Farcaster Bulk Message Sender
-
-
-
- Send a message from Chris's Farcaster account
-
-
-
-
- {isAPIErrorResponse(result.data) && (
-
-
- {result.data.sentRecipients.length} messages were successfully sent. The following recipients failed:
-
-
-
- )}
-
-
-
- );
-}
-
-export function isSuccessResponse(response: any): response is SuccessResponse {
- return response?.type === 'success';
-}
-
-export function isInvalidInputResponse(response: any): response is InvalidInputResponse {
- return response?.type === 'invalid_input';
-}
-
-export function isAPIErrorResponse(response: any): response is APIErrorResponse {
- return response?.type === 'warpcast_error';
-}
diff --git a/apps/scoutgameadmin/components/login/LoginPage.tsx b/apps/scoutgameadmin/components/login/LoginPage.tsx
deleted file mode 100644
index 3abc9b110e..0000000000
--- a/apps/scoutgameadmin/components/login/LoginPage.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Box, Typography } from '@mui/material';
-import Image from 'next/image';
-
-import { SinglePageLayout } from './components/SinglePageLayout';
-import { WarpcastLogin } from './components/WarpcastLogin/WarpcastLogin';
-
-export function LoginPage() {
- return (
-
-
- Admin Access
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/login/components/InfoBackgroundImage.tsx b/apps/scoutgameadmin/components/login/components/InfoBackgroundImage.tsx
deleted file mode 100644
index 5727009e62..0000000000
--- a/apps/scoutgameadmin/components/login/components/InfoBackgroundImage.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import type { BoxProps } from '@mui/material/Box';
-import Box from '@mui/material/Box';
-
-export function InfoBackgroundImage(props: BoxProps) {
- return (
-
- );
-}
diff --git a/apps/scoutgameadmin/components/login/components/SinglePageLayout.tsx b/apps/scoutgameadmin/components/login/components/SinglePageLayout.tsx
deleted file mode 100644
index 6150ac9d2a..0000000000
--- a/apps/scoutgameadmin/components/login/components/SinglePageLayout.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import type { BoxProps } from '@mui/material';
-import { Box } from '@mui/material';
-
-export function SinglePageLayout({ children, ...props }: BoxProps) {
- return (
-
- {children}
-
- );
-}
diff --git a/apps/scoutgameadmin/components/login/components/WarpcastLogin/FarcasterModal.tsx b/apps/scoutgameadmin/components/login/components/WarpcastLogin/FarcasterModal.tsx
deleted file mode 100644
index eaf4e921fe..0000000000
--- a/apps/scoutgameadmin/components/login/components/WarpcastLogin/FarcasterModal.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-'use client';
-
-import { CanvasQRCode } from '@connect-shared/components/common/CanvasQrCode';
-import PhoneAndroidIcon from '@mui/icons-material/PhoneAndroid';
-import { Paper } from '@mui/material';
-import Box from '@mui/material/Box';
-import Link from '@mui/material/Link';
-import type { ModalProps } from '@mui/material/Modal';
-import Modal from '@mui/material/Modal';
-import Typography from '@mui/material/Typography';
-
-const sx = {
- position: 'absolute' as const,
- top: '50%',
- left: '50%',
- transform: 'translate(-50%, -50%)',
- width: 400,
- bgcolor: 'background.paper',
- p: 4,
- border: 0,
- borderRadius: 3
-};
-
-export function FarcasterLoginModal({ url, ...props }: Omit & { url?: string }) {
- return (
-
-
-
- Sign in with Farcaster
-
-
- Scan with your phone's camera to continue.
-
-
-
-
-
- I'm using my phone →
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastIcon.tsx b/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastIcon.tsx
deleted file mode 100644
index 96a2b2e9ae..0000000000
--- a/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastIcon.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import SvgIcon from '@mui/material/SvgIcon';
-
-export function WarpcastIcon() {
- return (
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastLogin.tsx b/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastLogin.tsx
deleted file mode 100644
index c291bbdeb9..0000000000
--- a/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastLogin.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-'use client';
-
-import { AuthKitProvider } from '@farcaster/auth-kit';
-import { authConfig } from '@packages/farcaster/config';
-
-import { WarpcastLoginButton } from './WarpcastLoginButton';
-
-export function WarpcastLogin() {
- return (
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastLoginButton.tsx b/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastLoginButton.tsx
deleted file mode 100644
index 6da097897f..0000000000
--- a/apps/scoutgameadmin/components/login/components/WarpcastLogin/WarpcastLoginButton.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-'use client';
-
-import { log } from '@charmverse/core/log';
-import { revalidatePathAction } from '@connect-shared/lib/actions/revalidatePathAction';
-import type { StatusAPIResponse, AuthClientError } from '@farcaster/auth-kit';
-import { LoadingButton } from '@mui/lab';
-import type { ButtonProps } from '@mui/material';
-import { Box, Button, Typography } from '@mui/material';
-import { useFarcasterConnection } from '@packages/farcaster/hooks/useFarcasterConnection';
-import { usePopupState } from 'material-ui-popup-state/hooks';
-import { useRouter, useSearchParams } from 'next/navigation';
-import { useAction } from 'next-safe-action/hooks';
-import { useCallback } from 'react';
-
-import { loginAction } from 'lib/session/loginWithFarcasterAction';
-
-import { FarcasterLoginModal } from './FarcasterModal';
-import { WarpcastIcon } from './WarpcastIcon';
-
-export function WarpcastLoginButton({ children, ...props }: ButtonProps) {
- const popupState = usePopupState({ variant: 'popover', popupId: 'warpcast-login' });
- const router = useRouter();
-
- const { executeAsync: revalidatePath, isExecuting: isRevalidatingPath } = useAction(revalidatePathAction);
-
- const {
- executeAsync: loginUser,
- hasErrored,
- isExecuting: isLoggingIn,
- result
- } = useAction(loginAction, {
- onSuccess: async ({ data }) => {
- const nextPage = '/';
-
- if (!data?.success) {
- return;
- }
-
- await revalidatePath();
- router.push(nextPage);
-
- popupState.close();
- },
- onError(err) {
- log.error('Error on login', { error: err.error.serverError });
- popupState.close();
- }
- });
-
- const onErrorCallback = useCallback((err?: AuthClientError) => {
- if (err?.errCode === 'unavailable') {
- log.warn('Timed out waiting for Warpcast login', { error: err });
- } else {
- log.error('There was an error while logging in with Warpcast', { error: err });
- }
- popupState.close();
- }, []);
-
- const onSuccessCallback = useCallback(async (res: StatusAPIResponse) => {
- if (res.message && res.signature) {
- await loginUser({ message: res.message!, nonce: res.nonce, signature: res.signature });
- } else {
- log.error('Did not receive message or signature from Farcaster', res);
- }
- }, []);
-
- const onClick = useCallback(() => {
- popupState.open();
- }, []);
-
- const { signIn, url } = useFarcasterConnection({
- onSuccess: onSuccessCallback,
- onError: onErrorCallback,
- onClick
- });
-
- return (
-
- }
- {...props}
- >
- {children || 'Sign in with Warpcast'}
-
- {hasErrored && (
-
- {result?.serverError?.message}
-
- )}
- popupState.close()} url={url} />
-
- );
-}
diff --git a/apps/scoutgameadmin/components/providers/wagmi/WagmiProvider.tsx b/apps/scoutgameadmin/components/providers/wagmi/WagmiProvider.tsx
deleted file mode 100644
index 318686b2b6..0000000000
--- a/apps/scoutgameadmin/components/providers/wagmi/WagmiProvider.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-'use client';
-
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import { useState } from 'react';
-import { WagmiProvider as OriginalWagmiProvider, cookieToInitialState } from 'wagmi';
-
-import { getConfig } from './wagmiConfig';
-
-// Use this provider for SSR https://wagmi.sh/react/guides/ssr, if we need it
-export function WagmiProvider({
- children,
- cookie,
- walletConnectProjectId
-}: {
- children: React.ReactNode;
- cookie?: string;
- walletConnectProjectId?: string;
-}) {
- const [config] = useState(() => getConfig({ projectId: walletConnectProjectId || '' }));
- const [queryClient] = useState(() => new QueryClient());
- const initialState = cookieToInitialState(config, cookie);
-
- return (
-
- {children}
-
- );
-}
diff --git a/apps/scoutgameadmin/components/providers/wagmi/wagmiConfig.ts b/apps/scoutgameadmin/components/providers/wagmi/wagmiConfig.ts
deleted file mode 100644
index ebfe1ab9a2..0000000000
--- a/apps/scoutgameadmin/components/providers/wagmi/wagmiConfig.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-'use client';
-
-import env from '@beam-australia/react-env';
-import { getDefaultConfig } from '@rainbow-me/rainbowkit';
-import { getAlchemyBaseUrl } from '@root/lib/blockchain/provider/alchemy/client';
-import type { Chain, Transport } from 'viem';
-import { http, cookieStorage, createStorage, fallback } from 'wagmi';
-import {
- arbitrum,
- arbitrumSepolia,
- mainnet,
- optimism,
- optimismSepolia,
- sepolia,
- zora,
- zoraSepolia,
- base,
- baseSepolia
-} from 'wagmi/chains';
-
-export function getConfig(options?: Partial[0]>) {
- const projectId = options?.projectId || env('WALLETCONNECT_PROJECTID') || '';
-
- const wagmiChains = [
- mainnet,
- sepolia,
- base,
- baseSepolia,
- optimism,
- optimismSepolia,
- arbitrum,
- arbitrumSepolia,
- zora,
- zoraSepolia
- ] as [Chain, ...Chain[]];
- const transports = wagmiChains.reduce>((acc, chain) => {
- try {
- const rpcUrl = getAlchemyBaseUrl(chain.id);
- acc[chain.id] = fallback([http(rpcUrl), http()]);
- return acc;
- } catch (_) {
- acc[chain.id] = http();
- return acc;
- }
- }, {});
-
- const config = getDefaultConfig({
- appName: 'Scout Game',
- projectId,
- chains: wagmiChains,
- ssr: true,
- storage: createStorage({ storage: cookieStorage }),
- transports
- });
-
- return config;
-}
diff --git a/apps/scoutgameadmin/components/repos/ReposDashboard.tsx b/apps/scoutgameadmin/components/repos/ReposDashboard.tsx
deleted file mode 100644
index 8d2c2a3eaa..0000000000
--- a/apps/scoutgameadmin/components/repos/ReposDashboard.tsx
+++ /dev/null
@@ -1,217 +0,0 @@
-'use client';
-
-import { log } from '@charmverse/core/log';
-import { Clear as ClearIcon } from '@mui/icons-material';
-import {
- Stack,
- CircularProgress,
- Container,
- InputAdornment,
- Link,
- Paper,
- Table,
- TableBody,
- TableCell,
- TableContainer,
- TableHead,
- TableRow,
- TextField,
- IconButton,
- TableSortLabel
-} from '@mui/material';
-import type { BonusPartner } from '@packages/scoutgame/bonus';
-import { bonusPartnersRecord } from '@packages/scoutgame/bonus';
-import Image from 'next/image';
-import React, { useState, useMemo } from 'react';
-
-import { useSearchRepos } from 'hooks/api/repos';
-import { useDebouncedValue } from 'hooks/useDebouncedValue';
-import { revalidatePathAction } from 'lib/actions/revalidatePathAction';
-import type { Repo } from 'lib/repos/getRepos';
-
-import { HeaderActions } from './components/HeaderActions';
-import { RepoActionButton } from './components/RepoActions/RepoActionButton';
-
-type SortField = 'commits' | 'prs' | 'closedPrs' | 'contributors' | 'owner' | 'createdAt' | 'bonusPartner';
-type SortOrder = 'asc' | 'desc';
-
-export function ReposDashboard({ repos }: { repos: Repo[] }) {
- const [filterString, setFilter] = useState('');
- const [sortField, setSortField] = useState('createdAt');
- const [sortOrder, setSortOrder] = useState('desc');
-
- const debouncedFilterString = useDebouncedValue(filterString);
- const { data: filteredRepos, mutate, isValidating, isLoading } = useSearchRepos(debouncedFilterString);
- const showFilteredResults = Boolean(debouncedFilterString || filteredRepos || isValidating || isLoading);
-
- const filteredAndSortedRepos = useMemo(() => {
- if (showFilteredResults) {
- return filteredRepos || [];
- }
- return repos.sort((a, b) => {
- if (!a[sortField]) return sortOrder === 'asc' ? -1 : 1;
- if (!b[sortField]) return sortOrder === 'asc' ? 1 : -1;
- if (a[sortField]! < b[sortField]!) return sortOrder === 'asc' ? -1 : 1;
- if (a[sortField]! > b[sortField]!) return sortOrder === 'asc' ? 1 : -1;
- // sort by name as a secondary sort if the field is the same
- if (a[sortField] === b[sortField]) return a.name.localeCompare(b.name);
- return 0;
- });
- }, [repos, filteredRepos, showFilteredResults, sortField, sortOrder]);
-
- const handleSort = (field: SortField) => {
- if (field === sortField) {
- setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');
- } else {
- setSortField(field);
- setSortOrder('desc');
- }
- };
-
- function refreshData() {
- if (filterString) {
- mutate();
- } else {
- revalidatePathAction();
- }
- }
-
- return (
-
-
- setFilter(e.target.value)}
- size='small'
- slotProps={{
- input: {
- endAdornment: (
-
- {(isLoading || isValidating) && }
- {filterString && (
- setFilter('')} edge='end'>
-
-
- )}
-
- )
- }
- }}
- />
-
-
-
-
-
-
-
- handleSort('owner')}
- >
- Owner
-
-
- Name
-
- handleSort('commits')}
- >
- Commits
-
-
-
- handleSort('prs')}
- >
- Merged PRs
-
-
-
- handleSort('closedPrs')}
- >
- Closed PRs
-
-
-
- handleSort('contributors')}
- >
- Contributors
-
-
-
- handleSort('bonusPartner')}
- >
- Bonus Partner
-
-
- {/** Actions */}
-
-
-
- {filteredAndSortedRepos.map((repo) => (
-
-
-
- {repo.owner}
-
-
-
-
- {repo.name}
-
-
- {repo.commits}
- {repo.prs}
- {repo.closedPrs}
- {repo.contributors}
-
- {repo.bonusPartner ? : ''}
-
-
- {
- refreshData();
- }}
- />
-
-
- ))}
-
-
-
-
- );
-}
-
-function BonusPartnersDisplay({ bonusPartner, size = 20 }: { bonusPartner: string; size?: number }) {
- const info = bonusPartnersRecord[bonusPartner as BonusPartner];
- if (!info) {
- log.warn(`No bonus partner info found for ${bonusPartner}`);
- return bonusPartner;
- }
- return (
-
-
- {info.name}
-
- );
-}
diff --git a/apps/scoutgameadmin/components/repos/components/AddRepoButton/AddRepoButton.tsx b/apps/scoutgameadmin/components/repos/components/AddRepoButton/AddRepoButton.tsx
deleted file mode 100644
index 912f3d1843..0000000000
--- a/apps/scoutgameadmin/components/repos/components/AddRepoButton/AddRepoButton.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-'use client';
-
-import { Button } from '@mui/material';
-import type { ButtonProps } from '@mui/material';
-import { useState } from 'react';
-import type { ReactNode } from 'react';
-
-import { AddRepoModal } from './AddRepoModal';
-
-export function AddRepoButton({
- children,
- ...props
-}: {
- children: ReactNode;
-} & ButtonProps) {
- const [isModalOpen, setIsModalOpen] = useState(false);
- return (
- <>
-
- setIsModalOpen(false)} onAdd={() => {}} />
- >
- );
-}
diff --git a/apps/scoutgameadmin/components/repos/components/AddRepoButton/AddRepoModal.tsx b/apps/scoutgameadmin/components/repos/components/AddRepoButton/AddRepoModal.tsx
deleted file mode 100644
index bb3d534394..0000000000
--- a/apps/scoutgameadmin/components/repos/components/AddRepoButton/AddRepoModal.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import { LoadingButton } from '@mui/lab';
-import {
- Dialog,
- DialogTitle,
- DialogContent,
- DialogActions,
- Button,
- TextField,
- CircularProgress,
- InputAdornment,
- Link,
- Typography,
- Box
-} from '@mui/material';
-import React, { useState } from 'react';
-import { mutate } from 'swr';
-
-import { useSearchReposByOwnerFromGithub } from 'hooks/api/github';
-import { useCreateRepos } from 'hooks/api/repos';
-import { useDebouncedValue } from 'hooks/useDebouncedValue';
-
-type Props = {
- open: boolean;
- onClose: () => void;
- onAdd: () => void;
-};
-
-export function AddRepoModal({ open, onClose, onAdd }: Props) {
- const [repoInput, setRepoInput] = useState('');
- const { trigger: createRepos, isMutating: isImporting } = useCreateRepos();
- const debouncedFilterString = useDebouncedValue(repoInput);
- const {
- data: reposFromGithub,
- error,
- isValidating,
- isLoading
- } = useSearchReposByOwnerFromGithub(debouncedFilterString);
-
- const newRepos = reposFromGithub?.filter((g) => !g.exists) || [];
-
- const handleSubmit = async (e: React.FormEvent) => {
- e.preventDefault();
- await createRepos({ owner: repoInput });
- onAdd();
- onClose();
- setRepoInput('');
- // clear SWR cache
- mutate(
- (key) => true, // which cache keys are updated
- undefined // update cache data to `undefined`
- // { revalidate: false } // do not revalidate
- );
- };
-
- return (
-
- );
-}
diff --git a/apps/scoutgameadmin/components/repos/components/HeaderActions.tsx b/apps/scoutgameadmin/components/repos/components/HeaderActions.tsx
deleted file mode 100644
index 5fa9863412..0000000000
--- a/apps/scoutgameadmin/components/repos/components/HeaderActions.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-'use client';
-
-import { ArrowDropDown as ArrowDropDownIcon, Add as AddIcon } from '@mui/icons-material';
-import { Box, Divider, Menu, MenuItem, Stack, Button } from '@mui/material';
-import { getLastWeek, getWeekStartEndFormatted, getDateFromISOWeek } from '@packages/scoutgame/dates';
-import React, { useState } from 'react';
-
-import { FileDownloadButton } from 'components/common/FileDownloadButton';
-import { MenuItemNoAction } from 'components/common/MenuItemNoAction';
-
-import { AddRepoButton } from './AddRepoButton/AddRepoButton';
-
-export function HeaderActions() {
- const [anchorEl, setAnchorEl] = useState(null);
- function closeMenu() {
- setAnchorEl(null);
- }
- const lastWeek = getWeekStartEndFormatted(getDateFromISOWeek(getLastWeek()).toJSDate());
- return (
-
- }>
- Add
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/repos/components/RepoActions/DeleteRepoMenuItem.tsx b/apps/scoutgameadmin/components/repos/components/RepoActions/DeleteRepoMenuItem.tsx
deleted file mode 100644
index 31d6fb1cd1..0000000000
--- a/apps/scoutgameadmin/components/repos/components/RepoActions/DeleteRepoMenuItem.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { log } from '@charmverse/core/log';
-import { DeleteOutlined as Delete } from '@mui/icons-material';
-import { LoadingButton } from '@mui/lab';
-import {
- Button,
- MenuItem,
- ListItemIcon,
- Dialog,
- Tooltip,
- DialogActions,
- DialogContent,
- DialogContentText,
- DialogTitle
-} from '@mui/material';
-import { useAction } from 'next-safe-action/hooks';
-import { useState } from 'react';
-
-import { deleteRepoAction } from 'lib/repos/deleteRepoAction';
-
-type DeleteRepoButtonProps = {
- repoId: number;
- deletedAt: string | Date | null;
- onDelete: () => void;
-};
-
-export function DeleteRepoMenuItem({ repoId, deletedAt, onDelete }: DeleteRepoButtonProps) {
- const [open, setOpen] = useState(false);
-
- const { executeAsync: deleteRepo, hasErrored, isExecuting: isDeleting } = useAction(deleteRepoAction);
- const handleClickOpen = (e: React.MouseEvent) => {
- e.stopPropagation();
- setOpen(true);
- };
-
- const handleClose = () => {
- setOpen(false);
- };
-
- const handleDelete = async () => {
- try {
- await deleteRepo({ repoId, deleteIt: !deletedAt });
- handleClose();
- onDelete();
- } catch (error) {
- log.error('Failed to delete repo:', error);
- }
- };
-
- return (
- <>
- {deletedAt ? (
-
-
-
- ) : (
-
- )}
-
- >
- );
-}
diff --git a/apps/scoutgameadmin/components/repos/components/RepoActions/RepoActionButton.tsx b/apps/scoutgameadmin/components/repos/components/RepoActions/RepoActionButton.tsx
deleted file mode 100644
index 3bd0ce2b67..0000000000
--- a/apps/scoutgameadmin/components/repos/components/RepoActions/RepoActionButton.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material';
-import type { TypographyProps } from '@mui/material';
-import { Menu, ListItem, Divider, Typography, MenuItem, IconButton } from '@mui/material';
-import { useState } from 'react';
-
-import type { Repo } from 'lib/repos/getRepos';
-
-import { DeleteRepoMenuItem } from './DeleteRepoMenuItem';
-
-export function RepoActionButton({ repo, onChange }: { repo: Repo; onChange: () => void }) {
- const [anchorEl, setAnchorEl] = useState(null);
- const open = Boolean(anchorEl);
-
- const handleClick = (event: React.MouseEvent) => {
- event.stopPropagation();
- setAnchorEl(event.currentTarget);
- };
-
- const handleClose = () => {
- setAnchorEl(null);
- };
-
- return (
- <>
-
-
-
-
- >
- );
-}
diff --git a/apps/scoutgameadmin/components/users/UsersDashboard.tsx b/apps/scoutgameadmin/components/users/UsersDashboard.tsx
deleted file mode 100644
index 6d48327eec..0000000000
--- a/apps/scoutgameadmin/components/users/UsersDashboard.tsx
+++ /dev/null
@@ -1,231 +0,0 @@
-'use client';
-
-import type { BuilderStatus } from '@charmverse/core/prisma';
-import {
- MoreHoriz as MoreHorizIcon,
- ArrowDropDown as ArrowDropDownIcon,
- Add as AddIcon,
- Clear as ClearIcon,
- FilterList as FilterListIcon
-} from '@mui/icons-material';
-import {
- Button,
- CircularProgress,
- Container,
- InputAdornment,
- Link,
- Avatar,
- Paper,
- Stack,
- Table,
- TableBody,
- TableCell,
- TableContainer,
- TableHead,
- TableRow,
- TextField,
- Box,
- IconButton,
- Typography,
- TableSortLabel,
- Select,
- MenuItem,
- ListItemText,
- FormControl,
- InputLabel
-} from '@mui/material';
-import { capitalize } from '@packages/utils/strings';
-import React, { useState, useMemo } from 'react';
-
-import { FileDownloadButton } from 'components/common/FileDownloadButton';
-import { useSearchUsers } from 'hooks/api/users';
-import { useDebouncedValue } from 'hooks/useDebouncedValue';
-import type { SortField, SortOrder, ScoutGameUser } from 'lib/users/getUsers';
-
-import { AddUserButton } from './components/AddUserButton/AddUserButton';
-import { UserActionButton } from './components/UserActions/UserActionButton';
-
-export function UsersDashboard({ users }: { users: ScoutGameUser[] }) {
- const [filterString, setFilter] = useState('');
- const [sortField, setSortField] = useState('createdAt');
- const [sortOrder, setSortOrder] = useState('desc');
- const [builderFilter, setBuilderFilter] = useState(undefined);
- const [anchorEl, setAnchorEl] = useState(null);
-
- const debouncedFilterString = useDebouncedValue(filterString);
- const {
- data: filteredUsers,
- isValidating,
- mutate: refreshUsers,
- isLoading
- } = useSearchUsers({ searchString: debouncedFilterString, sortField, builderStatus: builderFilter, sortOrder });
- const showFilteredResults = Boolean(debouncedFilterString || filteredUsers || isValidating || isLoading);
-
- const filteredAndSortedUsers = useMemo(() => {
- if (showFilteredResults) {
- return filteredUsers || [];
- }
- return users.sort((a, b) => {
- if (!a[sortField] && !b[sortField]) {
- return 0;
- }
- if (!a[sortField]) {
- return sortOrder === 'asc' ? -1 : 1;
- }
- if (!b[sortField]) {
- return sortOrder === 'asc' ? 1 : -1;
- }
- if (a[sortField]! < b[sortField]!) return sortOrder === 'asc' ? -1 : 1;
- if (a[sortField]! > b[sortField]!) return sortOrder === 'asc' ? 1 : -1;
- return 0;
- });
- }, [users, filteredUsers, showFilteredResults, sortField, sortOrder]);
-
- const handleSort = (field: SortField) => {
- if (field === sortField) {
- setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');
- } else {
- setSortField(field);
- setSortOrder('desc');
- }
- };
-
- return (
-
-
-
- setFilter(e.target.value)}
- size='small'
- slotProps={{
- input: {
- endAdornment: (
-
- {(isLoading || isValidating) && filterString && }
- {filterString && (
- setFilter('')} edge='end'>
-
-
- )}
-
- )
- }
- }}
- />
-
- Builder status
-
-
-
-
- }>
- Add
-
-
- Export
-
-
-
-
-
-
-
-
- handleSort('displayName')}
- >
-
- Email
-
- handleSort('nftsPurchased')}
- >
- NFTs Purchased
-
-
-
- handleSort('currentBalance')}
- >
- Points Balance
-
-
-
- handleSort('createdAt')}
- >
- Created At
-
-
-
- handleSort('builderStatus')}
- >
- Builder Status
-
-
- {/** Actions */}
-
-
-
- {filteredAndSortedUsers.map((user) => (
-
-
-
-
- {user.displayName}
-
-
- {user.email}
- {user.nftsPurchased}
- {user.currentBalance}
- {new Date(user.createdAt).toLocaleDateString()}
-
- {user?.builderStatus === 'approved' && Approved}
- {user?.builderStatus === 'rejected' && Rejected}
- {user?.builderStatus === 'banned' && Suspended}
- {user?.builderStatus === 'applied' && Applied}
- {!user?.builderStatus && –}
-
-
-
-
-
- ))}
-
-
-
-
- );
-}
diff --git a/apps/scoutgameadmin/components/users/components/AddUserButton/AddUserButton.tsx b/apps/scoutgameadmin/components/users/components/AddUserButton/AddUserButton.tsx
deleted file mode 100644
index d23aa8b47d..0000000000
--- a/apps/scoutgameadmin/components/users/components/AddUserButton/AddUserButton.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-'use client';
-
-import { Button } from '@mui/material';
-import type { ButtonProps } from '@mui/material';
-import { useState } from 'react';
-import type { ReactNode } from 'react';
-
-import { AddUserModal } from './AddUserModal';
-
-export function AddUserButton({
- children,
- ...props
-}: {
- children: ReactNode;
-} & ButtonProps) {
- const [isModalOpen, setIsModalOpen] = useState(false);
- return (
- <>
-
- setIsModalOpen(false)} onAdd={() => {}} />
- >
- );
-}
diff --git a/apps/scoutgameadmin/components/users/components/AddUserButton/AddUserModal.tsx b/apps/scoutgameadmin/components/users/components/AddUserButton/AddUserModal.tsx
deleted file mode 100644
index f6a1b50a54..0000000000
--- a/apps/scoutgameadmin/components/users/components/AddUserButton/AddUserModal.tsx
+++ /dev/null
@@ -1,206 +0,0 @@
-import { LoadingButton } from '@mui/lab';
-import {
- Dialog,
- DialogTitle,
- DialogContent,
- DialogActions,
- Stack,
- Button,
- TextField,
- CircularProgress,
- InputAdornment,
- Link,
- Typography,
- Box
-} from '@mui/material';
-import React, { useState } from 'react';
-import { mutate } from 'swr';
-
-import { useCreateUser, useSearchForUser } from 'hooks/api/users';
-import { useDebouncedValue } from 'hooks/useDebouncedValue';
-
-type Props = {
- open: boolean;
- onClose: () => void;
- onAdd: () => void;
-};
-
-export function AddUserModal({ open, onClose, onAdd }: Props) {
- const [repoInput, setTextInput] = useState('');
- const { trigger: createUser, isMutating: isCreating } = useCreateUser();
- const debouncedFilterString = useDebouncedValue(repoInput);
- const { data: user, error, isValidating, isLoading } = useSearchForUser(debouncedFilterString);
- const handleSubmit = async (e: React.FormEvent) => {
- e.preventDefault();
- await createUser({ searchString: repoInput });
- onAdd();
- onClose();
- setTextInput('');
- // clear SWR cache
- mutate(
- (key) => true, // which cache keys are updated
- undefined // update cache data to `undefined`
- // { revalidate: false } // do not revalidate
- );
- };
-
- return (
-
- );
-}
diff --git a/apps/scoutgameadmin/components/users/components/UserActions/BuilderReviewModal.tsx b/apps/scoutgameadmin/components/users/components/UserActions/BuilderReviewModal.tsx
deleted file mode 100644
index 964381b236..0000000000
--- a/apps/scoutgameadmin/components/users/components/UserActions/BuilderReviewModal.tsx
+++ /dev/null
@@ -1,259 +0,0 @@
-import { log } from '@charmverse/core/log';
-import { DeleteOutlined as TrashIcon } from '@mui/icons-material';
-import { LoadingButton } from '@mui/lab';
-import {
- Dialog,
- DialogTitle,
- DialogContent,
- Stack,
- Button,
- TextField,
- Tooltip,
- Link,
- Typography,
- IconButton,
- Box
-} from '@mui/material';
-import { fancyTrimWords } from '@packages/utils/strings';
-import { useAction } from 'next-safe-action/hooks';
-import React, { useState } from 'react';
-import { mutate } from 'swr';
-
-import { useGetGithubUserStats, useDeleteGithubUserStrike } from 'hooks/api/github';
-import { useCreateBuilder } from 'hooks/api/users';
-import { useDebouncedValue } from 'hooks/useDebouncedValue';
-import type { ScoutGameUser } from 'lib/users/getUsers';
-import { setBuilderStatusAction } from 'lib/users/updateUserAction';
-
-type Props = {
- open: boolean;
- user: Pick;
- onClose: () => void;
- onSave: () => void;
-};
-export function BuilderReviewModal({ user, open, onClose, onSave }: Props) {
- const [githubLogin, setTextInput] = useState('');
- const { trigger: createUser, error: createBuilderError, isMutating: isCreating } = useCreateBuilder();
- const githubLoginDebounced = useDebouncedValue(githubLogin);
-
- const { execute: setBuilderStatus, isExecuting: isExecutingUpdate } = useAction(setBuilderStatusAction, {
- onSuccess: async () => {
- onClose();
- onSave();
- },
- onError(err) {
- log.error('Error suspending user', { error: err.error.serverError });
- }
- });
-
- const requireGithubLogin = !user.githubLogin;
-
- const githubLoginDisplayed = githubLogin || user.githubLogin;
-
- const { trigger: deleteGithubUserStrike } = useDeleteGithubUserStrike();
- const {
- data: githubUserStats,
- error: githubError,
- mutate: refreshGithubUserStats
- } = useGetGithubUserStats(githubLoginDisplayed);
-
- const isSuspended = user.builderStatus === 'banned';
- const isSuspendedInvalid =
- isSuspended && githubUserStats && githubUserStats.builderStrikes.filter((strike) => !strike.deletedAt).length >= 3;
-
- async function unsuspendBuilder() {
- await setBuilderStatus({ userId: user.id, status: 'approved' });
- }
-
- async function rejectBuilder() {
- await setBuilderStatus({ userId: user.id, status: 'rejected' });
- }
-
- async function handleSubmit(e: React.FormEvent) {
- e.preventDefault();
- if (user.builderStatus === 'banned') {
- await unsuspendBuilder();
- } else {
- await createUser({ userId: user.id, githubLogin });
- setTextInput('');
- }
- onClose();
- onSave();
- // clear SWR cache
- mutate(
- (key) => true, // which cache keys are updated
- undefined // update cache data to `undefined`
- // { revalidate: false } // do not revalidate
- );
- }
-
- async function deleteStrike(strikeId: string) {
- await deleteGithubUserStrike({ strikeId });
- refreshGithubUserStats();
- }
-
- return (
-
- );
-}
diff --git a/apps/scoutgameadmin/components/users/components/UserActions/UserActionButton.tsx b/apps/scoutgameadmin/components/users/components/UserActions/UserActionButton.tsx
deleted file mode 100644
index af3f48c123..0000000000
--- a/apps/scoutgameadmin/components/users/components/UserActions/UserActionButton.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material';
-import type { TypographyProps } from '@mui/material';
-import { Menu, ListItem, Divider, Typography, MenuItem, IconButton } from '@mui/material';
-import { useState } from 'react';
-
-import { MenuItemNoAction } from 'components/common/MenuItemNoAction';
-import type { ScoutGameUser } from 'lib/users/getUsers';
-
-import { BuilderReviewModal } from './BuilderReviewModal';
-import { ViewTransactionsModal } from './ViewTransactionsModal';
-
-export function UserActionButton({ user, onChange }: { user: ScoutGameUser; onChange: () => void }) {
- const [anchorEl, setAnchorEl] = useState(null);
- const [isBuilderModalOpen, setIsBuilderModalOpen] = useState(false);
- const [isTransactionsModalOpen, setIsTransactionsModalOpen] = useState(false);
- const open = Boolean(anchorEl);
-
- const handleClick = (event: React.MouseEvent) => {
- event.stopPropagation();
- setAnchorEl(event.currentTarget);
- };
-
- const handleClose = () => {
- setAnchorEl(null);
- };
-
- return (
- <>
-
-
-
-
- {isBuilderModalOpen && (
- setIsBuilderModalOpen(false)}
- onSave={onChange}
- />
- )}
- setIsTransactionsModalOpen(false)}
- scoutId={user.id}
- />
- >
- );
-}
diff --git a/apps/scoutgameadmin/components/users/components/UserActions/ViewTransactionsModal.tsx b/apps/scoutgameadmin/components/users/components/UserActions/ViewTransactionsModal.tsx
deleted file mode 100644
index 95fd02b473..0000000000
--- a/apps/scoutgameadmin/components/users/components/UserActions/ViewTransactionsModal.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { LoadingButton } from '@mui/lab';
-import {
- Dialog,
- DialogTitle,
- DialogContent,
- DialogActions,
- Stack,
- Button,
- TextField,
- CircularProgress,
- InputAdornment,
- Link,
- Typography,
- Box
-} from '@mui/material';
-import React from 'react';
-
-import { useGetScoutEvents } from 'hooks/api/blockchain';
-
-type Props = {
- open: boolean;
- onClose: () => void;
- scoutId: string;
-};
-
-export function ViewTransactionsModal({ open, onClose, scoutId }: Props) {
- const { data, error, isLoading } = useGetScoutEvents(open ? scoutId : '');
- return (
-
- );
-}
diff --git a/apps/scoutgameadmin/hooks/api/blockchain.ts b/apps/scoutgameadmin/hooks/api/blockchain.ts
deleted file mode 100644
index 488cf00065..0000000000
--- a/apps/scoutgameadmin/hooks/api/blockchain.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { RepoSearchResult } from '../../app/api/github/search-repos/route';
-
-import { useGET } from './helpers';
-
-export function useGetScoutEvents(scoutId: string) {
- return useGET(scoutId ? '/api/blockchain/scout-events' : null, { scoutId });
-}
-
-export function useGetTransactionStatus({ chainId, txHash }: { chainId: string; txHash: string }) {
- return useGET(chainId && txHash ? '/api/blockchain/transaction-status' : null, {
- chainId,
- txHash
- });
-}
diff --git a/apps/scoutgameadmin/hooks/api/github.ts b/apps/scoutgameadmin/hooks/api/github.ts
deleted file mode 100644
index f6b3d88de7..0000000000
--- a/apps/scoutgameadmin/hooks/api/github.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { Repo } from 'lib/repos/getRepos';
-
-import type { RepoSearchResult } from '../../app/api/github/search-repos/route';
-import type { GithubUserStats } from '../../app/api/github/user-stats/route';
-
-import { useGETImmutable, usePOST, useDELETE } from './helpers';
-
-export function useSearchReposByOwnerFromGithub(owner: string) {
- return useGETImmutable(owner ? '/api/github/search-repos' : null, { owner });
-}
-
-export function useGetGithubUserStats(login: string | null) {
- return useGETImmutable(login ? '/api/github/user-stats' : null, { login });
-}
-
-export function useDeleteGithubUserStrike() {
- return useDELETE<{ strikeId: string }>('/api/github/delete-strike');
-}
diff --git a/apps/scoutgameadmin/hooks/api/helpers.ts b/apps/scoutgameadmin/hooks/api/helpers.ts
deleted file mode 100644
index 1fcc77181e..0000000000
--- a/apps/scoutgameadmin/hooks/api/helpers.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import * as http from '@root/adapters/http';
-import type { SWRConfiguration } from 'swr';
-import useSWR from 'swr';
-import useSWRImmutable from 'swr/immutable';
-import useSWRMutation from 'swr/mutation';
-
-export type MaybeString = string | null | undefined;
-
-// eslint-disable-next-line default-param-last
-export function useGET(path: MaybeString, query: any = {}, swrOptions?: SWRConfiguration) {
- const requestUrl = path ? path + getQueryString(query) : null;
- return useSWR(requestUrl, http.GET, swrOptions);
-}
-
-// eslint-disable-next-line default-param-last
-export function useGETImmutable(path: MaybeString, query: any = {}, swrOptions?: SWRConfiguration) {
- const requestUrl = path ? path + getQueryString(query) : null;
- return useSWRImmutable(requestUrl, http.GET, swrOptions);
-}
-
-export function useDELETE(path: string) {
- return useSWRMutation(path, (url: string, { arg }: { arg: any }) => {
- return http.DELETE(url, arg);
- });
-}
-
-export function usePOST(path: string) {
- return useSWRMutation(path, (url: string, { arg }: { arg: any }) => {
- return http.POST(url, arg);
- });
-}
-
-export function usePUT(path: string, options?: { revalidate?: boolean }) {
- return useSWRMutation(
- path,
- (url: string, { arg }: { arg: any }) => {
- return http.PUT(url, arg);
- },
- options
- );
-}
-
-// To be used when you need to trigger a get request on demand
-export function useGETtrigger(path: MaybeString) {
- return useSWRMutation(path || '', (url: string, { arg }: { arg: any }) => {
- const requestUrl = url + getQueryString(arg);
- return http.GET(requestUrl);
- });
-}
-
-type Params = { [key: string]: string | string[] | undefined };
-
-function getQueryString(params: Params = {}) {
- const queryString = Object.keys(params)
- .filter((key) => !!params[key])
- .map((key) => {
- const value = params[key] || '';
- return Array.isArray(value)
- ? `${value.map((v: string) => `${key}[]=${encodeURIComponent(v)}`).join('&')}`
- : `${key}=${encodeURIComponent(value)}`;
- })
- .join('&');
- return queryString ? `?${queryString}` : '';
-}
diff --git a/apps/scoutgameadmin/hooks/api/repos.ts b/apps/scoutgameadmin/hooks/api/repos.ts
deleted file mode 100644
index 54d90cd96c..0000000000
--- a/apps/scoutgameadmin/hooks/api/repos.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { Repo } from 'lib/repos/getRepos';
-
-import { useGETImmutable, usePOST } from './helpers';
-
-export function useSearchRepos(searchString: string) {
- return useGETImmutable(searchString ? '/api/repos' : null, { searchString });
-}
-
-export function useCreateRepos() {
- return usePOST<{ owner: string }>('/api/repos');
-}
diff --git a/apps/scoutgameadmin/hooks/api/users.ts b/apps/scoutgameadmin/hooks/api/users.ts
deleted file mode 100644
index 8d22165a0d..0000000000
--- a/apps/scoutgameadmin/hooks/api/users.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import type { BuilderStatus } from '@charmverse/core/prisma';
-
-import type { CreateBuilderParams } from 'lib/users/createBuilder';
-import type { UserResult } from 'lib/users/getUser';
-import type { ScoutGameUser, SortField, SortOrder } from 'lib/users/getUsers';
-import type { SearchUserResult } from 'lib/users/searchForUser';
-
-import { useGETImmutable, useGET, usePOST } from './helpers';
-
-export function useSearchUsers({
- searchString,
- sortField,
- sortOrder,
- builderStatus
-}: {
- searchString?: string;
- sortField?: SortField;
- sortOrder?: SortOrder;
- builderStatus?: BuilderStatus;
-}) {
- return useGETImmutable(searchString || sortField || builderStatus ? '/api/users' : null, {
- searchString,
- sortField,
- sortOrder,
- builderStatus
- });
-}
-
-export function useSearchForUser(searchString?: string) {
- return useGET(searchString ? '/api/users/search-for-user' : null, { searchString });
-}
-
-export function useGetUser(userId?: string) {
- return useGET(userId ? '/api/users/get-user' : null, { userId });
-}
-
-export function useCreateBuilder() {
- return usePOST('/api/users/create-builder');
-}
-
-export function useCreateUser() {
- return usePOST<{ searchString: string }>('/api/users');
-}
diff --git a/apps/scoutgameadmin/hooks/useDebouncedValue.ts b/apps/scoutgameadmin/hooks/useDebouncedValue.ts
deleted file mode 100644
index 6c1f7fc237..0000000000
--- a/apps/scoutgameadmin/hooks/useDebouncedValue.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { useEffect, useState } from 'react';
-
-export function useDebouncedValue(value: T, delay: number = 200): T {
- const [debouncedValue, setDebouncedValue] = useState(value);
-
- useEffect(() => {
- const timer = setTimeout(() => setDebouncedValue(value), delay || 500);
-
- return () => {
- clearTimeout(timer);
- };
- }, [value, delay]);
-
- return debouncedValue;
-}
diff --git a/apps/scoutgameadmin/hooks/useMediaScreens.ts b/apps/scoutgameadmin/hooks/useMediaScreens.ts
deleted file mode 100644
index f6560df02e..0000000000
--- a/apps/scoutgameadmin/hooks/useMediaScreens.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-'use client';
-
-import type { Theme } from '@mui/material';
-import { useMediaQuery } from '@mui/material';
-
-export function useLgScreen() {
- return useMediaQuery((theme: Theme) => theme.breakpoints.up('lg'));
-}
-
-export function useMdScreen() {
- return useMediaQuery((theme: Theme) => theme.breakpoints.up('md'));
-}
-
-export function useSmScreen() {
- return useMediaQuery((theme: Theme) => theme.breakpoints.up('sm'));
-}
diff --git a/apps/scoutgameadmin/hooks/useProposeContractUpgrade.tsx b/apps/scoutgameadmin/hooks/useProposeContractUpgrade.tsx
deleted file mode 100644
index da7f300329..0000000000
--- a/apps/scoutgameadmin/hooks/useProposeContractUpgrade.tsx
+++ /dev/null
@@ -1,259 +0,0 @@
-// // useProposeSetImplementation.ts
-// import type {} from '@safe-global/api-kit';
-// import { getSafeApiClient } from '@packages/blockchain/getSafeApiClient';
-// import { getScoutProtocolAddress, scoutProtocolChainId } from '@packages/scoutgame/protocol/constants';
-// import SafeApiKit, { ProposeTransactionProps } from '@safe-global/api-kit';
-// import { ethers } from 'ethers';
-// import { useState, useCallback } from 'react';
-// import { encodeFunctionData } from 'viem';
-// import { useAccount } from 'wagmi';
-
-// /**
-// * Hook to propose a transaction to call setImplementation on a contract using Gnosis Safe SDK.
-// *
-// * @param safeAddress - The address of the Gnosis Safe.
-// * @param contractAddress - The address of the contract with the setImplementation method.
-// * @returns An object containing the proposeTransaction function, loading state, and any error.
-// */
-// const useProposeSetImplementation = (safeAddress: string, contractAddress: string) => {
-// const [loading, setLoading] = useState(false);
-// const [error, setError] = useState(null);
-// const { address: account, chain } = useAccount();
-
-// const proposeTransaction = useCallback(
-// async (newImplementationAddress: string) => {
-// setLoading(true);
-// setError(null);
-
-// try {
-// if (!signer) {
-// throw new Error('No signer available');
-// }
-
-// if (!chain) {
-// throw new Error('No network information available');
-// }
-
-// // Initialize ethers provider and signer
-// const provider = new ethers.providers.Web3Provider((window as any).ethereum);
-// const signerAddress = await signer.getAddress();
-
-// // Initialize Safe API Kit
-// const safeApiClient = await getSafeApiClient({ chainId: scoutProtocolChainId });
-
-// // Encode the setImplementation call using viem
-// const data = encodeFunctionData({
-// abi: [
-// {
-// name: 'setImplementation',
-// type: 'function',
-// inputs: [
-// {
-// type: 'address',
-// name: 'newImplementation'
-// }
-// ]
-// }
-// ],
-// functionName: 'setImplementation',
-// args: [newImplementationAddress]
-// });
-
-// // Prepare transaction data
-// const safeTx: SafeTransactionData = {};
-
-// // Create the Safe transaction
-// const safeTransaction = safeApiClient.proposeTransaction({
-// safeTransactionData: {
-// to: getScoutProtocolAddress(),
-// value: '0',
-// data,
-
-// operation: 0 // 0 for CALL, 1 for DELEGATECALL,
-// }
-// });
-
-// // Get the transaction hash for signing
-// const txHash = await apiKit.getTransactionHash(safeTransaction);
-
-// // Sign the transaction hash using the signer
-// const signature = await signer.signMessage(ethers.utils.arrayify(txHash));
-
-// // Add the signature to the transaction
-// safeTransaction.signatures[safeAddress] = {
-// signer: signerAddress,
-// data: signature
-// };
-
-// // Propose the transaction via Safe API Kit
-// const response = await apiKit.proposeTransaction(safeTransaction);
-
-// if (!response.success) {
-// throw new Error(response.message || 'Failed to propose transaction');
-// }
-
-// console.log('Transaction proposed successfully:', response);
-// } catch (err: any) {
-// console.error('Error proposing transaction:', err);
-// setError(err.message || 'An unknown error occurred');
-// } finally {
-// setLoading(false);
-// }
-// },
-// [signer, chain, safeAddress, contractAddress]
-// );
-
-// return { proposeTransaction, loading, error };
-// };
-
-// /**
-// * Helper function to get the Safe Transaction Service URL based on chain ID.
-// *
-// * @param chainId - The ID of the Ethereum chain.
-// * @returns The URL of the Safe Transaction Service.
-// */
-// const getTxServiceUrl = (chainId: number): string => {
-// switch (chainId) {
-// case 1:
-// return 'https://safe-transaction.gnosis.io/';
-// case 5:
-// return 'https://safe-transaction-goerli.safe.global/';
-// case 137:
-// return 'https://safe-transaction-mainnet.safe.global/';
-// // Add other chains as needed
-// default:
-// throw new Error(`Unsupported chain ID: ${chainId}`);
-// }
-// };
-
-// export default useProposeSetImplementation;
-
-// // useProposeSetImplementation.ts
-// import type {} from '@safe-global/api-kit';
-// import { getSafeApiClient } from '@packages/blockchain/getSafeApiClient';
-// import { getScoutProtocolAddress, scoutProtocolChainId } from '@packages/scoutgame/protocol/constants';
-// import SafeApiKit, { ProposeTransactionProps } from '@safe-global/api-kit';
-// import { ethers } from 'ethers';
-// import { useState, useCallback } from 'react';
-// import { encodeFunctionData } from 'viem';
-// import { useAccount } from 'wagmi';
-
-// /**
-// * Hook to propose a transaction to call setImplementation on a contract using Gnosis Safe SDK.
-// *
-// * @param safeAddress - The address of the Gnosis Safe.
-// * @param contractAddress - The address of the contract with the setImplementation method.
-// * @returns An object containing the proposeTransaction function, loading state, and any error.
-// */
-// const useProposeSetImplementation = (safeAddress: string, contractAddress: string) => {
-// const [loading, setLoading] = useState(false);
-// const [error, setError] = useState(null);
-// const { address: account, chain } = useAccount();
-
-// const proposeTransaction = useCallback(
-// async (newImplementationAddress: string) => {
-// setLoading(true);
-// setError(null);
-
-// try {
-// if (!signer) {
-// throw new Error('No signer available');
-// }
-
-// if (!chain) {
-// throw new Error('No network information available');
-// }
-
-// // Initialize ethers provider and signer
-// const provider = new ethers.providers.Web3Provider((window as any).ethereum);
-// const signerAddress = await signer.getAddress();
-
-// // Initialize Safe API Kit
-// const safeApiClient = await getSafeApiClient({ chainId: scoutProtocolChainId });
-
-// // Encode the setImplementation call using viem
-// const data = encodeFunctionData({
-// abi: [
-// {
-// name: 'setImplementation',
-// type: 'function',
-// inputs: [
-// {
-// type: 'address',
-// name: 'newImplementation'
-// }
-// ]
-// }
-// ],
-// functionName: 'setImplementation',
-// args: [newImplementationAddress]
-// });
-
-// // Prepare transaction data
-// const safeTx: SafeTransactionData = {};
-
-// // Create the Safe transaction
-// const safeTransaction = safeApiClient.proposeTransaction({
-// safeTransactionData: {
-// to: getScoutProtocolAddress(),
-// value: '0',
-// data,
-
-// operation: 0 // 0 for CALL, 1 for DELEGATECALL,
-// }
-// });
-
-// // Get the transaction hash for signing
-// const txHash = await apiKit.getTransactionHash(safeTransaction);
-
-// // Sign the transaction hash using the signer
-// const signature = await signer.signMessage(ethers.utils.arrayify(txHash));
-
-// // Add the signature to the transaction
-// safeTransaction.signatures[safeAddress] = {
-// signer: signerAddress,
-// data: signature
-// };
-
-// // Propose the transaction via Safe API Kit
-// const response = await apiKit.proposeTransaction(safeTransaction);
-
-// if (!response.success) {
-// throw new Error(response.message || 'Failed to propose transaction');
-// }
-
-// console.log('Transaction proposed successfully:', response);
-// } catch (err: any) {
-// console.error('Error proposing transaction:', err);
-// setError(err.message || 'An unknown error occurred');
-// } finally {
-// setLoading(false);
-// }
-// },
-// [signer, chain, safeAddress, contractAddress]
-// );
-
-// return { proposeTransaction, loading, error };
-// };
-
-// /**
-// * Helper function to get the Safe Transaction Service URL based on chain ID.
-// *
-// * @param chainId - The ID of the Ethereum chain.
-// * @returns The URL of the Safe Transaction Service.
-// */
-// const getTxServiceUrl = (chainId: number): string => {
-// switch (chainId) {
-// case 1:
-// return 'https://safe-transaction.gnosis.io/';
-// case 5:
-// return 'https://safe-transaction-goerli.safe.global/';
-// case 137:
-// return 'https://safe-transaction-mainnet.safe.global/';
-// // Add other chains as needed
-// default:
-// throw new Error(`Unsupported chain ID: ${chainId}`);
-// }
-// };
-
-// export default useProposeSetImplementation;
diff --git a/apps/scoutgameadmin/jest.config.ts b/apps/scoutgameadmin/jest.config.ts
deleted file mode 100644
index 37fb4280a9..0000000000
--- a/apps/scoutgameadmin/jest.config.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import path from 'path';
-
-import { compilerOptions } from './tsconfig.json';
-
-export default {
- // Teardown function after all tests run
- globalTeardown: path.resolve(__dirname, '../../packages/scoutgame/src/testing/jest.teardown.ts'),
-
- transform: {
- '^.+\\.(t|j)sx?$': [
- '@swc/jest',
- {
- jsc: { baseUrl: '.', paths: compilerOptions.paths }
- }
- ]
- },
- extensionsToTreatAsEsm: ['.ts', '.tsx'],
- modulePathIgnorePatterns: ['__e2e__']
-};
diff --git a/apps/scoutgameadmin/lib/actions/actionClient.ts b/apps/scoutgameadmin/lib/actions/actionClient.ts
deleted file mode 100644
index 99f2928632..0000000000
--- a/apps/scoutgameadmin/lib/actions/actionClient.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { UnauthorisedActionError } from '@charmverse/core/errors';
-import { prisma } from '@charmverse/core/prisma-client';
-import { actionClientBase } from '@connect-shared/lib/actions/actionClient';
-import { headers } from 'next/headers';
-
-import { getSession } from 'lib/session/getSession';
-
-export const actionClient = actionClientBase.use(async ({ next }) => {
- const session = await getSession();
- const headerList = headers();
-
- return next({
- ctx: { session, headers: headerList }
- });
-});
-
-export const authActionClient = actionClient.use(async ({ next }) => {
- const session = await getSession();
- const headerList = headers();
-
- const adminId = session.adminId;
-
- if (!adminId) {
- throw new UnauthorisedActionError('You are not logged in. Please try to login');
- }
- await prisma.scout.findUniqueOrThrow({
- where: { id: adminId },
- select: { id: true }
- });
-
- return next({
- ctx: { session, headers: headerList }
- });
-});
diff --git a/apps/scoutgameadmin/lib/actions/revalidatePathAction.ts b/apps/scoutgameadmin/lib/actions/revalidatePathAction.ts
deleted file mode 100644
index 4305a330ef..0000000000
--- a/apps/scoutgameadmin/lib/actions/revalidatePathAction.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-'use server';
-
-import { revalidatePath } from 'next/cache';
-
-import { actionClient } from './actionClient';
-
-/**
- * Revalidates the main layout data.
- */
-export const revalidatePathAction = actionClient.metadata({ actionName: 'revalidatePath' }).action(async () => {
- revalidatePath('/', 'layout');
-});
diff --git a/apps/scoutgameadmin/lib/contract/aggregateNftSalesData.ts b/apps/scoutgameadmin/lib/contract/aggregateNftSalesData.ts
deleted file mode 100644
index 88822cb7df..0000000000
--- a/apps/scoutgameadmin/lib/contract/aggregateNftSalesData.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-
-export type NftSalesData = {
- totalNftsSold: number;
- nftsPaidWithPoints: number;
- nftsPaidWithCrypto: number;
- uniqueHolders: number;
- mintEvents: number;
-};
-
-export async function aggregateNftSalesData(): Promise {
- const nftsPaidWithPoints = await prisma.nFTPurchaseEvent
- .aggregate({
- where: {
- paidInPoints: true
- },
- _sum: {
- tokensPurchased: true
- }
- })
- .then((data) => data._sum.tokensPurchased || 0);
-
- const nftsPaidWithCrypto = await prisma.nFTPurchaseEvent
- .aggregate({
- where: {
- paidInPoints: {
- not: true
- }
- },
- _sum: {
- tokensPurchased: true
- }
- })
- .then((data) => data._sum.tokensPurchased || 0);
-
- const uniqueScoutIds = await prisma.nFTPurchaseEvent
- .findMany({
- distinct: ['scoutId'],
- select: {
- scoutId: true
- }
- })
- .then((data) => ({ _count: { scoutId: data.length } }));
-
- const mintEvents = await prisma.nFTPurchaseEvent.count();
-
- return {
- totalNftsSold: nftsPaidWithPoints + nftsPaidWithCrypto,
- nftsPaidWithCrypto,
- nftsPaidWithPoints,
- uniqueHolders: uniqueScoutIds._count.scoutId,
- mintEvents
- };
-}
diff --git a/apps/scoutgameadmin/lib/contract/aggregateProtocolData.ts b/apps/scoutgameadmin/lib/contract/aggregateProtocolData.ts
deleted file mode 100644
index 4b11041342..0000000000
--- a/apps/scoutgameadmin/lib/contract/aggregateProtocolData.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import type { ProvableClaim } from '@charmverse/core/protocol';
-import { getAllISOWeeksFromSeasonStart } from '@packages/scoutgame/dates';
-import {
- protocolImplementationReadonlyApiClient,
- protocolProxyReadonlyApiClient
-} from '@packages/scoutgame/protocol/clients/protocolReadClients';
-import { getScoutProtocolAddress } from '@packages/scoutgame/protocol/constants';
-import type { WeeklyClaimsTyped } from '@packages/scoutgame/protocol/generateWeeklyClaims';
-import {
- scoutGameContributionReceiptSchemaUid,
- scoutGameUserProfileSchemaUid
-} from '@packages/scoutgameattestations/constants';
-import type { Address } from 'viem';
-
-type MerkleRoot = {
- week: string;
- publishedOnchain: boolean;
- root: string | null;
- testClaim?: {
- claim: ProvableClaim;
- proofs: any[];
- };
-};
-
-export type ProtocolData = {
- admin: Address;
- proxy: Address;
- implementation: Address;
- claimsManager: Address;
- merkleRoots: MerkleRoot[];
- easSchemas: {
- profile: string;
- contributions: string;
- };
-};
-
-export async function aggregateProtocolData({ userId }: { userId?: string }): Promise {
- if (!getScoutProtocolAddress()) {
- throw new Error('REACT_APP_SCOUTPROTOCOL_CONTRACT_ADDRESS is not set');
- }
-
- const [implementation, admin, claimsManager] = await Promise.all([
- protocolProxyReadonlyApiClient.implementation(),
- protocolProxyReadonlyApiClient.admin(),
- protocolProxyReadonlyApiClient.claimsManager()
- ]);
-
- const weeks = getAllISOWeeksFromSeasonStart();
-
- const weeklyClaims = await prisma.weeklyClaims.findMany({
- where: {
- week: {
- in: weeks
- }
- }
- });
-
- const merkleRoots = await Promise.all(
- weeks.map((week) =>
- protocolImplementationReadonlyApiClient
- .getMerkleRoot({ args: { week } })
- .then((root) => {
- const returnValue: MerkleRoot = { week, root, publishedOnchain: true };
-
- const weekFromDb = weeklyClaims.find((claim) => claim.week === week) as WeeklyClaimsTyped;
-
- if (userId && weekFromDb) {
- const userClaim = weekFromDb.claims.leavesWithUserId.find((_claim) => _claim.userId === userId);
-
- const proofs = weekFromDb.proofsMap[userId];
-
- if (userClaim && proofs) {
- returnValue.testClaim = {
- claim: userClaim,
- proofs
- };
- }
- }
-
- return returnValue;
- })
- .catch(() => {
- return {
- week,
- root: weeklyClaims.find((claim) => claim.week === week)?.merkleTreeRoot || null,
- publishedOnchain: false
- } as MerkleRoot;
- })
- )
- );
-
- return {
- merkleRoots,
- admin: admin as Address,
- proxy: getScoutProtocolAddress(),
- implementation: implementation as Address,
- claimsManager: claimsManager as Address,
- easSchemas: {
- contributions: scoutGameContributionReceiptSchemaUid(),
- profile: scoutGameUserProfileSchemaUid()
- }
- };
-}
diff --git a/apps/scoutgameadmin/lib/contract/getContractData.ts b/apps/scoutgameadmin/lib/contract/getContractData.ts
deleted file mode 100644
index d3a51e8588..0000000000
--- a/apps/scoutgameadmin/lib/contract/getContractData.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { getPublicClient } from '@packages/blockchain/getPublicClient';
-import { builderContractReadonlyApiClient } from '@packages/scoutgame/builderNfts/clients/builderContractReadClient';
-import { builderProxyContractReadonlyApiClient } from '@packages/scoutgame/builderNfts/clients/builderProxyContractReadClient';
-import {
- getBuilderContractAddress,
- usdcOptimismMainnetContractAddress
-} from '@packages/scoutgame/builderNfts/constants';
-import { UsdcErc20ABIClient } from '@packages/scoutgame/builderNfts/usdcContractApiClient';
-import type { Address } from 'viem';
-import { optimism } from 'viem/chains';
-
-import { aggregateNftSalesData, type NftSalesData } from './aggregateNftSalesData';
-
-export type BuilderNFTContractData = {
- currentAdmin: Address;
- currentMinter: Address;
- currentImplementation: Address;
- proceedsReceiver: Address;
- totalSupply: bigint;
- contractAddress: Address;
- receiverUsdcBalance: number;
- nftSalesData: NftSalesData;
-};
-
-export async function getContractData(): Promise {
- const [currentAdmin, currentMinter, currentImplementation, proceedsReceiver, totalSupply, nftSalesData] =
- await Promise.all([
- builderProxyContractReadonlyApiClient.admin(),
- builderContractReadonlyApiClient.getMinter(),
- builderProxyContractReadonlyApiClient.implementation(),
- builderProxyContractReadonlyApiClient.getProceedsReceiver(),
- builderContractReadonlyApiClient.totalBuilderTokens(),
- aggregateNftSalesData()
- ]);
-
- const balance = await new UsdcErc20ABIClient({
- chain: optimism,
- publicClient: getPublicClient(optimism.id),
- contractAddress: usdcOptimismMainnetContractAddress
- }).balanceOf({ args: { account: proceedsReceiver } });
-
- return {
- currentAdmin: currentAdmin as Address,
- currentMinter: currentMinter as Address,
- currentImplementation: currentImplementation as Address,
- proceedsReceiver: proceedsReceiver as Address,
- totalSupply,
- contractAddress: getBuilderContractAddress(),
- receiverUsdcBalance: Number(balance / BigInt(1e6)),
- nftSalesData
- };
-}
diff --git a/apps/scoutgameadmin/lib/farcaster/sendMessagesAction.ts b/apps/scoutgameadmin/lib/farcaster/sendMessagesAction.ts
deleted file mode 100644
index 5657bdbc9a..0000000000
--- a/apps/scoutgameadmin/lib/farcaster/sendMessagesAction.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-'use server';
-
-import { log } from '@charmverse/core/log';
-import { getFarcasterUserByUsername } from '@packages/farcaster/getFarcasterUserByUsername';
-import { sendDirectCast } from '@packages/farcaster/warpcast/directCastApi';
-import * as yup from 'yup';
-
-import { authActionClient } from 'lib/actions/actionClient';
-
-export type SuccessResponse = {
- type: 'success';
- sent: number;
-};
-
-export type InvalidInputResponse = {
- type: 'invalid_input';
- invalidRecipients: string[];
-};
-
-export type APIErrorResponse = {
- type: 'warpcast_error';
- sentRecipients: string[];
- unsentRecipients: string[];
- error: string;
-};
-
-export const sendMessagesAction = authActionClient
- .metadata({ actionName: 'delete_repo' })
- .schema(
- yup.object({
- recipients: yup.array().of(yup.string().required()).required(),
- message: yup.string().required()
- })
- )
- .action(async ({ ctx, parsedInput }) => {
- const { recipients, message } = parsedInput;
-
- const invalidRecipients: string[] = [];
- const recipientFids: [string, number][] = [];
-
- for (const recipient of recipients) {
- try {
- const recipientFid = await getFarcasterFid(recipient);
- if (!recipientFid) {
- log.warn(`Could not find Farcaster ID for ${recipient}`);
- invalidRecipients.push(recipient);
- } else {
- recipientFids.push([recipient, recipientFid]);
- }
- } catch (error) {
- log.error(`Error getting Farcaster ID for ${recipient}`, { error });
- invalidRecipients.push(recipient);
- }
- }
- if (invalidRecipients.length > 0) {
- return { type: 'invalid_input', invalidRecipients };
- }
- const sentRecipients: string[] = [];
- const unsentRecipients: string[] = [];
- let sendingError: string | undefined;
- for (const [recipient, recipientFid] of recipientFids) {
- try {
- const result = await sendDirectCast({ recipientFid, message });
- log.info(`Sent message to ${recipientFid}`, { recipientFid, result });
- sentRecipients.push(recipient);
- } catch (error) {
- log.error(`Error sending message to ${recipientFid}`, {
- recipient,
- recipientFid,
- error,
- errors: (error as any).errors
- });
- unsentRecipients.push(recipient);
- sendingError = (error as Error).message || (error as any).errors?.[0]?.message || error;
- }
- }
- if (unsentRecipients.length > 0) {
- return {
- type: 'warpcast_error',
- sentRecipients,
- unsentRecipients,
- error: sendingError
- };
- }
- return { sent: sentRecipients.length, type: 'success' };
- });
-
-async function getFarcasterFid(recipient: string) {
- // if recipient is a number, return it
- if (!Number.isNaN(Number(recipient))) {
- return Number(recipient);
- }
- const user = await getFarcasterUserByUsername(recipient);
- return user?.fid;
-}
diff --git a/apps/scoutgameadmin/lib/nextjs/respondWithTSV.ts b/apps/scoutgameadmin/lib/nextjs/respondWithTSV.ts
deleted file mode 100644
index 2f465e783d..0000000000
--- a/apps/scoutgameadmin/lib/nextjs/respondWithTSV.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { stringify } from 'csv-stringify/sync';
-
-export async function respondWithTSV(rows: any[], filename: string) {
- const exportString = stringify(rows, { header: true, columns: rows[0] ? Object.keys(rows[0]) : ['No Results'] });
-
- return new Response(exportString, {
- status: 200,
- headers: {
- 'Content-Type': 'text/tsv',
- 'Content-Disposition': `attachment; filename=${filename}`
- }
- });
-}
diff --git a/apps/scoutgameadmin/lib/partners/getBuildersForPartner.ts b/apps/scoutgameadmin/lib/partners/getBuildersForPartner.ts
deleted file mode 100644
index a98acde19c..0000000000
--- a/apps/scoutgameadmin/lib/partners/getBuildersForPartner.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import type { BonusPartner } from '@packages/scoutgame/bonus';
-
-export async function getBuildersForPartner({ week, bonusPartner }: { week: string; bonusPartner: BonusPartner }) {
- const events = await prisma.builderEvent.findMany({
- where: {
- githubEvent: {
- repo: {
- bonusPartner
- }
- },
- type: 'merged_pull_request',
- week
- },
- orderBy: {
- createdAt: 'asc'
- },
- select: {
- createdAt: true,
- builder: {
- select: {
- path: true,
- email: true,
- displayName: true
- }
- },
- githubEvent: {
- select: {
- createdAt: true,
- url: true,
- repo: {
- select: {
- name: true,
- owner: true
- }
- }
- }
- }
- }
- });
- return events.map((event) => ({
- 'User Name': event.builder.displayName,
- 'Profile Link': `https://scoutgame.xyz/u/${event.builder.path}`,
- Email: event.builder.email,
- Repo: `${event.githubEvent!.repo.owner}/${event.githubEvent!.repo.name}`,
- Date: event.createdAt.toDateString(),
- Link: event.githubEvent!.url
- }));
-}
diff --git a/apps/scoutgameadmin/lib/repos/deleteRepo.ts b/apps/scoutgameadmin/lib/repos/deleteRepo.ts
deleted file mode 100644
index 7b54715f7b..0000000000
--- a/apps/scoutgameadmin/lib/repos/deleteRepo.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-
-export function deleteRepo({ repoId, deleteIt }: { repoId: number; deleteIt: boolean }) {
- return prisma.githubRepo.update({
- where: { id: repoId },
- data: { deletedAt: deleteIt ? new Date() : null }
- });
-}
diff --git a/apps/scoutgameadmin/lib/repos/deleteRepoAction.ts b/apps/scoutgameadmin/lib/repos/deleteRepoAction.ts
deleted file mode 100644
index a50bbc8c21..0000000000
--- a/apps/scoutgameadmin/lib/repos/deleteRepoAction.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-'use server';
-
-import * as yup from 'yup';
-
-import { authActionClient } from 'lib/actions/actionClient';
-
-import { deleteRepo } from './deleteRepo';
-
-export const deleteRepoAction = authActionClient
- .metadata({ actionName: 'delete_repo' })
- .schema(
- yup.object({
- repoId: yup.number().required(),
- deleteIt: yup.boolean().required()
- })
- )
- .action(async ({ ctx, parsedInput }) => {
- const { repoId, deleteIt } = parsedInput;
- const result = await deleteRepo({ repoId, deleteIt });
- return result;
- });
diff --git a/apps/scoutgameadmin/lib/repos/getRepos.ts b/apps/scoutgameadmin/lib/repos/getRepos.ts
deleted file mode 100644
index 2e8d8d3308..0000000000
--- a/apps/scoutgameadmin/lib/repos/getRepos.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-
-export type Repo = {
- createdAt: string;
- deletedAt: string | null;
- id: number;
- name: string;
- owner: string;
- commits: number;
- prs: number;
- closedPrs: number;
- contributors: number;
- bonusPartner: string | null;
-};
-
-export async function getRepos({ searchString }: { searchString?: string } = {}): Promise {
- if (typeof searchString === 'string' && searchString.length < 2) {
- return [];
- }
- const ownerAndName = typeof searchString === 'string' ? searchString.split('/') : undefined;
-
- const repos = await prisma.githubRepo.findMany({
- take: 500,
- orderBy: ownerAndName
- ? [
- {
- _relevance: {
- fields: ['owner'],
- search: ownerAndName[0],
- sort: 'desc'
- }
- },
- { createdAt: 'desc' },
- { name: 'asc' }
- ]
- : { createdAt: 'desc' },
- where: ownerAndName
- ? {
- owner: {
- contains: ownerAndName[0],
- mode: 'insensitive'
- },
- name: ownerAndName[1] ? { contains: ownerAndName[1], mode: 'insensitive' } : undefined
- }
- : {
- // filter for repos that have activity by default
- OR: [
- {
- events: {
- some: {
- githubUser: {
- builderId: {
- not: null
- }
- }
- }
- }
- },
- {
- bonusPartner: {
- not: null
- }
- }
- ]
- },
- include: {
- events: true
- }
- });
- return repos.map((repo) => ({
- createdAt: repo.createdAt.toISOString(),
- deletedAt: repo.deletedAt?.toISOString() ?? null,
- id: repo.id,
- name: repo.name,
- owner: repo.owner,
- commits: repo.events.filter((event) => event.type === 'commit').length,
- prs: repo.events.filter((event) => event.type === 'merged_pull_request').length,
- closedPrs: repo.events.filter((event) => event.type === 'closed_pull_request').length,
- contributors: new Set(repo.events.map((event) => event.createdBy)).size,
- bonusPartner: repo.bonusPartner
- }));
-}
diff --git a/apps/scoutgameadmin/lib/session/getAdminUser.ts b/apps/scoutgameadmin/lib/session/getAdminUser.ts
deleted file mode 100644
index 3198a694b1..0000000000
--- a/apps/scoutgameadmin/lib/session/getAdminUser.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import { isProdEnv } from '@root/config/constants';
-
-const whitelistedIds: number[] = [472, 4339, 4356, 1212, 318061, 10921, 828888];
-
-export async function getAdminUser({ fid }: { fid: number }) {
- const user = await prisma.scout.findFirstOrThrow({ where: { farcasterId: fid }, select: { id: true } });
- if (!isProdEnv) {
- return user;
- }
- if (whitelistedIds.includes(fid)) {
- return user;
- }
- return null;
-}
diff --git a/apps/scoutgameadmin/lib/session/getSession.ts b/apps/scoutgameadmin/lib/session/getSession.ts
deleted file mode 100644
index 0a1bd9d2f9..0000000000
--- a/apps/scoutgameadmin/lib/session/getSession.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { getSession as rootGetSession } from '@connect-shared/lib/session/getSession';
-
-import type { SessionData } from './interfaces';
-
-export function getSession() {
- return rootGetSession();
-}
diff --git a/apps/scoutgameadmin/lib/session/getUserFromSession.ts b/apps/scoutgameadmin/lib/session/getUserFromSession.ts
deleted file mode 100644
index b2b01297be..0000000000
--- a/apps/scoutgameadmin/lib/session/getUserFromSession.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import type { Scout } from '@charmverse/core/prisma';
-import { prisma } from '@charmverse/core/prisma-client';
-import { replaceS3Domain } from '@root/lib/utils/url';
-
-import { getSession } from './getSession';
-
-export type SessionUser = Pick;
-
-export async function getUserFromSession(): Promise {
- const session = await getSession();
- if (session?.adminId) {
- const user = await prisma.scout.findFirst({
- where: {
- id: session.adminId
- },
- select: {
- id: true,
- path: true,
- displayName: true,
- avatar: true
- }
- });
-
- if (user?.avatar) {
- user.avatar = replaceS3Domain(user.avatar);
- }
- return user;
- }
- return null;
-}
diff --git a/apps/scoutgameadmin/lib/session/interfaces.ts b/apps/scoutgameadmin/lib/session/interfaces.ts
deleted file mode 100644
index e4077445ff..0000000000
--- a/apps/scoutgameadmin/lib/session/interfaces.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import type { IronSession } from 'iron-session';
-import type { headers } from 'next/headers';
-
-export type SessionData = {
- adminId?: string;
-};
-
-export type RequestContext = {
- session: IronSession;
- headers: ReturnType;
-};
diff --git a/apps/scoutgameadmin/lib/session/loginWithFarcasterAction.ts b/apps/scoutgameadmin/lib/session/loginWithFarcasterAction.ts
deleted file mode 100644
index 0a6691da1f..0000000000
--- a/apps/scoutgameadmin/lib/session/loginWithFarcasterAction.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-'use server';
-
-import { authSchema } from '@packages/farcaster/config';
-import { verifyFarcasterUser } from '@packages/farcaster/verifyFarcasterUser';
-
-import { actionClient } from 'lib/actions/actionClient';
-
-import { getAdminUser } from './getAdminUser';
-import { saveSession } from './saveSession';
-
-export const loginAction = actionClient
- .metadata({ actionName: 'login_with_farcaster' })
- .schema(authSchema)
- .action(async ({ ctx, parsedInput }) => {
- const { fid } = await verifyFarcasterUser(parsedInput);
-
- const adminUser = await getAdminUser({ fid });
- if (!adminUser) {
- throw new Error('Sign-in requires admin access');
- }
-
- await saveSession(ctx, { adminId: adminUser.id });
-
- return { success: true, userId: adminUser.id };
- });
diff --git a/apps/scoutgameadmin/lib/session/saveSession.ts b/apps/scoutgameadmin/lib/session/saveSession.ts
deleted file mode 100644
index 42c0d76bf3..0000000000
--- a/apps/scoutgameadmin/lib/session/saveSession.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import type { RequestContext, SessionData } from './interfaces';
-
-export async function saveSession(ctx: RequestContext, session: SessionData) {
- Object.assign(ctx.session, {
- adminId: session.adminId
- });
- await ctx.session.save();
-}
diff --git a/apps/scoutgameadmin/lib/users/__tests__/getUsers.spec.ts b/apps/scoutgameadmin/lib/users/__tests__/getUsers.spec.ts
deleted file mode 100644
index 0f825c47ee..0000000000
--- a/apps/scoutgameadmin/lib/users/__tests__/getUsers.spec.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import { mockScout, mockBuilder } from '@packages/scoutgame/testing/database';
-
-import { getUsers } from '../getUsers';
-
-describe('getUsers', () => {
- it('returns a user when searching by displayName', async () => {
- const mockUser = await mockScout({
- displayName: `test-user-${Math.random().toString(36).substring(2, 15)}`
- });
-
- const result = await getUsers({ searchString: mockUser.displayName });
- expect(result).toHaveLength(1);
- expect(result[0].id).toEqual(mockUser.id);
- });
-
- it('returns a user when searching by partial match of displayName', async () => {
- const testUserPrefix = Math.random().toString(36).substring(2, 15);
- const mockUser = await mockScout({
- displayName: `${testUserPrefix}TestUser`
- });
-
- const result = await getUsers({ searchString: testUserPrefix });
- expect(result).toHaveLength(1);
- expect(result[0].id).toEqual(mockUser.id);
- });
-
- it('returns a user when searching by farcasterName', async () => {
- const mockUser = await mockScout({
- farcasterName: `test-user-${Math.random().toString(36).substring(2, 15)}`
- });
-
- const result = await getUsers({ searchString: mockUser.farcasterName! });
- expect(result).toHaveLength(1);
- expect(result[0].id).toEqual(mockUser.id);
- });
-
- it('returns a user when searching by path', async () => {
- const mockUser = await mockScout({
- path: `test-user-path-${Math.random().toString(36).substring(2, 15)}`
- });
-
- const result = await getUsers({ searchString: mockUser.path });
- expect(result).toHaveLength(1);
- expect(result[0].id).toEqual(mockUser.id);
- });
-
- it('returns a user when searching by github username', async () => {
- const mockUser = await mockBuilder({
- githubUserLogin: `test-user-${Math.random().toString(36).substring(2, 15)}`
- });
-
- const result = await getUsers({ searchString: mockUser.githubUser.login });
- expect(result).toHaveLength(1);
- expect(result[0].id).toEqual(mockUser.id);
- });
-});
diff --git a/apps/scoutgameadmin/lib/users/createBuilder.ts b/apps/scoutgameadmin/lib/users/createBuilder.ts
deleted file mode 100644
index ca0c5ea577..0000000000
--- a/apps/scoutgameadmin/lib/users/createBuilder.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { prisma } from '@charmverse/core/prisma-client';
-import { octokit } from '@packages/github/client';
-import { approveBuilder } from '@packages/scoutgame/builders/approveBuilder';
-
-export type CreateBuilderParams = {
- userId: string;
- githubLogin?: string;
-};
-
-export async function createBuilder(params: CreateBuilderParams) {
- const scout = await prisma.scout.findUniqueOrThrow({
- where: {
- id: params.userId
- },
- include: {
- githubUser: true
- }
- });
- if (!scout.githubUser && !params.githubLogin) {
- throw new Error('Github login is required');
- }
- if (params.githubLogin) {
- const githubUser = await octokit.rest.users.getByUsername({ username: params.githubLogin });
- const githubUserDB = await prisma.githubUser.findUnique({
- where: {
- id: githubUser.data.id
- }
- });
- if (githubUserDB) {
- throw new Error('Github user already exists');
- }
-
- await prisma.githubUser.upsert({
- where: {
- id: githubUser.data.id
- },
- update: {
- builderId: scout.id
- },
- create: {
- id: githubUser.data.id,
- login: params.githubLogin,
- displayName: githubUser.data.name,
- email: githubUser.data.email,
- builderId: scout.id
- }
- });
- }
- await approveBuilder({ builderId: scout.id });
-}
diff --git a/apps/scoutgameadmin/lib/users/createUser.ts b/apps/scoutgameadmin/lib/users/createUser.ts
deleted file mode 100644
index 1502c3771d..0000000000
--- a/apps/scoutgameadmin/lib/users/createUser.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { log } from '@charmverse/core/log';
-import type { Scout } from '@charmverse/core/prisma-client';
-import { prisma } from '@charmverse/core/prisma-client';
-import { getFarcasterUserById } from '@packages/farcaster/getFarcasterUserById';
-import { octokit } from '@packages/github/client';
-import { findOrCreateFarcasterUser } from '@packages/scoutgame/users/findOrCreateFarcasterUser';
-import { randomString } from '@packages/utils/strings';
-
-import type { SearchUserResult } from './searchForUser';
-
-export async function createUser({ scout, waitlistUser, farcasterUser }: SearchUserResult): Promise {
- if (scout) {
- throw new Error('Scout user already exists');
- }
- if (!scout && !waitlistUser && !farcasterUser) {
- throw new Error('No input data provided to create a user');
- }
-
- // convert existing waitlist record to scout
- if (waitlistUser) {
- const githubUser = waitlistUser.githubLogin
- ? await octokit.rest.users.getByUsername({ username: waitlistUser.githubLogin })
- : null;
- const profile = await getFarcasterUserById(waitlistUser.fid);
- if (!profile) {
- throw new Error(`No Farcaster profile found for fid: ${waitlistUser.fid}`);
- }
- const displayName = profile.display_name;
- const username = profile.username;
- const avatarUrl = profile.pfp_url;
- const bio = profile.profile.bio.text;
- const githubUserDB =
- githubUser &&
- (await prisma.githubUser.findUnique({
- where: {
- id: githubUser.data.id
- }
- }));
- return prisma.scout.create({
- data: {
- displayName,
- path: username,
- avatar: avatarUrl,
- bio,
- builderStatus: 'applied',
- farcasterId: waitlistUser.fid,
- farcasterName: username,
- referralCode: randomString(),
- githubUser: githubUserDB
- ? { connect: { id: githubUserDB.id } }
- : githubUser
- ? {
- create: {
- id: githubUser.data.id,
- login: githubUser.data.login,
- displayName: githubUser.data.name,
- email: githubUser.data.email
- }
- }
- : undefined
- }
- });
- } else if (farcasterUser) {
- const result = await findOrCreateFarcasterUser({ fid: farcasterUser.fid });
- const newScout = await prisma.scout.findUniqueOrThrow({
- where: {
- id: result.id
- }
- });
- return newScout;
- }
- throw new Error('Unknown scenario when creating user');
-}
diff --git a/apps/scoutgameadmin/lib/users/getUser.ts b/apps/scoutgameadmin/lib/users/getUser.ts
deleted file mode 100644
index 2ccb8ce73b..0000000000
--- a/apps/scoutgameadmin/lib/users/getUser.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import type { Scout } from '@charmverse/core/prisma-client';
-import { prisma } from '@charmverse/core/prisma-client';
-
-export type UserResult = Scout & { githubLogin?: string };
-
-// find a single user, from scouts or waitlist record. Eventually this doesnt need to search waitlist
-export async function getUser(userId: string): Promise {
- const user = await prisma.scout.findFirst({
- where: {
- id: userId
- },
- include: {
- githubUser: true
- }
- });
- return user ? { ...user, githubLogin: user?.githubUser[0]?.login } : null;
-}
diff --git a/apps/scoutgameadmin/lib/users/getUsers.ts b/apps/scoutgameadmin/lib/users/getUsers.ts
deleted file mode 100644
index f86dee75cf..0000000000
--- a/apps/scoutgameadmin/lib/users/getUsers.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-import type { BuilderStatus, Scout } from '@charmverse/core/prisma-client';
-import { prisma } from '@charmverse/core/prisma-client';
-import { validate } from 'uuid';
-
-export type ScoutGameUser = Pick<
- Scout,
- | 'builderStatus'
- | 'path'
- | 'id'
- | 'avatar'
- | 'displayName'
- | 'createdAt'
- | 'farcasterName'
- | 'currentBalance'
- | 'email'
- | 'farcasterId'
-> & { githubLogin: string | null; nftsPurchased: number; wallets: string[] };
-
-export type SortField = 'displayName' | 'builderStatus' | 'currentBalance' | 'nftsPurchased' | 'createdAt';
-export type SortOrder = 'asc' | 'desc';
-
-export async function getUsers({
- searchString,
- sortField,
- sortOrder,
- builderStatus
-}: {
- searchString?: string;
- sortField?: SortField;
- sortOrder?: SortOrder;
- builderStatus?: BuilderStatus;
-} = {}): Promise {
- if (typeof searchString === 'string' && searchString.length < 2) {
- return [];
- }
- // assume farcaster id if search string is a number
- const userFid = getNumberFromString(searchString);
- const isScoutId = validate(searchString || '');
- const users = await prisma.scout.findMany({
- take: sortField === 'nftsPurchased' ? 1000 : 500, // return more for nft sort since we sort in the frontend
- orderBy:
- !userFid && typeof searchString === 'string'
- ? {
- _relevance: {
- fields: ['path', 'displayName', 'farcasterName', 'email', 'id'],
- search: `*${searchString}:*`,
- sort: 'desc'
- }
- }
- : sortField === 'nftsPurchased'
- ? {
- /* TODO - sort by nfts purchased */
- createdAt: sortOrder || 'desc'
- }
- : sortField
- ? { [sortField]: sortOrder || 'asc' }
- : { createdAt: sortOrder || 'desc' },
- where: userFid
- ? { farcasterId: userFid }
- : isScoutId
- ? { id: searchString }
- : typeof searchString === 'string'
- ? {
- OR: [
- {
- path: {
- search: `*${searchString}:*`,
- mode: 'insensitive'
- }
- },
- {
- displayName: {
- search: `*${searchString}:*`,
- mode: 'insensitive'
- }
- },
- {
- farcasterName: {
- search: `*${searchString}:*`,
- mode: 'insensitive'
- }
- },
- {
- githubUser: {
- some: {
- login: {
- search: `*${searchString}:*`,
- mode: 'insensitive'
- }
- }
- }
- },
- {
- email: {
- startsWith: searchString,
- mode: 'insensitive'
- }
- }
- ]
- }
- : { builderStatus },
- include: {
- githubUser: true,
- userSeasonStats: true,
- scoutWallet: true
- }
- });
- return users.map(({ githubUser, userSeasonStats, scoutWallet, ...user }) => ({
- ...user,
- githubLogin: githubUser[0]?.login || null,
- nftsPurchased: userSeasonStats.find(({ season }) => season === '2024-W41')?.nftsPurchased || 0,
- wallets: scoutWallet.map((wallet) => wallet.address)
- }));
-}
-
-export function getNumberFromString(searchString?: string) {
- const userFidRaw = parseInt(searchString ?? '', 10);
- const isEqualToItself = searchString === userFidRaw.toString(); // uuids like "055f1650-517b-484e-a1c0-c050ef5aae4a" can sometimes return a number, which we don't want
- return Number.isNaN(userFidRaw) || !isEqualToItself ? undefined : userFidRaw;
-}
diff --git a/apps/scoutgameadmin/lib/users/searchForUser.ts b/apps/scoutgameadmin/lib/users/searchForUser.ts
deleted file mode 100644
index 6e27e2e1d3..0000000000
--- a/apps/scoutgameadmin/lib/users/searchForUser.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import type { ConnectWaitlistSlot, Scout } from '@charmverse/core/prisma-client';
-import { prisma } from '@charmverse/core/prisma-client';
-import type { FarcasterUser } from '@root/lib/farcaster/getFarcasterUsers';
-import { getFarcasterUsers } from '@root/lib/farcaster/getFarcasterUsers';
-
-import { getNumberFromString } from './getUsers';
-
-export type SearchUserResult = {
- scout?: Scout & { githubLogin?: string };
- waitlistUser?: ConnectWaitlistSlot;
- farcasterUser?: FarcasterUser;
-};
-
-// find a single user, from scouts or waitlist record. Eventually this doesnt need to search waitlist
-export async function searchForUser({ searchString }: { searchString: string }): Promise {
- if (searchString.length < 2) {
- return null;
- }
- // assume farcaster id if search string is a number
- // look for scout, then waitlist, then farcaster for a profile
- const userFid = getNumberFromString(searchString);
- if (userFid) {
- const scout = await prisma.scout.findUnique({
- where: {
- farcasterId: userFid
- }
- });
- if (scout) {
- return { scout };
- }
- const waitlistUser = await prisma.connectWaitlistSlot.findUnique({
- where: {
- fid: userFid
- }
- });
- if (waitlistUser) {
- return { waitlistUser };
- }
- const farcasterUser = await getFarcasterUsers({ fids: [userFid] });
- if (farcasterUser[0]) {
- return { farcasterUser: farcasterUser[0] };
- }
- }
- // check for scout by path
- const user = await prisma.scout.findUnique({
- where: {
- path: searchString
- },
- include: {
- githubUser: true
- }
- });
- if (user) {
- return { scout: { ...user, githubLogin: user.githubUser[0]?.login } };
- }
- // check for scout by name
- const userByName = await prisma.scout.findFirst({
- where: {
- displayName: {
- equals: searchString,
- mode: 'insensitive'
- }
- },
- include: {
- githubUser: true
- }
- });
- if (userByName) {
- return { scout: { ...userByName, githubLogin: userByName.githubUser[0]?.login } };
- }
- // check for waitlist by github login or farcaster username
- const waitlistUser = await prisma.connectWaitlistSlot.findFirst({
- where: {
- OR: [{ githubLogin: searchString }, { username: searchString }]
- }
- });
- if (waitlistUser) {
- return { waitlistUser };
- }
- const farcasterUsers = await getFarcasterUsers({ username: searchString });
- if (farcasterUsers[0]) {
- return { farcasterUser: farcasterUsers[0] };
- }
-
- return null;
-}
diff --git a/apps/scoutgameadmin/lib/users/updateUser.ts b/apps/scoutgameadmin/lib/users/updateUser.ts
deleted file mode 100644
index 931b2541ff..0000000000
--- a/apps/scoutgameadmin/lib/users/updateUser.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import type { BuilderStatus } from '@charmverse/core/prisma';
-import { prisma } from '@charmverse/core/prisma-client';
-
-export async function setBuilderStatus(userId: string, status: BuilderStatus) {
- return prisma.scout.update({ where: { id: userId }, data: { builderStatus: status } });
-}
diff --git a/apps/scoutgameadmin/lib/users/updateUserAction.ts b/apps/scoutgameadmin/lib/users/updateUserAction.ts
deleted file mode 100644
index ff2a91af80..0000000000
--- a/apps/scoutgameadmin/lib/users/updateUserAction.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-'use server';
-
-import type { BuilderStatus } from '@charmverse/core/prisma';
-import * as yup from 'yup';
-
-import { authActionClient } from 'lib/actions/actionClient';
-
-import { setBuilderStatus } from './updateUser';
-
-export const setBuilderStatusAction = authActionClient
- .metadata({ actionName: 'set_builder_status' })
- .schema(
- yup.object({
- userId: yup.string().required(),
- status: yup.string().required()
- })
- )
- .action(async ({ ctx, parsedInput }) => {
- const { userId, status } = parsedInput;
- const result = await setBuilderStatus(userId, status as BuilderStatus);
- return result;
- });
diff --git a/apps/scoutgameadmin/middleware.ts b/apps/scoutgameadmin/middleware.ts
deleted file mode 100644
index 8e0172794a..0000000000
--- a/apps/scoutgameadmin/middleware.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { getSession } from '@connect-shared/lib/session/getSession';
-import type { NextRequest } from 'next/server';
-import { NextResponse } from 'next/server';
-
-export async function middleware(request: NextRequest) {
- const session = await getSession<{ adminId?: string }>();
- const isLoggedIn = !!session.adminId;
- const path = request.nextUrl.pathname;
-
- if (!isLoggedIn && !path.startsWith('/login')) {
- // eslint-disable-next-line no-console
- console.log(`Redirect user to login from ${path}`);
- return NextResponse.redirect(new URL('/login', request.url));
- } else if (isLoggedIn && path === '/login') {
- // eslint-disable-next-line no-console
- console.log('Redirecting from login to home page', session);
- return NextResponse.redirect(new URL('/home', request.url));
- }
-
- // We don't have a '/' page anymore since we need to handle 2 different layouts
- if (path === '/') {
- return NextResponse.redirect(new URL('/users', request.url));
- }
-
- return NextResponse.next();
-}
-
-export const config = {
- matcher: [
- /*
- * Match all request paths except for the ones starting with:
- * - api (API routes)
- * - _next/static (static files)
- * - _next/image (image optimization files)
- * - images (image files)
- * - favicon.ico (favicon file)
- */
- '/((?!api|_next/static|_next/image|images|favicon.ico|robots.txt|__ENV.js|manifest.webmanifest|nft-assets).*)'
- ]
-};
diff --git a/apps/scoutgameadmin/next-env.d.ts b/apps/scoutgameadmin/next-env.d.ts
deleted file mode 100644
index 40c3d68096..0000000000
--- a/apps/scoutgameadmin/next-env.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-///
-///
-
-// NOTE: This file should not be edited
-// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
diff --git a/apps/scoutgameadmin/next.config.mjs b/apps/scoutgameadmin/next.config.mjs
deleted file mode 100644
index 42565f8aec..0000000000
--- a/apps/scoutgameadmin/next.config.mjs
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @type {import('next').NextConfig} */
-
-const nextConfig = {
- // types are tested separately from the build
- eslint: {
- ignoreDuringBuilds: true
- },
- typescript: {
- ignoreBuildErrors: true
- },
- images: {
- unoptimized: true
- },
- productionBrowserSourceMaps: true,
- webpack(_config) {
- // Fix for: "Module not found: Can't resolve 'canvas'"
- // _config.resolve.alias.canvas = false;
-
- _config.module.rules.push({
- test: /\.svg$/,
- use: [
- {
- loader: '@svgr/webpack',
- options: {
- svgoConfig: {
- // dont remove viewBox which allows svg to scale properly
- plugins: [
- {
- name: 'preset-default',
- params: {
- overrides: { removeViewBox: false }
- }
- }
- ]
- }
- }
- }
- ]
- });
- return _config;
- }
-};
-
-export default nextConfig;
diff --git a/apps/scoutgameadmin/package.json b/apps/scoutgameadmin/package.json
deleted file mode 100644
index c05972faac..0000000000
--- a/apps/scoutgameadmin/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "scoutgameadmin",
- "version": "0.1.0",
- "private": true,
- "scripts": {
- "start": "npx next dev",
- "build": "npx next build",
- "start:prod": "npx next start",
- "test": "npx jest --config jest.config.ts --maxWorkers=2",
- "lint": "npx next lint",
- "typecheck": "../../node_modules/typescript/bin/tsc --project ./tsconfig.json --noEmit"
- },
- "dependencies": {
- "@mui/lab": "^6.0.0-beta.11",
- "@packages/blockchain": "^0.0.0",
- "@packages/farcaster": "^0.0.0",
- "@packages/scoutgame": "^0.0.0",
- "@packages/scoutgameattestations": "^0.0.0",
- "@packages/utils": "^1.0.0"
- }
-}
diff --git a/apps/scoutgameadmin/playwright.config.ts b/apps/scoutgameadmin/playwright.config.ts
deleted file mode 100644
index 7023ccfce5..0000000000
--- a/apps/scoutgameadmin/playwright.config.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import type { PlaywrightTestConfig } from '@playwright/test';
-import { devices } from '@playwright/test';
-
-/**
- * Read environment variables from file.
- * https://github.com/motdotla/dotenv
- */
-// require('dotenv').config();
-
-/**
- * See https://playwright.dev/docs/test-configuration.
- */
-const config: PlaywrightTestConfig = {
- testDir: './__e2e__',
- /* Maximum time one test can run for. */
- timeout: 30 * 1000,
- expect: {
- /**
- * Maximum time expect() should wait for the condition to be met.
- * For example in `await expect(locator).toHaveText();`
- */
- timeout: 10000
- },
- /* Run tests in files in parallel */
- fullyParallel: true,
- /* Fail the build on CI if you accidentally left test.only in the source code. */
- forbidOnly: !!process.env.CI,
- /* Retry on CI only */
- retries: process.env.CI ? 2 : 0,
- /* Opt out of parallel tests on CI. */
- workers: process.env.CI ? 1 : undefined,
- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
- reporter: 'list',
- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
- use: {
- /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
- actionTimeout: 0,
- /* Base URL to use in actions like `await page.goto('/')`. */
- // baseURL: 'http://localhost:3000',
-
- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
- trace: 'on-first-retry'
- },
-
- /* Configure projects for major browsers */
- projects: [
- {
- name: 'chromium',
- use: {
- ...devices['Desktop Chrome']
- }
- }
-
- /* Only test Chrome for now
- {
- name: 'firefox',
- use: {
- ...devices['Desktop Firefox']
- }
- },
-
- {
- name: 'webkit',
- use: {
- ...devices['Desktop Safari']
- }
- }
- */
-
- /* Test against mobile viewports. */
- // {
- // name: 'Mobile Chrome',
- // use: {
- // ...devices['Pixel 5'],
- // },
- // },
- // {
- // name: 'Mobile Safari',
- // use: {
- // ...devices['iPhone 12'],
- // },
- // },
-
- /* Test against branded browsers. */
- // {
- // name: 'Microsoft Edge',
- // use: {
- // channel: 'msedge',
- // },
- // },
- // {
- // name: 'Google Chrome',
- // use: {
- // channel: 'chrome',
- // },
- // },
- ],
- /* Folder for test artifacts such as screenshots, videos, traces, etc. */
- // outputDir: 'test-results/',
-
- /* Run your local dev server before starting the tests */
- webServer: {
- // add DEBUG=pw:webserver environment variable to see server output
- command: 'npm run start:test',
- port: 3337,
- reuseExistingServer: true // !!process.env.CI
- }
-};
-
-export default config;
diff --git a/apps/scoutgameadmin/public/.well-known/walletconnect.txt b/apps/scoutgameadmin/public/.well-known/walletconnect.txt
deleted file mode 100644
index 8d7da1782e..0000000000
--- a/apps/scoutgameadmin/public/.well-known/walletconnect.txt
+++ /dev/null
@@ -1 +0,0 @@
-fcf948f7-7d24-42e2-abda-90ae4a10d892=e8571bc102fc1c2c9c2a3e4b6d647a7cf8c87cb27e6b81f52ef232f6942c6f47
\ No newline at end of file
diff --git a/apps/scoutgameadmin/public/__ENV.js b/apps/scoutgameadmin/public/__ENV.js
deleted file mode 100644
index 4348a72a5f..0000000000
--- a/apps/scoutgameadmin/public/__ENV.js
+++ /dev/null
@@ -1,12 +0,0 @@
-window.__ENV = {
- REACT_APP_GOOGLE_API_KEY: 'AIzaSyBhfFP-ZSD06cUCAc8AMXrnpNYHtrjn2tU',
- REACT_APP_GOOGLE_AUTH_DOMAIN: 'charmverse-dev.firebaseapp.com',
- REACT_APP_GOOGLE_PROJECT_ID: 'charmverse-dev',
- REACT_APP_GOOGLE_STORAGE_BUCKET: 'charmverse-dev.appspot.com',
- REACT_APP_GOOGLE_MESSAGING_SENDER_ID: '834736816902',
- REACT_APP_GOOGLE_APP_ID: '1:834736816902:web:ffcac9e3be898308ef9487',
- REACT_APP_STRIPE_PUBLIC_KEY: 'pk_test_REACT_APP_STRIPE_PUBLIC_KEY',
- REACT_APP_WALLETCONNECT_PROJECTID: 'f1d8ae8ff835aee4566311b7c4016ad7',
- REACT_APP_CONNECT_API_HOST: 'http://localhost:4000',
- REACT_APP_DD_CLIENT_TOKEN: '1234567890abcdef1234567890abcdef'
-};
diff --git a/apps/scoutgameadmin/public/favicon.ico b/apps/scoutgameadmin/public/favicon.ico
deleted file mode 100644
index 7b7314b0ce..0000000000
Binary files a/apps/scoutgameadmin/public/favicon.ico and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/desktop_login_background.png b/apps/scoutgameadmin/public/images/desktop_login_background.png
deleted file mode 100644
index 81db28347a..0000000000
Binary files a/apps/scoutgameadmin/public/images/desktop_login_background.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/farcaster.png b/apps/scoutgameadmin/public/images/farcaster.png
deleted file mode 100644
index 3e113a3e99..0000000000
Binary files a/apps/scoutgameadmin/public/images/farcaster.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/favicon.png b/apps/scoutgameadmin/public/images/favicon.png
deleted file mode 100644
index 3c7d031843..0000000000
Binary files a/apps/scoutgameadmin/public/images/favicon.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/geral_waving.png b/apps/scoutgameadmin/public/images/geral_waving.png
deleted file mode 100644
index b934e4c65b..0000000000
Binary files a/apps/scoutgameadmin/public/images/geral_waving.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/icons/blue-fire-icon.svg b/apps/scoutgameadmin/public/images/icons/blue-fire-icon.svg
deleted file mode 100644
index 60bcd0fb65..0000000000
--- a/apps/scoutgameadmin/public/images/icons/blue-fire-icon.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/card.svg b/apps/scoutgameadmin/public/images/icons/card.svg
deleted file mode 100644
index c321ff704b..0000000000
--- a/apps/scoutgameadmin/public/images/icons/card.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/github-circle-icon.svg b/apps/scoutgameadmin/public/images/icons/github-circle-icon.svg
deleted file mode 100644
index 30bcc64cbd..0000000000
--- a/apps/scoutgameadmin/public/images/icons/github-circle-icon.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/hex-gem-icon.svg b/apps/scoutgameadmin/public/images/icons/hex-gem-icon.svg
deleted file mode 100644
index ecc2925327..0000000000
--- a/apps/scoutgameadmin/public/images/icons/hex-gem-icon.svg
+++ /dev/null
@@ -1,48 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/like-green-icon.svg b/apps/scoutgameadmin/public/images/icons/like-green-icon.svg
deleted file mode 100644
index d629d2f5be..0000000000
--- a/apps/scoutgameadmin/public/images/icons/like-green-icon.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/like-icon.svg b/apps/scoutgameadmin/public/images/icons/like-icon.svg
deleted file mode 100644
index dbe11c7832..0000000000
--- a/apps/scoutgameadmin/public/images/icons/like-icon.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/nft-green-icon.svg b/apps/scoutgameadmin/public/images/icons/nft-green-icon.svg
deleted file mode 100644
index e9179f4ba9..0000000000
--- a/apps/scoutgameadmin/public/images/icons/nft-green-icon.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/nft-orange-icon.svg b/apps/scoutgameadmin/public/images/icons/nft-orange-icon.svg
deleted file mode 100644
index fb765f899b..0000000000
--- a/apps/scoutgameadmin/public/images/icons/nft-orange-icon.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/optimism-icon.svg b/apps/scoutgameadmin/public/images/icons/optimism-icon.svg
deleted file mode 100644
index b291fb2fd5..0000000000
--- a/apps/scoutgameadmin/public/images/icons/optimism-icon.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/scout-icon.svg b/apps/scoutgameadmin/public/images/icons/scout-icon.svg
deleted file mode 100644
index 9636eb5330..0000000000
--- a/apps/scoutgameadmin/public/images/icons/scout-icon.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/season1-icon.svg b/apps/scoutgameadmin/public/images/icons/season1-icon.svg
deleted file mode 100644
index 5d3616be7c..0000000000
--- a/apps/scoutgameadmin/public/images/icons/season1-icon.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/icons/warpcast-circle-icon.svg b/apps/scoutgameadmin/public/images/icons/warpcast-circle-icon.svg
deleted file mode 100644
index 718dbf8987..0000000000
--- a/apps/scoutgameadmin/public/images/icons/warpcast-circle-icon.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/scoutgameadmin/public/images/lightning_bolt.svg b/apps/scoutgameadmin/public/images/lightning_bolt.svg
deleted file mode 100644
index f14d401da6..0000000000
--- a/apps/scoutgameadmin/public/images/lightning_bolt.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/scoutgameadmin/public/images/logos/lit-protocol.png b/apps/scoutgameadmin/public/images/logos/lit-protocol.png
deleted file mode 100644
index 765aad295e..0000000000
Binary files a/apps/scoutgameadmin/public/images/logos/lit-protocol.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-192.png b/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-192.png
deleted file mode 100644
index a7c3ee430f..0000000000
Binary files a/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-192.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-256.png b/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-256.png
deleted file mode 100644
index a07747b0b6..0000000000
Binary files a/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-256.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-512.png b/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-512.png
deleted file mode 100644
index 0e6a3645d2..0000000000
Binary files a/apps/scoutgameadmin/public/images/manifest/scoutgame-logo-512.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/mobile_login_background.png b/apps/scoutgameadmin/public/images/mobile_login_background.png
deleted file mode 100644
index cb779bf64c..0000000000
Binary files a/apps/scoutgameadmin/public/images/mobile_login_background.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/scout-game-logo-square.png b/apps/scoutgameadmin/public/images/scout-game-logo-square.png
deleted file mode 100644
index b59b283f7e..0000000000
Binary files a/apps/scoutgameadmin/public/images/scout-game-logo-square.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/images/scout-game-logo.png b/apps/scoutgameadmin/public/images/scout-game-logo.png
deleted file mode 100644
index 221d1db1ed..0000000000
Binary files a/apps/scoutgameadmin/public/images/scout-game-logo.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/nft-assets/fonts/K2D-Medium.ttf b/apps/scoutgameadmin/public/nft-assets/fonts/K2D-Medium.ttf
deleted file mode 100644
index 667fefe0e4..0000000000
Binary files a/apps/scoutgameadmin/public/nft-assets/fonts/K2D-Medium.ttf and /dev/null differ
diff --git a/apps/scoutgameadmin/public/nft-assets/no_pfp_avatar.png b/apps/scoutgameadmin/public/nft-assets/no_pfp_avatar.png
deleted file mode 100644
index 2b16268316..0000000000
Binary files a/apps/scoutgameadmin/public/nft-assets/no_pfp_avatar.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/nft-assets/overlays/checked_corners.png b/apps/scoutgameadmin/public/nft-assets/overlays/checked_corners.png
deleted file mode 100644
index 17236b1ef3..0000000000
Binary files a/apps/scoutgameadmin/public/nft-assets/overlays/checked_corners.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/nft-assets/overlays/paint_splatter.png b/apps/scoutgameadmin/public/nft-assets/overlays/paint_splatter.png
deleted file mode 100644
index 640ee6012b..0000000000
Binary files a/apps/scoutgameadmin/public/nft-assets/overlays/paint_splatter.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/nft-assets/overlays/rounded_square.png b/apps/scoutgameadmin/public/nft-assets/overlays/rounded_square.png
deleted file mode 100644
index 77e6be8d9d..0000000000
Binary files a/apps/scoutgameadmin/public/nft-assets/overlays/rounded_square.png and /dev/null differ
diff --git a/apps/scoutgameadmin/public/nft-assets/overlays/scratch_reveal.png b/apps/scoutgameadmin/public/nft-assets/overlays/scratch_reveal.png
deleted file mode 100644
index 4e7da15e86..0000000000
Binary files a/apps/scoutgameadmin/public/nft-assets/overlays/scratch_reveal.png and /dev/null differ
diff --git a/apps/scoutgameadmin/scripts/query.ts b/apps/scoutgameadmin/scripts/query.ts
deleted file mode 100644
index 06776a2c20..0000000000
--- a/apps/scoutgameadmin/scripts/query.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { octokit } from '@packages/github/client';
-import { prisma } from '@charmverse/core/prisma-client';
-import { prettyPrint } from '@packages/utils/strings';
-async function main() {
- const user = await prisma.scout.update({
- where: {
- path: 'lilfrog-eth'
- },
- data: {
- avatar: 'https://avatars.githubusercontent.com/u/12549482?v=4'
- }
- });
- prettyPrint(user);
- // const gUser = await octokit.rest.users.getByUsername({ username: user.githubUser[0].login });
- // prettyPrint(gUser);
-}
-
-main();
diff --git a/apps/scoutgameadmin/theme/colors.ts b/apps/scoutgameadmin/theme/colors.ts
deleted file mode 100644
index 16c3f1d7c5..0000000000
--- a/apps/scoutgameadmin/theme/colors.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import { darken, lighten } from '@mui/material/styles';
-
-export const blueColor = '#009Fb7';
-export const darkBlueColor = darken(blueColor, 0.1);
-
-export const brandColor = '#8742FF'; // purple
-
-// light mode
-export const primaryTextColor = '#37352f';
-export const secondaryTextColor = '#888';
-export const backgroundColor = '#fff';
-export const lightGreyColor = '#edf2f4';
-export const backgroundLightColor = lightGreyColor;
-export const backgroundDarkColor = darken(backgroundColor, 0.1);
-export const scrollBarTrackBackgroundColor = darken(backgroundLightColor, 0.1);
-export const scrollBarThumbBackgroundColor = lighten(scrollBarTrackBackgroundColor, 0.5);
-export const inputBackground = 'rgb(245, 246, 247)';
-export const inputBorder = 'rgba(15, 15, 15, 0.1)';
-export const linkUnderlineColor = 'rgba(55,53,47,0.25)';
-
-// dark mode
-export const primaryTextColorDarkMode = '#ededed';
-export const secondaryTextColorDarkMode = '#999';
-export const backgroundColorDarkMode = '#191919';
-export const backgroundLightColorDarkMode = '#262626';
-export const backgroundDarkColorDarkMode = '#171717';
-export const scrollBarTrackBackgroundColorDarkMode = darken(backgroundLightColorDarkMode, 0.2);
-export const scrollBarThumbBackgroundColorDarkMode = lighten(scrollBarTrackBackgroundColorDarkMode, 0.1);
-export const inputBackgroundDarkMode = 'rgba(255, 255, 255, 0.055)';
-export const inputBorderDarkMode = 'rgba(255, 255, 255, 0.055)';
-export const linkUnderlineColorDarkMode = 'rgba(55, 55, 55, 1)';
-
-// Farcaster specific
-export const farcasterBrandColor = '#7c65c1';
-export const farcasterBrandColorLight = lighten(farcasterBrandColor, 0.9);
-export const farcasterBrandColorDark = '#6944ba';
diff --git a/apps/scoutgameadmin/theme/index.d.ts b/apps/scoutgameadmin/theme/index.d.ts
deleted file mode 100644
index 811ce0b0e4..0000000000
--- a/apps/scoutgameadmin/theme/index.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import type {
- PaletteOptions as MuiPaletteOptions,
- PaletteColorOptions as MuiPaletteColorOptions,
- PaletteColor
-} from '@mui/material/styles';
-
-declare module '@mui/material/styles' {
- export interface PaletteOptions extends MuiPaletteOptions {
- textPrimary: MuiPaletteOptions['primary'];
- inputBackground: MuiPaletteOptions['primary'];
- footerBackground: MuiPaletteOptions['primary'];
- mainBackground: MuiPaletteOptions['primary'];
- }
- export interface Palette extends MuiPaletteColorOptions {
- textPrimary: PaletteColor;
- inputBackground: PaletteColor;
- footerBackground: PaletteColor;
- mainBackground: PaletteColor;
- }
-}
diff --git a/apps/scoutgameadmin/theme/styles.scss b/apps/scoutgameadmin/theme/styles.scss
deleted file mode 100644
index aadbfb6be0..0000000000
--- a/apps/scoutgameadmin/theme/styles.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-* {
- box-sizing: border-box;
- padding: 0;
- margin: 0;
-}
-
-html,
-body {
- max-width: 100vw;
- // DO NOT ADD overflow-x: hidden here. It will break the position sticky option in other components
-}
-body > * {
- overflow-x: hidden;
-}
-
-a {
- color: inherit;
- text-decoration: none;
-}
-
-// override our MUI config for Farcaster modal
-.fc-authkit-qrcode-dialog {
- color: #111;
-}
-.fc-authkit-signin-button {
- // this div is used when user is logged in
- > div {
- width: 100%;
- display: block !important;
- }
- button {
- width: 100%;
- max-width: 400px;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 4px;
- margin: 0 auto;
- border: 0 none;
- // styles for logged-in version of button
- color: white !important;
- }
-}
diff --git a/apps/scoutgameadmin/theme/theme.tsx b/apps/scoutgameadmin/theme/theme.tsx
deleted file mode 100644
index 68a47fbd35..0000000000
--- a/apps/scoutgameadmin/theme/theme.tsx
+++ /dev/null
@@ -1,321 +0,0 @@
-'use client';
-
-import { grey } from '@mui/material/colors';
-import { createTheme, alpha, darken, lighten, responsiveFontSizes } from '@mui/material/styles';
-import { Inter } from 'next/font/google';
-
-import {
- backgroundColorDarkMode,
- backgroundLightColorDarkMode,
- brandColor,
- inputBackgroundDarkMode,
- inputBorderDarkMode,
- primaryTextColorDarkMode,
- secondaryTextColorDarkMode,
- primaryTextColor
-} from './colors';
-
-const interFont = Inter({
- subsets: ['latin'],
- variable: '--font-inter',
- display: 'swap'
-});
-
-const contrastText = '#fff';
-
-const themeOptions: Parameters[0] = {
- typography: {
- fontFamily: interFont.style.fontFamily,
- button: {
- fontWeight: 600,
- fontSize: '1rem'
- }
- },
- shape: {
- borderRadius: 5
- },
- cssVariables: true,
- defaultColorScheme: 'dark',
- colorSchemes: {
- dark: {
- // palette for dark mode
- palette: {
- background: {
- default: backgroundColorDarkMode,
- paper: backgroundLightColorDarkMode
- // dark: darken(backgroundLightColorDarkMode, 0.25),
- // light: lighten(backgroundColorDarkMode, 0.125) // this # is based on the background needed for Info pages
- },
- text: {
- primary: primaryTextColorDarkMode,
- disabled: primaryTextColor
- },
- primary: {
- main: brandColor,
- dark: darken(brandColor, 0.2)
- },
- secondary: {
- contrastText,
- main: secondaryTextColorDarkMode
- },
-
- action: {
- focus: 'rgb(29, 92, 132)',
- hover: 'rgba(255, 255, 255, 0.055)',
- selected: 'rgba(255, 255, 255, 0.055)'
- },
- textPrimary: {
- main: primaryTextColorDarkMode
- },
- footerBackground: { main: grey[700] },
- mainBackground: { main: backgroundColorDarkMode },
- inputBackground: {
- main: inputBackgroundDarkMode
- }
- }
- }
- },
- components: {
- MuiDialog: {
- styleOverrides: {
- paper: {
- borderRadius: 16 // Adjust this value to increase or decrease the roundness
- }
- }
- },
- MuiPopover: {
- defaultProps: {
- disableRestoreFocus: true
- }
- },
- MuiFormLabel: {
- styleOverrides: {
- root: ({ theme }) => ({
- color: theme.palette.text.primary
- })
- }
- },
- MuiAvatar: {
- styleOverrides: {
- root: ({ ownerState }) => ({
- ...(ownerState?.variant === 'rounded' && {
- borderRadius: 10
- }),
- fontWeight: 500
- })
- }
- },
- MuiAutocomplete: {
- defaultProps: {
- blurOnSelect: 'touch'
- },
- styleOverrides: {
- popper: {
- zIndex: '1050'
- }
- }
- },
- MuiAppBar: {
- styleOverrides: {
- root: ({ theme }) => ({
- backgroundColor: theme.palette.background.default,
- boxShadow: 'none',
- paddingTop: 1,
- paddingBottom: 1
- })
- }
- },
- MuiPaper: {
- styleOverrides: {
- // Disable the lightening of the background when elevation is applied
- // source: https://mui.com/material-ui/react-paper/
- root: {
- backgroundImage: 'none'
- }
- }
- },
- MuiButtonBase: {
- defaultProps: {
- disableRipple: true
- }
- },
- MuiCheckbox: {
- styleOverrides: {
- root: {
- color: brandColor
- }
- }
- },
- MuiButtonGroup: {
- defaultProps: {
- disableRipple: true,
- disableElevation: true
- },
- styleOverrides: {
- groupedContained: {
- '&:not(:last-child)': {
- borderRightColor: 'rgba(0, 0, 0 / 0.2)'
- }
- }
- }
- },
- MuiToggleButton: {},
- MuiButton: {
- defaultProps: {
- variant: 'contained',
- disableElevation: true
- },
- styleOverrides: {
- root: {
- borderRadius: 10,
- fontWeight: 600,
- fontSize: '1rem',
- textTransform: 'none'
- }
- }
- },
- MuiIconButton: {
- styleOverrides: {
- root: ({ theme }) => ({
- '&:hover': {
- backgroundColor: theme.vars.palette.inputBackground.main
- }
- })
- },
- defaultProps: {
- disableRipple: true
- }
- },
- MuiMenuItem: {
- defaultProps: {
- dense: true
- }
- },
- MuiTypography: {
- defaultProps: {
- color: 'text.primary'
- }
- },
- MuiTooltip: {
- defaultProps: {
- arrow: true,
- enterDelay: 1000,
- placement: 'top'
- }
- },
- MuiCard: {
- defaultProps: {
- variant: 'outlined'
- },
- styleOverrides: {
- root: ({ theme }) => ({
- boxShadow: 'none'
- })
- }
- },
- MuiCardContent: {
- styleOverrides: {
- root: {
- '&:last-child': {
- paddingBottom: 16
- }
- }
- }
- },
- MuiCssBaseline: {
- styleOverrides: {
- html: {
- // this makes the text look lighter
- MozOsxFontSmoothing: 'none'
- }
- }
- },
- MuiListItemIcon: {
- styleOverrides: {
- root: {
- fontSize: 'inherit',
- minWidth: '30px !important'
- }
- }
- },
- MuiSkeleton: {
- styleOverrides: {
- root: {
- transform: 'scale(1, 1)'
- }
- }
- },
- MuiOutlinedInput: {
- styleOverrides: {
- root: ({ theme }) => ({
- backgroundColor: inputBackgroundDarkMode,
- ...theme.applyStyles('dark', {
- '&.Mui-disabled .MuiOutlinedInput-notchedOutline': {
- borderColor: inputBorderDarkMode
- }
- })
- }),
- notchedOutline: ({ theme }) => ({
- ...theme.applyStyles('dark', {
- borderColor: inputBorderDarkMode
- })
- })
- }
- },
- MuiFormHelperText: {
- styleOverrides: {
- root: {
- marginLeft: 0
- }
- }
- },
- MuiSelect: {
- defaultProps: {
- size: 'small'
- }
- },
- MuiTabs: {
- defaultProps: {
- TabIndicatorProps: {
- sx: (theme) => ({
- backgroundColor: theme.palette.text.secondary
- })
- }
- },
- styleOverrides: {
- root: {}
- }
- },
- MuiTab: {
- styleOverrides: {
- root: ({ theme }) => ({
- minHeight: 0,
- textTransform: 'none',
- color: theme.palette.text.primary,
- fontWeight: '400',
- '&.Mui-selected': {
- color: theme.palette.text.secondary
- }
- })
- }
- },
- MuiLink: {
- styleOverrides: {
- root: ({ theme }) => ({
- color: theme.palette.primary.main,
- '&:hover': {
- color: theme.palette.primary.dark
- },
- fontFamily: interFont.style.fontFamily
- })
- },
- defaultProps: {
- underline: 'none'
- }
- }
- }
-};
-
-const createdTheme = createTheme(themeOptions);
-
-export default responsiveFontSizes(createdTheme) as typeof createdTheme;
diff --git a/apps/scoutgameadmin/tsconfig.json b/apps/scoutgameadmin/tsconfig.json
deleted file mode 100644
index 13b6267c3b..0000000000
--- a/apps/scoutgameadmin/tsconfig.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "compilerOptions": {
- "outDir": "../../dist/apps/scoutgame",
- "rootDir": "../../",
- "baseUrl": ".",
- "lib": ["dom", "dom.iterable", "esnext", "webworker"],
- "allowJs": true,
- "skipLibCheck": true,
- "strict": true,
- "noEmit": true,
- "esModuleInterop": true,
- "module": "esnext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "jsx": "preserve",
- "incremental": true,
- "plugins": [
- {
- "name": "next"
- }
- ],
- "paths": {
- "@connect-shared/*": ["../../@connect-shared/*"],
- "@root/charmClient/*": ["../../charmClient/*"],
- "apiClient/*": ["./apiClient/*"],
- "components/*": ["./components/*"],
- "hooks/*": ["./hooks/*"],
- "lib/*": ["./lib/*"],
- "public/*": ["./public/*"],
- "theme/*": ["./theme/*"],
- "@root/abis/*": ["../../abis/*"],
- "@root/adapters/*": ["../../adapters/*"],
- "@root/config/*": ["../../config/*"],
- "@root/connectors/*": ["../../connectors/*"],
- "@root/lib/*": ["../../lib/*"],
- "@root/hooks/*": ["../../hooks/*"],
- "@charmverse/core/prisma": ["../../node_modules/@charmverse/core/dist/cjs/prisma"],
- "@charmverse/core/prisma-client": ["../../node_modules/@charmverse/core/dist/cjs/prisma-client"],
- "@charmverse/core/shared": ["../../node_modules/@charmverse/core/dist/cjs/shared"],
- "@charmverse/core/log": ["../../node_modules/@charmverse/core/dist/cjs/lib/log"],
- "@charmverse/core/test": ["../../node_modules/@charmverse/core/dist/cjs/test"],
- "@charmverse/core/permissions": ["../../node_modules/@charmverse/core/dist/cjs/permissions"],
- "@charmverse/core/permissions/flags": ["../../node_modules/@charmverse/core/dist/cjs/permissions-flags"],
- "@charmverse/core/pages": ["../../node_modules/@charmverse/core/dist/cjs/pages"],
- "@charmverse/core/pages/utilities": ["../../node_modules/@charmverse/core/dist/cjs/pages-utilities"],
- "@charmverse/core/proposals": ["../../node_modules/@charmverse/core/dist/cjs/proposals"],
- "@charmverse/core/bounties": ["../../node_modules/@charmverse/core/dist/cjs/bounties"],
- "@charmverse/core/utilities": ["../../node_modules/@charmverse/core/dist/cjs/utilities"],
- "@charmverse/core/errors": ["../../node_modules/@charmverse/core/dist/cjs/errors"]
- }
- },
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
- "exclude": ["../../node_modules", ".next/"]
-}
diff --git a/docker-compose.yml b/docker-compose.yml
index abc1a7675f..0f8d10660f 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -135,26 +135,6 @@ services:
profiles:
- stg-scoutgamecron
- prd-scoutgameadmin:
- extends:
- service: defaults
- ports:
- - '80:3000'
- command: ['sh', '-c', 'node_modules/.bin/next start apps/scoutgameadmin --keepAliveTimeout 70000']
- profiles:
- - prd-scoutgameadmin
-
- stg-scoutgameadmin:
- extends:
- service: defaults
- ports:
- - '80:3000'
- command: ['sh', '-c', 'node_modules/.bin/next start apps/scoutgameadmin --keepAliveTimeout 70000']
- environment:
- - REACT_APP_APP_ENV=staging
- profiles:
- - stg-scoutgameadmin
-
prd-waitlist:
extends:
service: defaults
diff --git a/package.json b/package.json
index 025c4883db..d87d91669a 100644
--- a/package.json
+++ b/package.json
@@ -124,11 +124,7 @@
"sunnyawards:start:test": "npm run start:test -w=apps/sunnyawards",
"sunnyawards:start:test:ci": "npm run start:test:ci -w=apps/sunnyawards",
"sunnyawards:debug:e2e": "npm run debug:e2e -w=apps/sunnyawards",
- "sunnyawards:test:e2e:ci": "npm run test:e2e:ci -w=apps/sunnyawards",
- "scoutgameadmin": "dotenv -e .env.local -- npm start -w=apps/scoutgameadmin",
- "scoutgameadmin:remote": "dotenv -e .env.production -- npm start -w=apps/scoutgameadmin",
- "scoutgameadmin:build": "npm run build -w=apps/scoutgameadmin",
- "scoutgameadmin:test": "dotenv -e .env.test.local -- npm test -w apps/scoutgameadmin"
+ "sunnyawards:test:e2e:ci": "npm run test:e2e:ci -w=apps/sunnyawards"
},
"lint-staged": {
"*.{ts,tsx}": [
@@ -482,4 +478,4 @@
"msw": {
"workerDirectory": "public"
}
-}
\ No newline at end of file
+}