Skip to content

Commit 3e76f7e

Browse files
authored
docs: add Supabase deployment screenshots and improve configuration instructions (#541)
# Add Supabase deployment documentation with screenshots This PR enhances the Supabase deployment documentation by: - Adding screenshots showing where to find the Project ID and service_role key in the Supabase dashboard - Improving clarity in the configuration steps with more precise instructions - Highlighting replaceable values in code blocks for better user guidance - Removing the troubleshooting section from the configure-secrets page (will be moved to a dedicated troubleshooting guide) - Reordering the deployment steps in the index page to put "Configure Secrets" before "Deploy First Flow" - Making terminology consistent across documentation pages These changes make the deployment process more visual and easier to follow for users setting up pgflow with Supabase.
1 parent a46125a commit 3e76f7e

File tree

5 files changed

+18
-52
lines changed

5 files changed

+18
-52
lines changed
29.7 KB
Loading
57.5 KB
Loading

pkgs/website/src/content/docs/deploy/supabase/configure-secrets.mdx

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,22 @@ pgflow needs vault secrets to automatically manage workers in production.
1111

1212
<Steps>
1313

14-
1. ### Get your project ID
15-
16-
{/* SCREENSHOT PLACEHOLDER:
17-
Supabase Dashboard -> Project Settings -> General
18-
Highlight/arrow pointing to "Reference ID" field
19-
Show the alphanumeric project ID value
20-
*/}
14+
1. ### Get your Project ID
2115

2216
1. Open [Supabase Dashboard](https://supabase.com/dashboard)
2317
2. Select your project
2418
3. Go to **Project Settings** -> **General**
25-
4. Copy the **Reference ID**
19+
4. Copy the **Project ID**
20+
21+
![Project Settings showing the Project ID field](../../../../assets/deploy/supabase/04-project-id.png)
2622

2723
2. ### Get your service role key
2824

29-
{/* SCREENSHOT PLACEHOLDER:
30-
Supabase Dashboard -> Project Settings -> API
31-
Highlight/arrow pointing to service_role key (the secret one, not anon)
32-
Maybe blur/redact the actual key value for security
33-
*/}
25+
1. Go to **Project Settings** -> **API Keys**
26+
2. Click the **Legacy anon, service_role API keys** tab
27+
3. Find `service_role` (labeled "secret") and click **Copy**
3428

35-
1. Go to **Project Settings** -> **API**
36-
2. Under **Project API keys**, find `service_role` (labeled "secret")
37-
3. Click to reveal and copy the key
29+
![API Keys page showing the service_role key](../../../../assets/deploy/supabase/05-service-role-key.png)
3830

3931
<Aside type="caution">
4032
Keep this key secret - it bypasses Row Level Security.
@@ -44,37 +36,11 @@ pgflow needs vault secrets to automatically manage workers in production.
4436

4537
Run in the SQL Editor:
4638

47-
```sql
39+
```sql "your-project-id" "your-service-role-key"
4840
SELECT vault.create_secret('your-project-id', 'supabase_project_id');
4941
SELECT vault.create_secret('your-service-role-key', 'supabase_service_role_key');
5042
```
5143

52-
Replace with your actual values from steps 1 and 2.
44+
Replace the highlighted values with your actual Project ID and service role key from steps 1 and 2.
5345

5446
</Steps>
55-
56-
## Troubleshooting
57-
58-
### Workers not starting automatically?
59-
60-
Verify vault secrets are configured:
61-
62-
```sql
63-
SELECT name,
64-
CASE WHEN decrypted_secret IS NOT NULL THEN 'SET' ELSE 'MISSING' END as status
65-
FROM vault.decrypted_secrets
66-
WHERE name IN ('supabase_service_role_key', 'supabase_project_id');
67-
```
68-
69-
Both should show `SET`.
70-
71-
### Test the cron manually
72-
73-
```sql
74-
SELECT * FROM pgflow.ensure_workers();
75-
```
76-
77-
Returns one row per worker function invoked. If empty but you have enabled workers:
78-
79-
1. Check secrets (query above)
80-
2. Check registered workers: `SELECT * FROM pgflow.worker_functions WHERE enabled = true;`

pkgs/website/src/content/docs/deploy/supabase/deploy-first-flow.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ This guide walks you through deploying your pgflow worker to Supabase.com produc
2323

2424
Workers access the database through the `EDGE_WORKER_DB_URL` environment variable:
2525

26-
```bash frame="none"
26+
```bash frame="none" "your-connection-string"
2727
npx supabase secrets set EDGE_WORKER_DB_URL="your-connection-string"
2828
```
2929

3030
2. ### Deploy your worker
3131

3232
Deploy your Edge Function to Supabase:
3333

34-
```bash frame="none"
34+
```bash frame="none" "your-worker-name"
3535
npx supabase functions deploy your-worker-name
3636
```
3737

38-
Replace `your-worker-name` with your actual worker function name (e.g., `greet-user-worker`).
38+
Replace the highlighted value with your actual worker function name (e.g., `greet-user-worker`).
3939

4040
<Aside type="note">
4141
You only need to deploy your worker functions. The `pgflow` ControlPlane function is for local compilation only and is not needed in production.
@@ -45,7 +45,7 @@ This guide walks you through deploying your pgflow worker to Supabase.com produc
4545

4646
Register your worker so pgflow can manage it automatically:
4747

48-
```sql
48+
```sql "your-worker-name"
4949
SELECT pgflow.track_worker_function('your-worker-name');
5050
```
5151

pkgs/website/src/content/docs/deploy/supabase/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ Before starting, ensure you have completed [Getting Started](/get-started/instal
1818

1919
Retrieve the Transaction pooler connection string from your Supabase dashboard. Workers use this to connect to your hosted database securely.
2020

21-
2. ### Deploy First Flow
21+
2. ### Configure Secrets
2222

23-
Store the connection string as a secret, deploy your worker Edge Function, and invoke it to start processing tasks.
23+
Set up vault secrets so pgflow can automatically manage and restart your workers in production.
2424

25-
3. ### Keep Workers Running
25+
3. ### Deploy First Flow
2626

27-
Configure pg_cron to periodically invoke your worker. This acts as a safety net - if a worker stops unexpectedly, pg_cron restarts it automatically.
27+
Store the connection string as a secret, deploy your worker Edge Function, and register it with pgflow.
2828

2929
</Steps>
3030

0 commit comments

Comments
 (0)