diff --git a/README.md b/README.md index 8d4bb17..b9183f8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Sandbox is an open-source cloud-based code editing environment with custom AI co Check out the [Twitter thread](https://x.com/ishaandey_/status/1796338262002573526) with the demo video! +Check out this [guide](https://dev.to/jamesmurdza/how-to-setup-ishaan1013sandbox-locally-503p) made by [@jamesmurdza](https://x.com/jamesmurdza) on setting it up locally! + ## Running Locally ### Frontend diff --git a/backend/database/wrangler.example.toml b/backend/database/wrangler.example.toml index 2253c4c..6e51663 100644 --- a/backend/database/wrangler.example.toml +++ b/backend/database/wrangler.example.toml @@ -6,11 +6,14 @@ compatibility_flags = ["nodejs_compat"] services = [{ binding = "STORAGE", service = "storage" }] +# Create a new D1 database using the Wrangler CLI and fill in database_name and database_id. [[d1_databases]] binding = "DB" database_name = "" database_id = "" +# Set STORAGE_WORKER_URL after deploying the worker. +# Set KEY to be the same as KEY in /backend/storage/wrangler.toml. [vars] KEY = "" STORAGE_WORKER_URL = "" diff --git a/backend/server/.env.example b/backend/server/.env.example index d9c3433..488783c 100644 --- a/backend/server/.env.example +++ b/backend/server/.env.example @@ -1,2 +1,7 @@ +# Set WORKERS_KEY to be the same as KEY in /backend/storage/wrangler.toml. +# Set DATABASE_WORKER_URL and STORAGE_WORKER_URL after deploying the workers. + PORT=4000 -WORKERS_KEY= \ No newline at end of file +WORKERS_KEY= +DATABASE_WORKER_URL= +STORAGE_WORKER_URL= diff --git a/backend/storage/wrangler.example.toml b/backend/storage/wrangler.example.toml index 9ac7ba2..5b1d4e0 100644 --- a/backend/storage/wrangler.example.toml +++ b/backend/storage/wrangler.example.toml @@ -4,13 +4,16 @@ main = "src/index.ts" compatibility_date = "2024-04-05" compatibility_flags = ["nodejs_compat"] +# Fill in the account ID from the Cloudflare dashboard below. account_id = "" workers_dev = true +# Deploy an R2 bucket from the Cloudflare dashboard and fill in bucket_name. [[r2_buckets]] binding = 'R2' bucket_name = '' preview_bucket_name = '' +# KEY is required but can be set to any secret string. [vars] KEY = '' diff --git a/frontend/.env.example b/frontend/.env.example index dbf5621..e6a58a9 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -6,8 +6,11 @@ LIVEBLOCKS_SECRET_KEY= NEXT_PUBLIC_SERVER_PORT=4000 NEXT_PUBLIC_APP_URL=http://localhost:3000 +# Set WORKER_URLs after deploying the workers. +# Set NEXT_PUBLIC_WORKERS_KEY to be the same as KEY in /backend/storage/wrangler.toml. NEXT_PUBLIC_DATABASE_WORKER_URL= NEXT_PUBLIC_STORAGE_WORKER_URL= +NEXT_PUBLIC_WORKERS_KEY= NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up