From 794ffc819c9670d4107560943475b67bde99d7bf Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 10:24:25 +0000 Subject: [PATCH 01/14] fix: session --- apps/web/src/components/settings/settings-form.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/settings/settings-form.tsx b/apps/web/src/components/settings/settings-form.tsx index 90e1e5c..aa765af 100644 --- a/apps/web/src/components/settings/settings-form.tsx +++ b/apps/web/src/components/settings/settings-form.tsx @@ -251,16 +251,16 @@ export function SettingsForm() { - {session.user + {session?.user ? JSON.stringify(session.user) : isSessionLoading ? 'loading...' : 'not authenticated'} - {session.user && } + {session?.user && } - {!session.user && ( + {!session?.user && ( Login From f9f7eef227c795c620beeefa406601d00377332d Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 10:41:57 +0000 Subject: [PATCH 02/14] panik-fix: twa --- scripts/one-click-deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/one-click-deploy.sh b/scripts/one-click-deploy.sh index 3a80cb0..a4c111a 100644 --- a/scripts/one-click-deploy.sh +++ b/scripts/one-click-deploy.sh @@ -40,7 +40,7 @@ echo "Preparing for Cloud Run deployment..." export COMMIT_SHA=$(git rev-parse --short HEAD) export DEPLOY_REGION="us-central1" export SERVICE_NAME="transcript-seeker-api-prod" -export GITHUB_USERNAME="Meeting-Baas" +export GITHUB_USERNAME="techwithanirudh" echo "Environment variables set:" echo " COMMIT_SHA: $COMMIT_SHA" From a8b78003a5b78faedab3be74c3296bb4b1015311 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 11:33:06 +0000 Subject: [PATCH 03/14] fix: .env.example --- apps/docs/.env.example | 5 ++++- turbo.json | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/docs/.env.example b/apps/docs/.env.example index c7fb151..a263929 100644 --- a/apps/docs/.env.example +++ b/apps/docs/.env.example @@ -1,2 +1,5 @@ ORAMA_PRIVATE_API_KEY="" -ORAMA_INDEX_ID="" \ No newline at end of file +ORAMA_INDEX_ID="" + +NEXT_PUBLIC_ORAMA_API_KEY="" +NEXT_PUBLIC_ORAMA_ENDPOINT="" \ No newline at end of file diff --git a/turbo.json b/turbo.json index b8cbf69..9991293 100644 --- a/turbo.json +++ b/turbo.json @@ -68,7 +68,10 @@ "BETTER_AUTH_SECRET", "BETTER_AUTH_URL", "BETTER_AUTH_TRUSTED_ORIGINS", - "ORAMA_PRIVATE_API_KEY" + "ORAMA_PRIVATE_API_KEY", + "ORAMA_INDEX_ID", + "NEXT_PUBLIC_ORAMA_API_KEY", + "NEXT_PUBLIC_ORAMA_ENDPOINT" ], "globalPassThroughEnv": [ "NODE_ENV", From 21c681d9f44f5f74a6c02925546a294604fb4c23 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 11:37:39 +0000 Subject: [PATCH 04/14] fix: nextjs output type --- apps/docs/next.config.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index 6ee83fd..afbdff9 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -10,16 +10,16 @@ const withMDX = createMDX(); /** @type {import('next').NextConfig} */ const config = { - output: "export", + // output: "export", reactStrictMode: true, eslint: { // Replaced by root workspace command ignoreDuringBuilds: true, }, - serverExternalPackages: ["ts-morph", "typescript"], - images: { - unoptimized: true, - }, + // serverExternalPackages: ["ts-morph", "typescript"], + // images: { + // unoptimized: true, + // }, }; export default withAnalyzer(withMDX(config)); From 6028b72d3be9e792660514230346018628924d80 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 11:40:51 +0000 Subject: [PATCH 05/14] fix: prod --- apps/docs/content/docs/concepts/environment-variables.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/docs/content/docs/concepts/environment-variables.mdx b/apps/docs/content/docs/concepts/environment-variables.mdx index 37cd908..82060b9 100644 --- a/apps/docs/content/docs/concepts/environment-variables.mdx +++ b/apps/docs/content/docs/concepts/environment-variables.mdx @@ -285,6 +285,12 @@ TURSO_AUTH_TOKEN="" ### Authentication Configuration + + When deploying to Google Cloud Run with a custom domain, you should set the + `BETTER_AUTH_URL` environment variable to the Cloud Run service URL rather + than the custom domain URL. + + These values are used by the api to perform authentication. Please follow the [guide](/docs/concepts/api/authentication) for more details: ```txt title=".env.development.local" From 41fcf3f6ad117c52244a22828b94a1d1a31d5523 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 12:02:52 +0000 Subject: [PATCH 06/14] docs: fix api config --- apps/api/.firebaserc | 11 ----------- apps/docs/content/docs/guides/deployment/firebase.mdx | 3 +-- apps/docs/next.config.mjs | 10 +++++----- scripts/one-click-deploy.sh | 6 +++--- 4 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 apps/api/.firebaserc diff --git a/apps/api/.firebaserc b/apps/api/.firebaserc deleted file mode 100644 index a851630..0000000 --- a/apps/api/.firebaserc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "projects": { - "transcript-seeker": "transcript-seeker-bdc29" - }, - "targets": { - "transcript-seeker-api-c8419": [ - "transcript-seeker-api-c8419" - ] - }, - "etags": {} -} diff --git a/apps/docs/content/docs/guides/deployment/firebase.mdx b/apps/docs/content/docs/guides/deployment/firebase.mdx index 1799577..3e7675b 100644 --- a/apps/docs/content/docs/guides/deployment/firebase.mdx +++ b/apps/docs/content/docs/guides/deployment/firebase.mdx @@ -30,8 +30,7 @@ For more information on Firebase Hosting, refer to the official [Firebase Hostin If not already, create a Firebase project in the Firebase Console: 1. Create a project named **Transcript Seeker**. -2. Then, create two new web apps: - - `transcript-seeker-api`: Replace `transcript-seeker-api-c8419` in `firebase.json` and `.firebaserc` with this new ID. +2. Then, create a new web app: - `transcript-seeker-proxy`: Replace `transcript-seeker-proxy` in `firebase.json` and `.firebaserc` with this new ID. 3. Navigate to **Hosting** and click "Get Started." 4. Finally, Replace `transcript-seeker-bdc29` in `firebase.json` and `.firebaserc` with your project id. (This is for firebase hosting, when you click on get started it automatically creates a hosting project with ur app id) diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index afbdff9..6ee83fd 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -10,16 +10,16 @@ const withMDX = createMDX(); /** @type {import('next').NextConfig} */ const config = { - // output: "export", + output: "export", reactStrictMode: true, eslint: { // Replaced by root workspace command ignoreDuringBuilds: true, }, - // serverExternalPackages: ["ts-morph", "typescript"], - // images: { - // unoptimized: true, - // }, + serverExternalPackages: ["ts-morph", "typescript"], + images: { + unoptimized: true, + }, }; export default withAnalyzer(withMDX(config)); diff --git a/scripts/one-click-deploy.sh b/scripts/one-click-deploy.sh index a4c111a..58b3c1b 100644 --- a/scripts/one-click-deploy.sh +++ b/scripts/one-click-deploy.sh @@ -16,21 +16,21 @@ echo "Environment set to production." # Build and deploy apps/web echo "Building and deploying apps/web..." cd apps/web -pnpm build +NODE_ENV=production pnpm build firebase deploy || { echo "Firebase deploy for apps/web failed"; exit 1; } cd ../.. # Build and deploy apps/proxy echo "Building and deploying apps/proxy..." cd apps/proxy -pnpm build +NODE_ENV=production pnpm build firebase deploy || { echo "Firebase deploy for apps/proxy failed"; exit 1; } cd ../.. # Build apps/api echo "Building apps/api..." cd apps/api -pnpm build || { echo "Build failed for apps/api"; exit 1; } +NODE_ENV=production pnpm build || { echo "Build failed for apps/api"; exit 1; } cd ../.. # Log Cloud Run deployment From 49440ea68d846bb7b01d0ac6d51f734e862aa23c Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 12:06:05 +0000 Subject: [PATCH 07/14] style: login px-2 --- apps/web/src/routes/login.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/routes/login.tsx b/apps/web/src/routes/login.tsx index 35c5afb..e08e4a9 100644 --- a/apps/web/src/routes/login.tsx +++ b/apps/web/src/routes/login.tsx @@ -9,7 +9,7 @@ function LoginPage() { const [isPending, startTransition] = useTransition(); return ( -
+

Login

From 494fec9c02a7d26a32ccea109e96185b3bc6d642 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 12:41:33 +0000 Subject: [PATCH 08/14] fix: prodd!!! --- apps/api/src/lib/auth.ts | 1 + apps/docs/content/docs/concepts/environment-variables.mdx | 3 +-- apps/docs/content/docs/guides/deployment/firebase.mdx | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/auth.ts b/apps/api/src/lib/auth.ts index c381d5e..8e6f901 100644 --- a/apps/api/src/lib/auth.ts +++ b/apps/api/src/lib/auth.ts @@ -9,6 +9,7 @@ export const auth = betterAuth({ logger: { verboseLogging: true, }, + trustedOrigins: [process.env.BETTER_AUTH_TRUSTED_ORIGINS!], socialProviders: { google: { clientId: process.env.GOOGLE_CLIENT_ID!, diff --git a/apps/docs/content/docs/concepts/environment-variables.mdx b/apps/docs/content/docs/concepts/environment-variables.mdx index 82060b9..6e7ddf3 100644 --- a/apps/docs/content/docs/concepts/environment-variables.mdx +++ b/apps/docs/content/docs/concepts/environment-variables.mdx @@ -287,8 +287,7 @@ TURSO_AUTH_TOKEN="" When deploying to Google Cloud Run with a custom domain, you should set the - `BETTER_AUTH_URL` environment variable to the Cloud Run service URL rather - than the custom domain URL. + `BETTER_AUTH_URL` environment variable to the custom domain. These values are used by the api to perform authentication. Please follow the [guide](/docs/concepts/api/authentication) for more details: diff --git a/apps/docs/content/docs/guides/deployment/firebase.mdx b/apps/docs/content/docs/guides/deployment/firebase.mdx index 3e7675b..80f7f99 100644 --- a/apps/docs/content/docs/guides/deployment/firebase.mdx +++ b/apps/docs/content/docs/guides/deployment/firebase.mdx @@ -196,6 +196,10 @@ The command below builds and deploys the Cloud Run service. Modify the `SERVICE_ can replace `COMMIT_SHA` with a unique identifier. + + If you have already deployed the frontend and are encountering a CORS error, it may be due to the API being built for production. Once the build is complete, the CORS error should be resolved. + + ```bash title="Terminal" export COMMIT_SHA=$(git rev-parse --short HEAD) export DEPLOY_REGION="us-central1" From 5c9c001028e3350c1a049775193fdd64ce3185ab Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 13:01:44 +0000 Subject: [PATCH 09/14] fix: bauth --- apps/api/package.json | 2 +- apps/web/package.json | 2 +- pnpm-lock.yaml | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/api/package.json b/apps/api/package.json index 325951f..415c270 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -20,7 +20,7 @@ "dependencies": { "@hono/node-server": "^1.13.2", "@libsql/client": "^0.14.0", - "better-auth": "0.7.1-beta.6", + "better-auth": "0.7.2", "dotenv": "^16.4.5", "drizzle-orm": "^0.35.2", "firebase-admin": "^12.6.0", diff --git a/apps/web/package.json b/apps/web/package.json index e3e9ddc..ec2dbd5 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -29,7 +29,7 @@ "@tanstack/react-table": "^8.19.2", "@vidstack/react": "^1.11.24", "assemblyai": "^4.6.1", - "better-auth": "0.7.1-beta.6", + "better-auth": "0.7.2", "date-fns": "^3.6.0", "dotenv-cli": "catalog:", "hls.js": "^1.5.13", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74f3781..94432ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -76,8 +76,8 @@ importers: specifier: ^0.14.0 version: 0.14.0 better-auth: - specifier: 0.7.1-beta.6 - version: 0.7.1-beta.6(react@19.0.0-rc-4d577fd2-20241104)(solid-js@1.9.3)(vue@3.5.12(typescript@5.6.3)) + specifier: 0.7.2 + version: 0.7.2(react@19.0.0-rc-4d577fd2-20241104)(solid-js@1.9.3)(vue@3.5.12(typescript@5.6.3)) dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -373,8 +373,8 @@ importers: specifier: ^4.6.1 version: 4.7.1 better-auth: - specifier: 0.7.1-beta.6 - version: 0.7.1-beta.6(react@19.0.0-rc-4d577fd2-20241104)(solid-js@1.9.3)(vue@3.5.12(typescript@5.6.3)) + specifier: 0.7.2 + version: 0.7.2(react@19.0.0-rc-4d577fd2-20241104)(solid-js@1.9.3)(vue@3.5.12(typescript@5.6.3)) date-fns: specifier: ^3.6.0 version: 3.6.0 @@ -4750,11 +4750,11 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - better-auth@0.7.1-beta.6: - resolution: {integrity: sha512-rRDtdxWEtVfcPRBaq88EFhJhjWpoVgO9EGECPUaJO619UmSf+cNO9Ush1X5h6mv82rI8E41sKZnx68TgAfIstQ==} + better-auth@0.7.2: + resolution: {integrity: sha512-a6hdsrvmya1Msvms3pXxmRiauDBc035sqhLyqKXOQQttRpmq3M1zFHPVuaXVx1BWOqDtS9UXl0XKZG7Ywyxu3Q==} - better-call@0.2.14-beta.2: - resolution: {integrity: sha512-j3hFMkD7xZNBXT1lFxrNFbz2Q5wwrzJ+3h+yDWJTVGrbkw7iL0gTA6ZY4hl1Nv3LCgW65wNnGJno9E8vy35oVA==} + better-call@0.2.14-beta.3: + resolution: {integrity: sha512-lA54ETanzM0xUZnQt6lm3BdTr4gVDyAe1DNpCQSTYUnwnGGOmQG8ob0FYivVd0XHsHQK68r01GB5c6cUuu4llQ==} bignumber.js@9.1.2: resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} @@ -13446,7 +13446,7 @@ snapshots: base64-js@1.5.1: {} - better-auth@0.7.1-beta.6(react@19.0.0-rc-4d577fd2-20241104)(solid-js@1.9.3)(vue@3.5.12(typescript@5.6.3)): + better-auth@0.7.2(react@19.0.0-rc-4d577fd2-20241104)(solid-js@1.9.3)(vue@3.5.12(typescript@5.6.3)): dependencies: '@better-fetch/fetch': 1.1.12 '@nanostores/query': 0.3.4(nanostores@0.11.3) @@ -13457,7 +13457,7 @@ snapshots: '@noble/hashes': 1.5.0 '@simplewebauthn/browser': 10.0.0 '@simplewebauthn/server': 10.0.1 - better-call: 0.2.14-beta.2 + better-call: 0.2.14-beta.3 consola: 3.2.3 defu: 6.1.4 jose: 5.9.6 @@ -13475,7 +13475,7 @@ snapshots: - solid-js - vue - better-call@0.2.14-beta.2: + better-call@0.2.14-beta.3: dependencies: '@better-fetch/fetch': 1.1.12 rou3: 0.5.1 From 349a834d687e9842e119b8c471330a0829dd0694 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 14:15:45 +0000 Subject: [PATCH 10/14] fix: cors handling --- .env.example | 5 ++++- apps/api/.env.example | 10 +++------- apps/api/src/lib/auth.ts | 2 +- apps/api/src/routes/auth.ts | 2 +- apps/api/src/routes/calendars.ts | 2 +- apps/docs/.env.example | 5 ++++- .../content/docs/concepts/environment-variables.mdx | 4 ++-- apps/proxy/.env.example | 5 ++++- turbo.json | 2 +- 9 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.env.example b/.env.example index a2b6290..6dfce18 100644 --- a/.env.example +++ b/.env.example @@ -9,4 +9,7 @@ VITE_PROXY_URL=https://localhost:3000 VITE_API_URL=https://localhost:3001 # Advanced -VITE_S3_PREFIX=https://s3.eu-west-3.amazonaws.com/meeting-baas-video \ No newline at end of file +VITE_S3_PREFIX=https://s3.eu-west-3.amazonaws.com/meeting-baas-video + +# Environment +NODE_ENV=development \ No newline at end of file diff --git a/apps/api/.env.example b/apps/api/.env.example index 7e2a5b1..322ef96 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -14,11 +14,7 @@ TURSO_AUTH_TOKEN="" # Auth BETTER_AUTH_SECRET="" BETTER_AUTH_URL="http://localhost:3001" -BETTER_AUTH_TRUSTED_ORIGINS="http://localhost:5173" +API_TRUSTED_ORIGINS="http://localhost:5173" -# Keyless Config -# This section is a work-in-progress - -# Hono Firebase Compatability -# https://github.com/honojs/hono/issues/1695 -# NODEJS_HELPERS="0" \ No newline at end of file +# Environment +NODE_ENV=development \ No newline at end of file diff --git a/apps/api/src/lib/auth.ts b/apps/api/src/lib/auth.ts index 8e6f901..056fc35 100644 --- a/apps/api/src/lib/auth.ts +++ b/apps/api/src/lib/auth.ts @@ -9,7 +9,7 @@ export const auth = betterAuth({ logger: { verboseLogging: true, }, - trustedOrigins: [process.env.BETTER_AUTH_TRUSTED_ORIGINS!], + trustedOrigins: process.env.API_TRUSTED_ORIGINS?.split(','), socialProviders: { google: { clientId: process.env.GOOGLE_CLIENT_ID!, diff --git a/apps/api/src/routes/auth.ts b/apps/api/src/routes/auth.ts index 5274c65..ce69056 100644 --- a/apps/api/src/routes/auth.ts +++ b/apps/api/src/routes/auth.ts @@ -8,7 +8,7 @@ const authRouter = new Hono(); authRouter.use( '/**', cors({ - origin: process.env.BETTER_AUTH_TRUSTED_ORIGINS!, + origin: process.env.API_TRUSTED_ORIGINS?.split(',') ?? [], allowHeaders: ['Content-Type', 'Authorization'], allowMethods: ['POST', 'GET', 'OPTIONS'], exposeHeaders: ['Content-Length'], diff --git a/apps/api/src/routes/calendars.ts b/apps/api/src/routes/calendars.ts index 91d1d5d..6c63bda 100644 --- a/apps/api/src/routes/calendars.ts +++ b/apps/api/src/routes/calendars.ts @@ -10,7 +10,7 @@ const calendars = new Hono(); calendars.use( '/*', cors({ - origin: process.env.BETTER_AUTH_TRUSTED_ORIGINS!, + origin: process.env.API_TRUSTED_ORIGINS?.split(',') ?? [], exposeHeaders: ['Content-Length'], maxAge: 600, credentials: true, diff --git a/apps/docs/.env.example b/apps/docs/.env.example index a263929..8ad6481 100644 --- a/apps/docs/.env.example +++ b/apps/docs/.env.example @@ -2,4 +2,7 @@ ORAMA_PRIVATE_API_KEY="" ORAMA_INDEX_ID="" NEXT_PUBLIC_ORAMA_API_KEY="" -NEXT_PUBLIC_ORAMA_ENDPOINT="" \ No newline at end of file +NEXT_PUBLIC_ORAMA_ENDPOINT="" + +# Environment +NODE_ENV=production \ No newline at end of file diff --git a/apps/docs/content/docs/concepts/environment-variables.mdx b/apps/docs/content/docs/concepts/environment-variables.mdx index 6e7ddf3..40bcd37 100644 --- a/apps/docs/content/docs/concepts/environment-variables.mdx +++ b/apps/docs/content/docs/concepts/environment-variables.mdx @@ -295,11 +295,11 @@ These values are used by the api to perform authentication. Please follow the [g ```txt title=".env.development.local" BETTER_AUTH_SECRET="" BETTER_AUTH_URL="http://localhost:3001" -BETTER_AUTH_TRUSTED_ORIGINS="http://localhost:5173" +API_TRUSTED_ORIGINS="http://localhost:5173" ``` - The `BETTER_AUTH_TRUSTED_ORIGINS` is not only used for authentication but also + The `API_TRUSTED_ORIGINS` is not only used for authentication but also for CORS configuration. diff --git a/apps/proxy/.env.example b/apps/proxy/.env.example index 0506a2f..19d28ee 100644 --- a/apps/proxy/.env.example +++ b/apps/proxy/.env.example @@ -7,4 +7,7 @@ NITRO_MEETINGBAAS_S3_URL=https://s3.eu-west-3.amazonaws.com/meeting-baas-video # Firebase Deployment Config # Advanced, only use if using firebase deployment -# NITRO_PRESET=firebase \ No newline at end of file +# NITRO_PRESET=firebase + +# Environment +NODE_ENV=development \ No newline at end of file diff --git a/turbo.json b/turbo.json index 9991293..db50f2a 100644 --- a/turbo.json +++ b/turbo.json @@ -67,7 +67,7 @@ "TURSO_AUTH_TOKEN", "BETTER_AUTH_SECRET", "BETTER_AUTH_URL", - "BETTER_AUTH_TRUSTED_ORIGINS", + "API_TRUSTED_ORIGINS", "ORAMA_PRIVATE_API_KEY", "ORAMA_INDEX_ID", "NEXT_PUBLIC_ORAMA_API_KEY", From 1f8ec8d4dd792fd4b26bdebb097ebaaed98812a9 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 14:15:55 +0000 Subject: [PATCH 11/14] fix: seperate cors in env --- apps/api/.env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/api/.env.example b/apps/api/.env.example index 322ef96..bf998c7 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -14,6 +14,8 @@ TURSO_AUTH_TOKEN="" # Auth BETTER_AUTH_SECRET="" BETTER_AUTH_URL="http://localhost:3001" + +# CORS API_TRUSTED_ORIGINS="http://localhost:5173" # Environment From bae10873d209c0b8a71c16c64d46f610727051da Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 15:11:20 +0000 Subject: [PATCH 12/14] fix: node-env to dev from prod fix: add pre-production env to gitignore --- .gitignore | 1 + apps/docs/.env.example | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3f310b2..d2c2f21 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ web_modules/ .env.development.local .env.test.local .env.production.local +.env.pre-production.local .env.local # parcel-bundler cache (https://parceljs.org/) diff --git a/apps/docs/.env.example b/apps/docs/.env.example index 8ad6481..1883dc2 100644 --- a/apps/docs/.env.example +++ b/apps/docs/.env.example @@ -5,4 +5,4 @@ NEXT_PUBLIC_ORAMA_API_KEY="" NEXT_PUBLIC_ORAMA_ENDPOINT="" # Environment -NODE_ENV=production \ No newline at end of file +NODE_ENV=development \ No newline at end of file From da89d8c297ace5a3bcc6fe74534a2d787b881f61 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 15:47:00 +0000 Subject: [PATCH 13/14] fix: update callbackURL in login.tsx Update the callbackURL in the login.tsx file to use a better authentication method that automatically resolves the callback URL. The previous callbackURL was temporary and needed to be removed. --- apps/web/src/routes/login.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/routes/login.tsx b/apps/web/src/routes/login.tsx index e08e4a9..7bd7046 100644 --- a/apps/web/src/routes/login.tsx +++ b/apps/web/src/routes/login.tsx @@ -22,7 +22,8 @@ function LoginPage() { startTransition(async () => { await signIn.social({ provider: 'google', - callbackURL: '/meetings', + // todo: remove this when better auth resolves the callback url automatically + callbackURL: new URL('/meetings', document.location as any).href, }); }); }} From dea72da12472448b9372e9622aee75a040183d97 Mon Sep 17 00:00:00 2001 From: Anirudh Sriram Date: Tue, 5 Nov 2024 16:17:35 +0000 Subject: [PATCH 14/14] fix: build --- apps/docs/next.config.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index 6ee83fd..afbdff9 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -10,16 +10,16 @@ const withMDX = createMDX(); /** @type {import('next').NextConfig} */ const config = { - output: "export", + // output: "export", reactStrictMode: true, eslint: { // Replaced by root workspace command ignoreDuringBuilds: true, }, - serverExternalPackages: ["ts-morph", "typescript"], - images: { - unoptimized: true, - }, + // serverExternalPackages: ["ts-morph", "typescript"], + // images: { + // unoptimized: true, + // }, }; export default withAnalyzer(withMDX(config));