From 762cc58100ddc4993c5e232dff662faa853b82f4 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Dec 2026 22:41:29 +0000 Subject: [PATCH] Show which features are on at /api/config, and add deploy tips Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015gMv7X1AC2vjmPfJbJC2Wq --- README.md | 4 ++-- server.js | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8ed2794..1e5f735 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,9 @@ Render runs the app, and Supabase stores accounts, calendars and photos. Render' 1. **Supabase.** Create a free project at supabase.com. Open **SQL Editor**, paste in [`deploy/supabase.sql`](deploy/supabase.sql), and click **Run**. Then go to **Project Settings**: - copy the **Project URL** (it looks like `https://abcd.supabase.co`), and - under **API Keys**, copy the **secret** key (older projects call it `service_role`). Keep this one private. It goes only into Render, never in the code or chat. -2. **Render.** Sign in to render.com with GitHub. Click **New › Blueprint**, pick this repo, and Render reads [`render.yaml`](render.yaml). It asks for each key: paste `GOOGLE_CLIENT_ID`, `SUPABASE_URL`, `SUPABASE_SECRET_KEY`, `GEMINI_API_KEY`, `YOUTUBE_API_KEY` and `BRAVE_API_KEY`. `SESSION_SECRET` is made for you. Click **Apply**. +2. **Render.** Sign in to render.com with GitHub. Click **New › Blueprint**, pick this repo, and Render reads [`render.yaml`](render.yaml). It asks for each key: paste `GOOGLE_CLIENT_ID`, `SUPABASE_URL`, `SUPABASE_SECRET_KEY`, `GEMINI_API_KEY`, `YOUTUBE_API_KEY` and `BRAVE_API_KEY`. `SESSION_SECRET` is made for you. Click **Apply**. (Missed a key? Open the service's **Environment** page and add it, or add a **Secret File** named `.env` with the contents of your `.env`. Then save and redeploy.) 3. **Google sign-in.** When Render shows your address (like `https://elf-on-the-shelf.onrender.com`), open your OAuth client in Google Cloud, add that address under **Authorized JavaScript origins**, and save. If the client's Audience is still "Testing", only the people listed as test users can sign in; publish the app there to let anyone sign in. -4. Open the address. The Render log should say "Planners are saved in Supabase." +4. Open the address. The Render log should say "Planners are saved in Supabase." You can also open `/api/config` on your address to see which features are on (it never shows key values). Photos are shrunk to about 50 KB each, and each person can keep up to 120 photos (about 6 MB), so the free Supabase database (500 MB) holds many families. diff --git a/server.js b/server.js index 18537bc..7c6e4ae 100644 --- a/server.js +++ b/server.js @@ -101,7 +101,15 @@ async function api(req, res, url) { const route = req.method + " " + url.pathname; if (route === "GET /api/config") { - return json(res, 200, { googleClientId: process.env.GOOGLE_CLIENT_ID || null, ai: Boolean(process.env.GEMINI_API_KEY) }); + return json(res, 200, { + googleClientId: process.env.GOOGLE_CLIENT_ID || null, + ai: Boolean(process.env.GEMINI_API_KEY), + // Which features are switched on, so a quick look at /api/config shows what's missing. No key values. + storage: accounts.storageName(), + stayingSignedIn: Boolean(process.env.SESSION_SECRET), + youtube: Boolean(process.env.YOUTUBE_API_KEY), + pinterestAndBlogs: Boolean(process.env.BRAVE_API_KEY) + }); } if (route === "GET /api/me") return json(res, 200, { user: user && { name: user.name, email: user.email, picture: user.picture } }); if (route === "POST /api/login") {