Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Cleanup env vars and improve development instructions (#284)
Brendan Alland16ea3c4153c
diff --git a/.env.example b/.env.exampleindex fbc2634be..0cb3f9d2b 100644--- a/.env.example+++ b/.env.example@@ -1,82 +1,78 @@-###-### TODO: Consolidate next and vite env variables into one set of variables.-###--# ********** INDEX **********-#-# - REQUIRED-# --database-# --aws-# --resend--# - OPTIONAL-# - MISC--#### COPY THIS FILE TO .env AND UPDATE THE VALUES ####--# - REQUIRED ****************--NEXT_PUBLIC_ENVIRONMENT=development-NEXT_PUBLIC_PORT=3000-NEXT_PUBLIC_URL=http://localhost:${NEXT_PUBLIC_PORT}-NEXT_PUBLIC_TASKS_URL=http://localhost:3002--NEXTAUTH_URL=${NEXT_PUBLIC_URL}-VITE_SERVER_URL=${NEXT_PUBLIC_URL}-VITE_ENVIRONMENT=${NEXT_PUBLIC_ENVIRONMENT}--# IMPORTANT FOR LOCAL DEV:-# This determines whether or not the app will run in "local mode".-# when in local mode, auth will not be required in the desktop app-# and videos will not be uploaded to AWS S3.-NEXT_PUBLIC_LOCAL_MODE=false--# -- database ****************-#-# This is the URL for the PlanetScale database simulator,-# which will automatically be created on pnpm dev.-# It is used for local development only.-# For production, use the DATABASE_URL from your DB provider. Must include https for production use, mysql:// for local.-# DATABASE_ENCRYPTION_KEY is used to encrypt sensitive data in the database (like S3 credentials). Not required for local development.-DATABASE_URL=mysql://root:@localhost:3306/planetscale-DATABASE_ENCRYPTION_KEY=--# This is the secret for the NextAuth.js authentication library.-# It is used for local development only.-# For production, use the NEXTAUTH_SECRET from your hosting environment.-NEXTAUTH_SECRET_DEV=dEnSH8rpZ4J8QXs/mE+HG+z4JCsQKdm6th+N+1jfsCw=--# Generate a secret with `openssl rand -base64 32`-NEXTAUTH_SECRET=+## This configuration assumes you are running `pnpm dev`, ie. running both @cap/web and @cap/desktop locally.+## If you are only running @cap/desktop, comment out entries underneath '@cap/web + @cap/desktop'+## and uncomment entries underneath 'only @cap/desktop'+## Make sure to read the instructions on each section carefully, or you may incorrectly configure your environment.++++### @cap/desktop+VITE_ENVIRONMENT=${NODE_ENV}++# @cap/web + @cap/desktop+VITE_SERVER_URL=${NEXT_PUBLIC_WEB_URL}+# only @cap/desktop+# VITE_SERVER_URL=https://cap.so++RUST_BACKTRACE=full++++### @cap/web+NODE_ENV=development+WEB_PORT=3000+NEXT_PUBLIC_WEB_URL=http://localhost:${WEB_PORT}+NEXTAUTH_URL=${NEXT_PUBLIC_WEB_URL}++## Database-# -- aws ****************-## For use with AWS S3, to upload recorded caps. You can retrieve these credentials from your own AWS account.-## Uses CAP_ prefix to avoid conflict with env variables set in hosting environment. (e.g. Vercel)+# @cap/web supports connecting to either MySQL or Planetscale databases.+# For plain MySQL, just define DATABASE_URL (this default points to the database created by `pnpm dev`)+DATABASE_URL='mysql://root:@localhost:3306/planetscale'+# For Planetscale, define both a https:// DATABASE_URL and mysql:// DATABASE_MIGRATION_URL+# DATABASE_URL='https://{username}:{password}@aws.connect.psdb.cloud/{db-name}' # https:// identifies this as a PS connection string+# DATABASE_MIGRATION_URL='mysql://{username}:{password}@aws.connect.psdb.cloud/{db-name}?ssl={"rejectUnauthorized":false}' # necessary as migrations can't be performed over https++# Encrypts users' custom S3 credentials. If you don't plan on using this feature you can leave it commented out.+# Generate a value by running `openssl rand -hex 32`+# DATABASE_ENCRYPTION_KEY=+++## AWS/S3++# By default these are configured for the MinIO instance created by `pnpm dev`CAP_AWS_ACCESS_KEY=capS3rootCAP_AWS_SECRET_KEY=capS3root-# If using AWS S3 - leave ENDPOINT blank-NEXT_PUBLIC_CAP_AWS_ENDPOINT=http://localhost:3902NEXT_PUBLIC_CAP_AWS_BUCKET=capso-# If using a Proxy such as Cloudfront, set the URL here to the full URL of the bucket-NEXT_PUBLIC_CAP_AWS_BUCKET_URL=NEXT_PUBLIC_CAP_AWS_REGION=us-east-1+# If you're not using AWS S3, point this to your custom S3 provider (default points to MinIO created by `pnpm dev`)+NEXT_PUBLIC_CAP_AWS_ENDPOINT=http://localhost:3902+# If using a proxy such as CloudFront, set this the full URL of the bucket+# NEXT_PUBLIC_CAP_AWS_BUCKET_URL=https://v.cap.so-# -- Deepgram (for transcription) ****************-DEEPGRAM_API_KEY=+# If you're using AWS S3 with CloudFront, set this to the CloudFront Distribution ID+# CAP_AWS_ACCESS_KEY and CAP_AWS_SECRET_KEY must have permission to modify the CF distribution+# CAP_CLOUDFRONT_DISTRIBUTION_ID=-# -- resend ****************-## For use with email authentication (sign up, sign in, forgot password)-RESEND_API_KEY=-# - OPTIONAL, NOT REQUIRED ****************-RUST_BACKTRACE=full+# Necessary for authentication, genearte by running `openssl rand -base64 32`+NEXTAUTH_SECRET=++# Provide if you want to use Google authentication+# GOOGLE_CLIENT_ID=+# GOOGLE_CLIENT_SECRET=++# Email via resend.com, used for auth (sign up/in, forgot password)+# Not necessary in development as auth links are printed to the console+# RESEND_API_KEY=++# Audio transcription+# DEEPGRAM_API_KEY=+# Only needed by cap.so cloud+# NEXT_LOOPS_KEY=-# - MISC, NOT REQUIRED FOR DEV ****************-NEXT_LOOPS_KEY=-CAP_DESKTOP_SENTRY_URL=https://efd3156d9c0a8a49bee3ee675bec80d8@o4506859771527168.ingest.us.sentry.io/4506859844403200-# Google OAuth-GOOGLE_CLIENT_ID="your-google-client-id"-GOOGLE_CLIENT_SECRET="your-google-client-secret"\ No newline at end of file+### @cap/tasks+TASKS_PORT=3002+NEXT_PUBLIC_TASKS_URL=http://localhost:${TASKS_PORT}diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.ymlindex 3e4bb3761..f4f78d29e 100644--- a/.github/workflows/debug.yml+++ b/.github/workflows/debug.yml@@ -57,9 +57,9 @@ jobs:run: |echo "appVersion=debug" >> .envecho "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env- echo "NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}" >> .env- echo 'NEXTAUTH_URL=${NEXT_PUBLIC_URL}' >> .env- echo 'VITE_SERVER_URL=${NEXT_PUBLIC_URL}' >> .env+ echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env+ echo 'NEXTAUTH_URL=${NEXT_PUBLIC_WEB_URL}' >> .env+ echo 'VITE_SERVER_URL=${NEXT_PUBLIC_WEB_URL}' >> .envecho "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .envecho "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .envdiff --git a/.github/workflows/main.yml b/.github/workflows/main.ymlindex ae77b50a9..6b9de8035 100644--- a/.github/workflows/main.yml+++ b/.github/workflows/main.yml@@ -46,10 +46,9 @@ jobs:- name: Create .env file in rootrun: |- echo "NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}" > .env+ echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" > .envecho "appVersion=${{ steps.get_version.outputs.appVersion }}" >> .env- echo "NEXT_PUBLIC_ENVIRONMENT=production" >> .env- echo "NEXT_PUBLIC_LOCAL_MODE=false" >> .env+ echo "NODE_ENV=production" >> .envecho "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .envecho "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .envecho "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .envdiff --git a/.github/workflows/publish.yml b/.github/workflows/publish.ymlindex 9c84720e6..231ab3db4 100644--- a/.github/workflows/publish.yml+++ b/.github/workflows/publish.yml@@ -138,9 +138,9 @@ jobs:run: |echo "appVersion=${{ needs.draft.outputs.version }}" >> .envecho "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env- echo "NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}" >> .env- echo 'NEXTAUTH_URL=${NEXT_PUBLIC_URL}' >> .env- echo 'VITE_SERVER_URL=${NEXT_PUBLIC_URL}' >> .env+ echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env+ echo 'NEXTAUTH_URL=${NEXT_PUBLIC_WEB_URL}' >> .env+ echo 'VITE_SERVER_URL=${NEXT_PUBLIC_WEB_URL}' >> .envecho "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .envecho "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .envdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 99f6796d0..68a046d5f 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -22,43 +22,45 @@ There are many ways to contribute to Cap. You can:- [Suggest a feature (via Discord)](https://discord.com/invite/y8gdQ3WRN3)- Submit a PR+## Runing Cap+### Development Requirements+Before anything else, make sure you have the following installed:+- Node Version 20+- Rust 1.84.0+- pnpm 8.10.5+- Docker ([OrbStack](https://orbstack.dev/) recommended)-### How do I get started with development on my local machine?+### General Setup-This is a very top level guide right now, but if you want to develop for both the web app and desktop app, you will need to make sure the below steps are followed. Alternatively, if you are only looking to run the desktop app locally, you can follow the `How do I run the desktop app locally without needing to use auth?` steps.+Configure the necessary environment variables by copying the `.env.example` file to `.env`.+`.env.example` by default assumes you want to run both `@cap/desktop` and `@cap/web` locally.+Follow the instructions in the file for how to configure the environment variables for which apps you want to run.-1. Clone the repository-2. Install dependencies with `pnpm install`-3. Setup native dependencies with `pnpm cap-setup`-3. Clone .env.example and rename it to .env-4. At the root of the directory, run the app with `pnpm dev`. This will create a local database simulator, run the necessary DB migrations, and start both the web app and desktop app concurrently.-5. Make sure both the the desktop app, and web app can be built without any errors. For the desktop app, use `pnpm tauri:build`. For the web app, use `pnpm build`-6. Submit a PR with your changes+Run `pnpm cap-setup` to install native dependencies such as FFmpeg,+then run `pnpm install`.-> [!NOTE]-> When running the app locally on a MacOS machine, you will need to give permissions to Cap - this will show up as your **Terminal app** in the Security & Privacy settings page.+On Windows, llvm, clang, and VCPKG must be installed.+`pnpm cap-setup` does not yet install these dependencies for you.-### How do I run the desktop app locally without needing to use auth?+To run both `@cap/desktop` and `@cap/web` together, use `pnpm dev`.+To run only one of them, use `pnpm dev:desktop` or `pnpm dev:web` respectively.-You can run cap in "local mode", which means that no auth is required for the desktop app, and no video segments are uploaded. Similar to the above steps, this is how you can run the Cap desktop app in local mode with the least amount of .env vars.+### `@cap/desktop` (desktop app)-1. Clone the repository-2. Install dependencies with `pnpm install`-3. Setup native dependencies with `pnpm cap-setup`-3. Clone .env.example and rename it to .env-4. Make sure you have `NEXT_PUBLIC_ENVIRONMENT=development`, `NEXT_PUBLIC_URL=http://localhost:3000` and `NEXT_PUBLIC_LOCAL_MODE=true`. These should be the only .env vars that you require to get the desktop app up and running.-5. At the root of the directory, run the app with `pnpm dev`+When running `@cap/desktop` from a terminal on macOS,+you will need to grant permissions (screen recording, microphone, etc.) to the terminal, not the Cap app.+For example, if you run `pnpm dev:desktop` in the macOS `Terminal.app`,+you will need to grant permissions to it instead of `Cap - Development.app`.-### How do I view the screen recording segments locally?+#### Where are my recordings stored?-The video segments are stored in your app data directory, under the folder `so.cap.desktop`. You should see a directory called `chunks`, which will contain both `video` and `audio` directories. You can find the relevant segments in either of those.+You can find your recordings at `~/Library/Application Support/so.cap.desktop.dev/recordings` on macOS,+and `%programfiles%/so.cap.desktop.dev/recordings` on Windows.-### Notes for development on Windows:+### `@cap/web` (cap.so website)-Requirements: llvm, clang and VCPKG are required for compiling ffmpeg-sys.+When running `pnpm dev` or `pnpm dev:web`, a MySQL database and MinIO S3 server will also be using Docker.+If you want to _only_ run the `@cap/web` NextJS app, `cd` into `./apps/web` and run `pnpm dev`.diff --git a/apps/desktop/src-tauri/src/web_api.rs b/apps/desktop/src-tauri/src/web_api.rsindex c7cb1f9d9..f817b90de 100644--- a/apps/desktop/src-tauri/src/web_api.rs+++ b/apps/desktop/src-tauri/src/web_api.rs@@ -5,7 +5,7 @@ use tauri_specta::Event;use crate::auth::{AuthStore, AuthenticationInvalid};pub fn make_url(pathname: impl AsRef<str>) -> String {- let server_url_base = dotenvy_macro::dotenv!("NEXT_PUBLIC_URL");+ let server_url_base = dotenvy_macro::dotenv!("NEXT_PUBLIC_WEB_URL");format!("{server_url_base}{}", pathname.as_ref())}diff --git a/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx b/apps/embed/app/view/[videoId]/_components/ShareVideo.tsxindex 3095596a7..2f19d0c2c 100644--- a/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx+++ b/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx@@ -402,7 +402,7 @@ export const ShareVideo = ({href={user? "/dashboard"- : `${process.env.NEXT_PUBLIC_URL}?referrer=${data.id}`+ : `${process.env.NEXT_PUBLIC_WEB_URL}?referrer=${data.id}`}><LogoBadge className="w-8 h-auto" />@@ -442,7 +442,7 @@ export const ShareVideo = ({data.skipProcessing === true ||(data.jobStatus !== "COMPLETE" &&data.source.type === "MediaConvert")- ? `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${data.ownerId}&videoId=${data.id}&videoType=master`+ ? `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${data.ownerId}&videoId=${data.id}&videoType=master`: data.source.type === "MediaConvert"? `${S3_BUCKET_URL}/${data.ownerId}/${data.id}/output/video_recording_000.m3u8`: `${S3_BUCKET_URL}/${data.ownerId}/${data.id}/combined-source/stream.m3u8`diff --git a/apps/embed/app/view/[videoId]/_components/Toolbar.tsx b/apps/embed/app/view/[videoId]/_components/Toolbar.tsxindex da1d7d13d..7a1c89f56 100644--- a/apps/embed/app/view/[videoId]/_components/Toolbar.tsx+++ b/apps/embed/app/view/[videoId]/_components/Toolbar.tsx@@ -65,7 +65,7 @@ export const Toolbar = ({console.log("timestamp", timestamp);const response = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/comment`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/comment`,{method: "POST",headers: {diff --git a/apps/embed/app/view/[videoId]/page.tsx b/apps/embed/app/view/[videoId]/page.tsxindex 004963325..a0db1791e 100644--- a/apps/embed/app/view/[videoId]/page.tsx+++ b/apps/embed/app/view/[videoId]/page.tsx@@ -30,7 +30,7 @@ export async function generateMetadata(description: "This video is private and cannot be shared.",openGraph: {images: [- `${process.env.NEXT_PUBLIC_URL}/api/video/og?videoId=${videoId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/og?videoId=${videoId}`,],},};@@ -41,7 +41,7 @@ export async function generateMetadata(description: "Watch this video on Cap",openGraph: {images: [- `${process.env.NEXT_PUBLIC_URL}/api/video/og?videoId=${videoId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/og?videoId=${videoId}`,],},};@@ -66,7 +66,7 @@ export default async function ShareVideoPage(props: Props) {video.source.type === "MediaConvert") {const res = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/upload/mux/create?videoId=${videoId}&userId=${video.ownerId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/upload/mux/create?videoId=${videoId}&userId=${video.ownerId}`,{method: "GET",credentials: "include",@@ -79,7 +79,7 @@ export default async function ShareVideoPage(props: Props) {if (video.transcriptionStatus !== "COMPLETE") {fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/transcribe?videoId=${videoId}&userId=${video.ownerId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/transcribe?videoId=${videoId}&userId=${video.ownerId}`,{method: "GET",credentials: "include",@@ -94,7 +94,7 @@ export default async function ShareVideoPage(props: Props) {video.source.type === "MediaConvert") {fetch(- `${process.env.NEXT_PUBLIC_URL}/api/upload/mux/status?videoId=${videoId}&userId=${video.ownerId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/upload/mux/status?videoId=${videoId}&userId=${video.ownerId}`,{method: "GET",credentials: "include",diff --git a/apps/web/app/api/desktop/feedback/route.ts b/apps/web/app/api/desktop/feedback/route.tsindex 227e3866d..468606075 100644--- a/apps/web/app/api/desktop/feedback/route.ts+++ b/apps/web/app/api/desktop/feedback/route.ts@@ -3,7 +3,7 @@ import { getCurrentUser } from "@cap/database/auth/session";import { cookies } from "next/headers";const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","http://localhost:3000","tauri://localhost",diff --git a/apps/web/app/api/desktop/plan/route.ts b/apps/web/app/api/desktop/plan/route.tsindex 8b5cdbc57..db9b844ae 100644--- a/apps/web/app/api/desktop/plan/route.ts+++ b/apps/web/app/api/desktop/plan/route.ts@@ -9,7 +9,7 @@ import { stripe } from "@cap/utils";import { eq } from "drizzle-orm";const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","tauri://localhost","http://tauri.localhost",diff --git a/apps/web/app/api/desktop/session/request/route.ts b/apps/web/app/api/desktop/session/request/route.tsindex e2d0695a7..dc374f99d 100644--- a/apps/web/app/api/desktop/session/request/route.ts+++ b/apps/web/app/api/desktop/session/request/route.ts@@ -10,14 +10,11 @@ export async function GET(req: NextRequest) {const port = searchParams.get("port") || "";const platform = searchParams.get("platform") || "web";- const secret =- process.env.NODE_ENV === "development"- ? process.env.NEXTAUTH_SECRET_DEV- : process.env.NEXTAUTH_SECRET;+ const secret = process.env.NEXTAUTH_SECRET;if (!session) {return Response.redirect(- `${process.env.NEXT_PUBLIC_URL}/login?next=${process.env.NEXT_PUBLIC_URL}/api/desktop/session/request?port=${port}`+ `${process.env.NEXT_PUBLIC_WEB_URL}/login?next=${process.env.NEXT_PUBLIC_WEB_URL}/api/desktop/session/request?port=${port}`);}@@ -27,7 +24,7 @@ export async function GET(req: NextRequest) {if (!tokenValue || !user) {return Response.redirect(- `${process.env.NEXT_PUBLIC_URL}/login?next=${process.env.NEXT_PUBLIC_URL}/api/desktop/session/request?port=${port}`+ `${process.env.NEXT_PUBLIC_WEB_URL}/login?next=${process.env.NEXT_PUBLIC_WEB_URL}/api/desktop/session/request?port=${port}`);}@@ -38,7 +35,7 @@ export async function GET(req: NextRequest) {if (!decodedToken) {return Response.redirect(- `${process.env.NEXT_PUBLIC_URL}/login?next=${process.env.NEXT_PUBLIC_URL}/api/desktop/session/request?port=${port}`+ `${process.env.NEXT_PUBLIC_WEB_URL}/login?next=${process.env.NEXT_PUBLIC_WEB_URL}/api/desktop/session/request?port=${port}`);}diff --git a/apps/web/app/api/desktop/subscribe/route.ts b/apps/web/app/api/desktop/subscribe/route.tsindex e8dcc8ef1..e9d450919 100644--- a/apps/web/app/api/desktop/subscribe/route.ts+++ b/apps/web/app/api/desktop/subscribe/route.ts@@ -7,7 +7,7 @@ import { isUserOnProPlan, stripe } from "@cap/utils";import { eq } from "drizzle-orm";const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","tauri://localhost","http://tauri.localhost",@@ -155,8 +155,8 @@ export async function POST(request: NextRequest) {},],mode: "subscription",- success_url: `${process.env.NEXT_PUBLIC_URL}/dashboard/caps?upgrade=true`,- cancel_url: `${process.env.NEXT_PUBLIC_URL}/pricing`,+ success_url: `${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?upgrade=true`,+ cancel_url: `${process.env.NEXT_PUBLIC_WEB_URL}/pricing`,allow_promotion_codes: true,});diff --git a/apps/web/app/api/desktop/video/create/route.ts b/apps/web/app/api/desktop/video/create/route.tsindex 2ec581ec8..b6d4542dd 100644--- a/apps/web/app/api/desktop/video/create/route.ts+++ b/apps/web/app/api/desktop/video/create/route.ts@@ -9,7 +9,7 @@ import { eq } from "drizzle-orm";import { getS3Bucket, getS3Config } from "@/utils/s3";const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","http://localhost:3000","tauri://localhost",@@ -54,7 +54,9 @@ export async function GET(req: NextRequest) {const params = req.nextUrl.searchParams;const origin = params.get("origin") || null;const originalOrigin = req.nextUrl.origin;- const duration = params.get("duration") ? parseFloat(params.get("duration")!) : null;+ const duration = params.get("duration")+ ? parseFloat(params.get("duration")!)+ : null;const user = await getCurrentUser();console.log("/api/desktop/video/create user", user);@@ -136,7 +138,8 @@ export async function GET(req: NextRequest) {: "null","Access-Control-Allow-Credentials": "true","Access-Control-Allow-Methods": "GET, OPTIONS",- "Access-Control-Allow-Headers": "Authorization, sentry-trace, baggage",+ "Access-Control-Allow-Headers":+ "Authorization, sentry-trace, baggage",},});}@@ -159,7 +162,8 @@ export async function GET(req: NextRequest) {: "null","Access-Control-Allow-Credentials": "true","Access-Control-Allow-Methods": "GET, OPTIONS",- "Access-Control-Allow-Headers": "Authorization, sentry-trace, baggage",+ "Access-Control-Allow-Headers":+ "Authorization, sentry-trace, baggage",},});@@ -171,23 +175,21 @@ export async function GET(req: NextRequest) {ownerId: user.id,awsRegion: s3Config.region,awsBucket: bucketName,- source: recordingMode === "hls"- ? { type: "local" as const }- : recordingMode === "desktopMP4"- ? { type: "desktopMP4" as const }- : undefined,+ source:+ recordingMode === "hls"+ ? { type: "local" as const }+ : recordingMode === "desktopMP4"+ ? { type: "desktopMP4" as const }+ : undefined,isScreenshot,bucket: bucket?.id,};await db.insert(videos).values(videoData);- if (- process.env.NEXT_PUBLIC_IS_CAP &&- process.env.NEXT_PUBLIC_ENVIRONMENT === "production"- ) {+ if (process.env.NEXT_PUBLIC_IS_CAP && process.env.NODE_ENV === "production") {await dub.links.create({- url: `${process.env.NEXT_PUBLIC_URL}/s/${id}`,+ url: `${process.env.NEXT_PUBLIC_WEB_URL}/s/${id}`,domain: "cap.link",key: id,});diff --git a/apps/web/app/api/playlist/route.ts b/apps/web/app/api/playlist/route.tsindex 4c2968956..fc474ecc6 100644--- a/apps/web/app/api/playlist/route.ts+++ b/apps/web/app/api/playlist/route.ts@@ -282,9 +282,9 @@ export async function GET(request: NextRequest) {const generatedPlaylist = await generateMasterPlaylist(videoMetadata?.Metadata?.resolution ?? "",videoMetadata?.Metadata?.bandwidth ?? "",- `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${userId}&videoId=${videoId}&videoType=video`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${userId}&videoId=${videoId}&videoType=video`,audioMetadata- ? `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${userId}&videoId=${videoId}&videoType=audio`+ ? `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${userId}&videoId=${videoId}&videoType=audio`: null,video.xStreamInfo ?? "");diff --git a/apps/web/app/api/settings/billing/manage/route.ts b/apps/web/app/api/settings/billing/manage/route.tsindex f0d798530..029af11ce 100644--- a/apps/web/app/api/settings/billing/manage/route.ts+++ b/apps/web/app/api/settings/billing/manage/route.ts@@ -35,7 +35,7 @@ export async function POST(request: NextRequest) {const { url } = await stripe.billingPortal.sessions.create({customer: customerId as string,- return_url: `${process.env.NEXT_PUBLIC_URL}/dashboard/settings/workspace`,+ return_url: `${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/settings/workspace`,});return NextResponse.json(url);}diff --git a/apps/web/app/api/settings/billing/subscribe/route.ts b/apps/web/app/api/settings/billing/subscribe/route.tsindex 233180231..47e385632 100644--- a/apps/web/app/api/settings/billing/subscribe/route.ts+++ b/apps/web/app/api/settings/billing/subscribe/route.ts@@ -61,8 +61,8 @@ export async function POST(request: NextRequest) {customer: customerId as string,line_items: [{ price: priceId, quantity: quantity }],mode: "subscription",- success_url: `${process.env.NEXT_PUBLIC_URL}/dashboard/caps?upgrade=true`,- cancel_url: `${process.env.NEXT_PUBLIC_URL}/pricing`,+ success_url: `${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?upgrade=true`,+ cancel_url: `${process.env.NEXT_PUBLIC_WEB_URL}/pricing`,allow_promotion_codes: true,});diff --git a/apps/web/app/api/settings/workspace/invite/send/route.ts b/apps/web/app/api/settings/workspace/invite/send/route.tsindex 5d689abe3..9b1abab79 100644--- a/apps/web/app/api/settings/workspace/invite/send/route.ts+++ b/apps/web/app/api/settings/workspace/invite/send/route.ts@@ -49,7 +49,7 @@ export async function POST(request: NextRequest) {});// Send invitation email- const inviteUrl = `${process.env.NEXT_PUBLIC_URL}/invite/${inviteId}`;+ const inviteUrl = `${process.env.NEXT_PUBLIC_WEB_URL}/invite/${inviteId}`;await sendEmail({email: email.trim(),subject: `Invitation to join ${space[0].name} on Cap`,diff --git a/apps/web/app/api/upload/mux/create/route.ts b/apps/web/app/api/upload/mux/create/route.tsindex 098947f85..ab471574d 100644--- a/apps/web/app/api/upload/mux/create/route.ts+++ b/apps/web/app/api/upload/mux/create/route.ts@@ -9,7 +9,7 @@ import {} from "@aws-sdk/client-mediaconvert";import { createS3Client, getS3Bucket } from "@/utils/s3";const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","tauri://localhost","http://tauri.localhost",diff --git a/apps/web/app/api/upload/mux/status/route.ts b/apps/web/app/api/upload/mux/status/route.tsindex 685fa5ee8..8254dd9b8 100644--- a/apps/web/app/api/upload/mux/status/route.ts+++ b/apps/web/app/api/upload/mux/status/route.ts@@ -8,7 +8,7 @@ import {} from "@aws-sdk/client-mediaconvert";const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","tauri://localhost","http://tauri.localhost",diff --git a/apps/web/app/api/upload/signed/route.ts b/apps/web/app/api/upload/signed/route.tsindex fd6b78487..b2672eb68 100644--- a/apps/web/app/api/upload/signed/route.ts+++ b/apps/web/app/api/upload/signed/route.ts@@ -157,7 +157,7 @@ export async function POST(request: NextRequest) {const videoId = fileKey.split("/")[1]; // Assuming fileKey format is userId/videoId/...if (videoId) {try {- await fetch(`${process.env.NEXT_PUBLIC_URL}/api/revalidate`, {+ await fetch(`${process.env.NEXT_PUBLIC_WEB_URL}/api/revalidate`, {method: "POST",headers: {"Content-Type": "application/json",diff --git a/apps/web/app/api/video/og/route.tsx b/apps/web/app/api/video/og/route.tsxindex f766429ef..8c69cef80 100644--- a/apps/web/app/api/video/og/route.tsx+++ b/apps/web/app/api/video/og/route.tsx@@ -10,7 +10,7 @@ export async function GET(req: NextRequest) {const videoId = req.nextUrl.searchParams.get("videoId") as string;const response = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/${videoId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/${videoId}`,{method: "GET",headers: {diff --git a/apps/web/app/api/video/playlistUrl/route.ts b/apps/web/app/api/video/playlistUrl/route.tsindex 68d216fd4..d43c7637d 100644--- a/apps/web/app/api/video/playlistUrl/route.ts+++ b/apps/web/app/api/video/playlistUrl/route.ts@@ -75,8 +75,8 @@ export async function GET(request: NextRequest) {return new Response(JSON.stringify({- playlistOne: `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${video.ownerId}&videoId=${video.id}&videoType=video`,- playlistTwo: `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${video.ownerId}&videoId=${video.id}&videoType=audio`,+ playlistOne: `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${video.ownerId}&videoId=${video.id}&videoType=video`,+ playlistTwo: `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${video.ownerId}&videoId=${video.id}&videoType=audio`,}),{status: 200,diff --git a/apps/web/app/blog/[slug]/page.tsx b/apps/web/app/blog/[slug]/page.tsxindex 5f52e0d02..eebd243cd 100644--- a/apps/web/app/blog/[slug]/page.tsx+++ b/apps/web/app/blog/[slug]/page.tsx@@ -23,7 +23,7 @@ export async function generateMetadata({}let { title, publishedAt: publishedTime, description, image } = post.metadata;- let ogImage = `${process.env.NEXT_PUBLIC_URL}${image}`;+ let ogImage = `${process.env.NEXT_PUBLIC_WEB_URL}${image}`;return {title,@@ -33,7 +33,7 @@ export async function generateMetadata({description,type: "article",publishedTime,- url: `${process.env.NEXT_PUBLIC_URL}/blog/${post.slug}`,+ url: `${process.env.NEXT_PUBLIC_WEB_URL}/blog/${post.slug}`,images: [{url: ogImage,diff --git a/apps/web/app/blog/_components/Share.tsx b/apps/web/app/blog/_components/Share.tsxindex 407614402..a20768579 100644--- a/apps/web/app/blog/_components/Share.tsx+++ b/apps/web/app/blog/_components/Share.tsx@@ -13,7 +13,7 @@ interface ShareProps {}export function Share({ post }: ShareProps) {- const shareUrl = `${process.env.NEXT_PUBLIC_URL}/blog/${post.slug}`;+ const shareUrl = `${process.env.NEXT_PUBLIC_WEB_URL}/blog/${post.slug}`;const [copied, setCopied] = useState(false);return (diff --git a/apps/web/app/dashboard/caps/components/CapCard.tsx b/apps/web/app/dashboard/caps/components/CapCard.tsxindex c29a85cd5..d862d28e7 100644--- a/apps/web/app/dashboard/caps/components/CapCard.tsx+++ b/apps/web/app/dashboard/caps/components/CapCard.tsx@@ -46,7 +46,7 @@ export const CapCard: React.FC<CapCardProps> = ({}const response = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/title`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/title`,{method: "PUT",headers: { "Content-Type": "application/json" },@@ -123,7 +123,7 @@ export const CapCard: React.FC<CapCardProps> = ({process.env.NEXT_PUBLIC_IS_CAP &&process.env.NEXT_ENV === "production"? `https://cap.link/${cap.id}`- : `${process.env.NEXT_PUBLIC_URL}/s/${cap.id}`+ : `${process.env.NEXT_PUBLIC_WEB_URL}/s/${cap.id}`}><VideoThumbnaildiff --git a/apps/web/app/dashboard/caps/components/CapCardActions.tsx b/apps/web/app/dashboard/caps/components/CapCardActions.tsxindex 52b825970..13aef8928 100644--- a/apps/web/app/dashboard/caps/components/CapCardActions.tsx+++ b/apps/web/app/dashboard/caps/components/CapCardActions.tsx@@ -15,7 +15,7 @@ export const CapCardActions: React.FC<CapCardActionsProps> = ({const link =process.env.NEXT_PUBLIC_IS_CAP && process.env.NEXT_ENV === "production"? `https://cap.link/${capId}`- : `${process.env.NEXT_PUBLIC_URL}/s/${capId}`;+ : `${process.env.NEXT_PUBLIC_WEB_URL}/s/${capId}`;navigator.clipboard.writeText(link);toast.success("Link copied to clipboard!");diff --git a/apps/web/app/dashboard/caps/components/CapPagination.tsx b/apps/web/app/dashboard/caps/components/CapPagination.tsxindex 5fa272766..f5fa413ba 100644--- a/apps/web/app/dashboard/caps/components/CapPagination.tsx+++ b/apps/web/app/dashboard/caps/components/CapPagination.tsx@@ -23,7 +23,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({{currentPage > 1 && (<PaginationItem><PaginationPrevious- href={`${process.env.NEXT_PUBLIC_URL}/dashboard/caps?page=${+ href={`${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?page=${currentPage - 1}`}/>@@ -31,7 +31,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({)}<PaginationItem><PaginationLink- href={`${process.env.NEXT_PUBLIC_URL}/dashboard/caps?page=1`}+ href={`${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?page=1`}isActive={currentPage === 1}>1@@ -40,7 +40,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({{currentPage !== 1 && (<PaginationItem><PaginationLink- href={`${process.env.NEXT_PUBLIC_URL}/dashboard/caps?page=${currentPage}`}+ href={`${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?page=${currentPage}`}isActive={true}>{currentPage}@@ -50,7 +50,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({{totalPages > currentPage + 1 && (<PaginationItem><PaginationLink- href={`${process.env.NEXT_PUBLIC_URL}/dashboard/caps?page=${+ href={`${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?page=${currentPage + 1}`}isActive={false}@@ -62,7 +62,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({{currentPage > 2 && <PaginationEllipsis />}<PaginationItem><PaginationNext- href={`${process.env.NEXT_PUBLIC_URL}/dashboard/caps?page=${+ href={`${process.env.NEXT_PUBLIC_WEB_URL}/dashboard/caps?page=${currentPage === totalPages ? currentPage : currentPage + 1}`}/>diff --git a/apps/web/app/dashboard/shared-caps/components/SharedCapCard.tsx b/apps/web/app/dashboard/shared-caps/components/SharedCapCard.tsxindex 168f65677..fd4610d6f 100644--- a/apps/web/app/dashboard/shared-caps/components/SharedCapCard.tsx+++ b/apps/web/app/dashboard/shared-caps/components/SharedCapCard.tsx@@ -42,7 +42,7 @@ export const SharedCapCard: React.FC<SharedCapCardProps> = ({process.env.NEXT_PUBLIC_IS_CAP &&process.env.NEXT_ENV === "production"? `https://cap.link/${cap.id}`- : `${process.env.NEXT_PUBLIC_URL}/s/${cap.id}`+ : `${process.env.NEXT_PUBLIC_WEB_URL}/s/${cap.id}`}><VideoThumbnaildiff --git a/apps/web/app/docs/[...slug]/page.tsx b/apps/web/app/docs/[...slug]/page.tsxindex 2f3e361f8..54e6b26f8 100644--- a/apps/web/app/docs/[...slug]/page.tsx+++ b/apps/web/app/docs/[...slug]/page.tsx@@ -48,7 +48,9 @@ export async function generateMetadata(if (!doc) return;const { title, summary, image } = doc.metadata;- const ogImage = image ? `${process.env.NEXT_PUBLIC_URL}${image}` : undefined;+ const ogImage = image+ ? `${process.env.NEXT_PUBLIC_WEB_URL}${image}`+ : undefined;const description = summary || title;return {@@ -58,7 +60,7 @@ export async function generateMetadata(title,description,type: "article",- url: `${process.env.NEXT_PUBLIC_URL}/docs/${fullSlug}`,+ url: `${process.env.NEXT_PUBLIC_WEB_URL}/docs/${fullSlug}`,...(ogImage && {images: [{ url: ogImage }],}),diff --git a/apps/web/app/docs/[slug]/page.tsx b/apps/web/app/docs/[slug]/page.tsxindex 818843ddf..2a51048a0 100644--- a/apps/web/app/docs/[slug]/page.tsx+++ b/apps/web/app/docs/[slug]/page.tsx@@ -19,7 +19,9 @@ export async function generateMetadata({}let { title, summary: description, image } = doc.metadata;- let ogImage = image ? `${process.env.NEXT_PUBLIC_URL}${image}` : undefined;+ let ogImage = image+ ? `${process.env.NEXT_PUBLIC_WEB_URL}${image}`+ : undefined;return {title,@@ -28,7 +30,7 @@ export async function generateMetadata({title,description,type: "article",- url: `${process.env.NEXT_PUBLIC_URL}/docs/${doc.slug}`,+ url: `${process.env.NEXT_PUBLIC_WEB_URL}/docs/${doc.slug}`,...(ogImage && {images: [{diff --git a/apps/web/app/s/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsxindex 5f03177c0..7e9221328 100644--- a/apps/web/app/s/[videoId]/Share.tsx+++ b/apps/web/app/s/[videoId]/Share.tsx@@ -132,7 +132,7 @@ export const Share: React.FC<ShareProps> = ({<div className="mt-auto py-4"><atarget="_blank"- href={`${process.env.NEXT_PUBLIC_URL}?ref=video_${data.id}`}+ href={`${process.env.NEXT_PUBLIC_WEB_URL}?ref=video_${data.id}`}className="flex items-center justify-center space-x-2 py-2 px-4 bg-gray-100 new-card-style rounded-full mx-auto w-fit"><span className="text-sm">Recorded with</span>diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsxindex c4afc690c..388b08122 100644--- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx+++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx@@ -29,7 +29,7 @@ export const ShareHeader = ({const handleBlur = async () => {setIsEditing(false);const response = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/title`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/title`,{method: "PUT",headers: { "Content-Type": "application/json" },@@ -152,7 +152,7 @@ export const ShareHeader = ({);} else {navigator.clipboard.writeText(- `${process.env.NEXT_PUBLIC_URL}/s/${data.id}`+ `${process.env.NEXT_PUBLIC_WEB_URL}/s/${data.id}`);}toast.success("Link copied to clipboard!");@@ -161,14 +161,14 @@ export const ShareHeader = ({{process.env.NEXT_PUBLIC_IS_CAP &&process.env.NODE_ENV === "production"? `cap.link/${data.id}`- : `${process.env.NEXT_PUBLIC_URL}/s/${data.id}`}+ : `${process.env.NEXT_PUBLIC_WEB_URL}/s/${data.id}`}<Copy className="ml-2 h-4 w-4" /></Button>{user !== null && (<div className="hidden md:flex"><ButtononClick={() => {- push(`${process.env.NEXT_PUBLIC_URL}/dashboard`);+ push(`${process.env.NEXT_PUBLIC_WEB_URL}/dashboard`);}}>Go to Dashboarddiff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsxindex 36d515d3a..13cf4320f 100644--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx@@ -465,14 +465,14 @@ export const ShareVideo = forwardRef<let videoSrc: string;if (data.source.type === "desktopMP4") {- videoSrc = `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${data.ownerId}&videoId=${data.id}&videoType=mp4`;+ videoSrc = `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${data.ownerId}&videoId=${data.id}&videoType=mp4`;} else if (// v.cap.so is only available in prodprocess.env.NODE_ENV === "development" ||((data.skipProcessing === true || data.jobStatus !== "COMPLETE") &&data.source.type === "MediaConvert")) {- videoSrc = `${process.env.NEXT_PUBLIC_URL}/api/playlist?userId=${data.ownerId}&videoId=${data.id}&videoType=master`;+ videoSrc = `${process.env.NEXT_PUBLIC_WEB_URL}/api/playlist?userId=${data.ownerId}&videoId=${data.id}&videoType=master`;} else if (data.source.type === "MediaConvert") {videoSrc = `${S3_BUCKET_URL}/${data.ownerId}/${data.id}/output/video_recording_000.m3u8`;} else {diff --git a/apps/web/app/s/[videoId]/_components/Toolbar.tsx b/apps/web/app/s/[videoId]/_components/Toolbar.tsxindex 2c6c04cf3..4511176f1 100644--- a/apps/web/app/s/[videoId]/_components/Toolbar.tsx+++ b/apps/web/app/s/[videoId]/_components/Toolbar.tsx@@ -83,7 +83,7 @@ export const Toolbar = ({console.log("Current timestamp:", timestamp);const response = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/comment`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/comment`,{method: "POST",headers: {diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsxindex 447424fb9..f87c779c1 100644--- a/apps/web/app/s/[videoId]/page.tsx+++ b/apps/web/app/s/[videoId]/page.tsx@@ -73,7 +73,7 @@ export async function generateMetadata(description: "This video is private and cannot be shared.",openGraph: {images: [- `${process.env.NEXT_PUBLIC_URL}/api/video/og?videoId=${videoId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/og?videoId=${videoId}`,],},};@@ -88,7 +88,7 @@ export async function generateMetadata(description: "Watch this video on Cap",openGraph: {images: [- `${process.env.NEXT_PUBLIC_URL}/api/video/og?videoId=${videoId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/og?videoId=${videoId}`,],},};@@ -181,7 +181,7 @@ export default async function ShareVideoPage(props: Props) {) {console.log("[ShareVideoPage] Creating MUX job for video:", videoId);const res = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/upload/mux/create?videoId=${videoId}&userId=${video.ownerId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/upload/mux/create?videoId=${videoId}&userId=${video.ownerId}`,{method: "GET",credentials: "include",@@ -195,7 +195,7 @@ export default async function ShareVideoPage(props: Props) {if (video.transcriptionStatus !== "COMPLETE") {console.log("[ShareVideoPage] Starting transcription for video:", videoId);fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/transcribe?videoId=${videoId}&userId=${video.ownerId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/transcribe?videoId=${videoId}&userId=${video.ownerId}`,{method: "GET",credentials: "include",@@ -231,7 +231,7 @@ export default async function ShareVideoPage(props: Props) {if (video.isScreenshot === true) {console.log("[ShareVideoPage] Fetching screenshot for video:", videoId);const res = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/screenshot?userId=${video.ownerId}&screenshotId=${videoId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/screenshot?userId=${video.ownerId}&screenshotId=${videoId}`,{method: "GET",credentials: "include",@@ -262,7 +262,7 @@ export default async function ShareVideoPage(props: Props) {videoId);const res = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/individual?videoId=${videoId}&userId=${video.ownerId}`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/individual?videoId=${videoId}&userId=${video.ownerId}`,{method: "GET",credentials: "include",diff --git a/apps/web/utils/cors.ts b/apps/web/utils/cors.tsindex 7d5beed4c..e3459ee72 100644--- a/apps/web/utils/cors.ts+++ b/apps/web/utils/cors.ts@@ -1,5 +1,5 @@export const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"http://localhost:3001","http://localhost:3000","tauri://localhost",@@ -8,7 +8,7 @@ export const allowedOrigins = ["https://cap.so","https://www.cap.so","https://cap.link",- "https://www.cap.link"+ "https://www.cap.link",];export function getCorsHeaders(origin: string | null, originalOrigin: string) {@@ -23,11 +23,15 @@ export function getCorsHeaders(origin: string | null, originalOrigin: string) {};}-export function getOptionsHeaders(origin: string | null, originalOrigin: string, methods = "GET, OPTIONS") {+export function getOptionsHeaders(+ origin: string | null,+ originalOrigin: string,+ methods = "GET, OPTIONS"+) {return {...getCorsHeaders(origin, originalOrigin),"Access-Control-Allow-Methods": methods,"Access-Control-Allow-Headers":"Content-Type, Authorization, sentry-trace, baggage",};-}\ No newline at end of file+}diff --git a/apps/web/utils/helpers.ts b/apps/web/utils/helpers.tsindex cd6aa0304..78dabc8f6 100644--- a/apps/web/utils/helpers.ts+++ b/apps/web/utils/helpers.ts@@ -8,7 +8,7 @@ export function classNames(...inputs: ClassValue[]) {}export const allowedOrigins = [- process.env.NEXT_PUBLIC_URL,+ process.env.NEXT_PUBLIC_WEB_URL,"https://cap.link","cap.link",];diff --git a/apps/web/utils/video/ffmpeg/helpers.ts b/apps/web/utils/video/ffmpeg/helpers.tsindex e85108f1e..cc8ca4936 100644--- a/apps/web/utils/video/ffmpeg/helpers.ts+++ b/apps/web/utils/video/ffmpeg/helpers.ts@@ -14,7 +14,7 @@ export const playlistToMp4 = async (}const videoFetch = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/video/playlistUrl?userId=${userId}&videoId=${videoId}`+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/video/playlistUrl?userId=${userId}&videoId=${videoId}`);if (videoFetch.status !== 200) {diff --git a/apps/web/utils/video/upload/helpers.ts b/apps/web/utils/video/upload/helpers.tsindex bcb90c013..e6ca9d281 100644--- a/apps/web/utils/video/upload/helpers.ts+++ b/apps/web/utils/video/upload/helpers.ts@@ -20,7 +20,7 @@ export async function uploadToS3({awsRegion: string;}) {const response = await fetch(- `${process.env.NEXT_PUBLIC_URL}/api/upload/signed`,+ `${process.env.NEXT_PUBLIC_WEB_URL}/api/upload/signed`,{method: "POST",headers: {diff --git a/apps/web/utils/web-api.ts b/apps/web/utils/web-api.tsindex d3f813cbd..126ce89a5 100644--- a/apps/web/utils/web-api.ts+++ b/apps/web/utils/web-api.ts@@ -4,6 +4,6 @@ import { contract } from "@cap/web-api-contract";export const apiClient = initClient(contract, {baseUrl:typeof window !== "undefined"- ? `${process.env.NEXT_PUBLIC_URL}/api`+ ? `${process.env.NEXT_PUBLIC_WEB_URL}/api`: "/api",});diff --git a/package.json b/package.jsonindex b4f33468a..bdee5c41c 100644--- a/package.json+++ b/package.json@@ -5,6 +5,7 @@"db:studio": "dotenv -e .env -- pnpm --dir packages/database db:studio","dev": "(pnpm run docker:up > /dev/null &) && sleep 5 && trap 'pnpm run docker:stop' EXIT && dotenv -e .env -- turbo run dev --env-mode=loose --ui tui","dev:web": "pnpm dev --filter=!@cap/desktop",+ "dev:desktop": "pnpm turbo run dev --filter=@cap/desktop","dev:manual": "pnpm run docker:up && trap 'pnpm run docker:stop' EXIT && dotenv -e .env -- turbo run dev --filter=!@cap/storybook --no-cache --concurrency 1","lint": "turbo run lint","format": "prettier --write \"**/*.{ts,tsx,md}\"",diff --git a/packages/database/auth/auth-options.ts b/packages/database/auth/auth-options.tsindex fc3cd1c2b..c2069d453 100644--- a/packages/database/auth/auth-options.ts+++ b/packages/database/auth/auth-options.ts@@ -14,10 +14,7 @@ export const config = {maxDuration: 120,};-const secret =- process.env.NODE_ENV === "development"- ? process.env.NEXTAUTH_SECRET_DEV- : process.env.NEXTAUTH_SECRET;+const secret = process.env.NEXTAUTH_SECRET;export const authOptions: NextAuthOptions = {adapter: DrizzleAdapter(db),diff --git a/packages/database/emails/config.ts b/packages/database/emails/config.tsindex 3fcf86446..21c778370 100644--- a/packages/database/emails/config.ts+++ b/packages/database/emails/config.ts@@ -28,7 +28,7 @@ export const sendEmail = async ({? "Richie from Cap.so <[email protected]>": process.env.NEXT_PUBLIC_IS_CAP? "Cap Auth <[email protected]>"- : `auth@${process.env.NEXT_PUBLIC_URL}`,+ : `auth@${process.env.NEXT_PUBLIC_WEB_URL}`,to: test ? "[email protected]" : email,subject,react,diff --git a/packages/database/index.ts b/packages/database/index.tsindex 96a1e3053..cbd1941d9 100644--- a/packages/database/index.ts+++ b/packages/database/index.ts@@ -5,10 +5,7 @@ const URL = process.env.DATABASE_URL!;let fetchHandler: Promise<Config["fetch"]> | undefined = undefined;-if (- process.env.NEXT_PUBLIC_ENVIRONMENT === "development" &&- URL.startsWith("mysql://")-) {+if (process.env.NODE_ENV === "development" && URL.startsWith("mysql://")) {fetchHandler = import("@mattrax/mysql-planetscale").then((m) =>m.createFetchHandler(URL));diff --git a/packages/utils/src/constants/plans.ts b/packages/utils/src/constants/plans.tsindex 48569a46e..31b797f2b 100644--- a/packages/utils/src/constants/plans.ts+++ b/packages/utils/src/constants/plans.ts@@ -10,7 +10,7 @@ const planIds = {};export const getProPlanId = (billingCycle: "yearly" | "monthly") => {- const value = process.env.NEXT_PUBLIC_ENVIRONMENT;+ const value = process.env.NODE_ENV;const environment = value === "development" ? "development" : "production";return planIds[environment]?.[billingCycle] || "";