Onlook 中文网

手动设置环境变量(可选)

🌐 Set up environment variables manually (optional)

1. 在 apps/web/client

🌐 1. In apps/web/client

apps/web/client 目录下创建一个 .env.example 文件的副本,并命名为 .env。用你自己的 API 密钥填写其中的值。

🌐 Create a copy of the .env.example file under the apps/web/client directory and name it .env. Fill in the values with your own API keys.

它应该看起来像这样:

🌐 It should look like this:

# ------------- Required Keys -------------

# Supabase - Enables our backend such as database and auth
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY="<Fill in from content after running supabase start>"
SUPABASE_DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
SUPABASE_SERVICE_ROLE_KEY="<Your Supabase service role key>"

# OpenRouter - Enables AI chat. Other providers are optional below
OPENROUTER_API_KEY="<Your api key from https://openrouter.ai/settings/keys>"

# Codesandbox - Used to host user apps. Other providers may be supported in the future. May be optional in the future.
CSB_API_KEY="<Your api key from https://codesandbox.io/t/api>"
2. 在 packages/db

🌐 2. In packages/db

packages/db 目录下创建一个 .env.example 文件的副本,并将其命名为 .env。将值填入 bun backend:start 命令输出的值。

🌐 Create a copy of the .env.example file under the packages/db directory and name it .env. Fill in the values with the values from the output of the bun backend:start command.

SUPABASE_DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
SUPABASE_URL=http://localhost:54321
SUPABASE_SERVICE_ROLE_KEY=<Your service role key from Supabase>