@@ -103,7 +103,48 @@ It feels like:
103103| Storage | LocalStorage |
104104
105105---
106+ ## 🚀 Backend Deployment & BACKEND_URL Setup
106107
108+ > ⚠️ The frontend is deployed on Netlify, but the Flask backend is ** not yet deployed** .
109+ > Google Sign-In and all AI features require the backend to be running.
110+
111+ ### Why is this needed?
112+ When a user clicks "Sign in with Google", the browser sends a request to ` /api/v1/auth/google ` .
113+ Netlify needs to know where to forward that request, that's what ` BACKEND_URL ` is for.
114+ Without it, Netlify has no rule for ` /api/v1/* ` and shows a 404 error.
115+
116+ ### Step 1 — Deploy the Flask backend
117+
118+ You can deploy the backend (located in the ` /backend ` folder) to either:
119+
120+ | Platform | Free Tier | Docs |
121+ | ---| ---| ---|
122+ | [ Render] ( https://render.com ) | ✅ Yes | [ Render Python Docs] ( https://render.com/docs/deploy-flask ) |
123+ | [ Railway] ( https://railway.app ) | ✅ Yes | [ Railway Docs] ( https://docs.railway.app ) |
124+
125+ After deploying, you'll get a public URL like:
126+ https://your-app.onrender.com
127+
128+ ### Step 2 — Set BACKEND_URL in Netlify
129+
130+ 1 . Go to [ Netlify Dashboard] ( https://app.netlify.com )
131+ 2 . Open your site → ** Site Configuration → Environment Variables**
132+ 3 . Click ** Add a variable**
133+ 4 . Set:
134+ - ** Key:** ` BACKEND_URL `
135+ - ** Value:** ` https://your-app.onrender.com ` * (no trailing slash)*
136+ 5 . Click ** Save**
137+
138+ ### Step 3 — Redeploy the Netlify site
139+
140+ After setting the variable:
141+ 1 . Go to ** Deploys** tab in your Netlify dashboard
142+ 2 . Click ** Trigger deploy → Deploy site**
143+ 3 . This reruns ` build_netlify.py ` , which picks up ` BACKEND_URL ` and adds the proxy rule to ` _redirects `
144+
145+ After this, "Sign in with Google" will correctly reach the Flask backend. ✅
146+
147+ ---
107148## 🧠 System Architecture
108149
109150``` mermaid
0 commit comments