Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 9 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down