Skip to content

Restore hosted backend configuration#1

Open
alizahh-7 wants to merge 1 commit into
umaima06:mainfrom
alizahh-7:codex/render-recovery-migration
Open

Restore hosted backend configuration#1
alizahh-7 wants to merge 1 commit into
umaima06:mainfrom
alizahh-7:codex/render-recovery-migration

Conversation

@alizahh-7

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 13, 2026 05:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores hosted deployment configuration by migrating the expired Railway backend to Render (via Docker-based services) and updating the frontend/backend to use environment-driven base URLs for the backend and AI services.

Changes:

  • Add a Render Blueprint (render.yaml) plus Dockerfiles/env examples for backend/ (Node/Express) and ai/ (Flask/Gunicorn).
  • Centralize frontend API base URL handling (frontend/src/config/api.js) and update pages/components to use it instead of hardcoded URLs.
  • Update backend/AI CORS configuration and backend integration points (AI base URL, Twilio webhook base URL, Firebase Admin credential loading).

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
render.yaml Adds Render Blueprint for backend + AI services and env var wiring.
frontend/src/pages/VolunteerPortal.jsx Switches task update call to environment-based API helper.
frontend/src/pages/Volunteer.jsx Switches volunteer registration call to environment-based API helper.
frontend/src/pages/PredictiveAlerts.jsx Switches predictive alerts call to environment-based API helper.
frontend/src/pages/Landing.jsx Switches start-call endpoint to environment-based API helper.
frontend/src/pages/Intake.jsx Switches AI analyze call to shared AI URL helper.
frontend/src/pages/Dashboard.jsx Replaces deprecated Google Maps Marker usage with Advanced Markers; adds mapId/libraries.
frontend/src/pages/Analytics.jsx Switches analytics call to environment-based API helper.
frontend/src/firebase.js Allows overriding Firebase web config via VITE_FIREBASE_* env vars with fallbacks.
frontend/src/config/api.js Introduces shared API_BASE/AI_BASE and apiUrl/aiUrl helpers.
frontend/src/components/Chatbot.jsx Switches chatbot backend call to environment-based API helper.
frontend/.env.example Adds documented Vite env vars for backend/AI URLs and Maps/Firebase settings.
docs/render-migration.md Documents the Render migration approach, env vars, and verification steps.
docs/deployment-checklist.md Adds a step-by-step deployment checklist for Render + Firebase Hosting.
backend/package.json Adds a start script for hosted execution.
backend/index.js Adds CORS allowlist, Firebase credential loading from env, hosted base URL config, and updates AI/Twilio URL usage.
backend/Dockerfile Adds Docker build/run definition for backend service.
backend/.env.example Documents required backend env vars for local + hosted deployments.
ai/requirements.txt Adds gunicorn dependency for production serving.
ai/Dockerfile Adds Docker build/run definition for AI service using gunicorn.
ai/app.py Tightens CORS origin allowlist and makes debug mode env-controlled.
ai/.env.example Documents AI service env vars (port, CORS, API keys).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread render.yaml
Comment on lines +6 to +8
rootDir: backend
healthCheckPath: /
envVars:
Comment thread backend/index.js
Comment on lines +31 to +38
app.use(cors({
origin(origin, callback) {
if (!origin || allowedOrigins.includes(origin)) return callback(null, true);
return callback(new Error(`CORS blocked origin: ${origin}`));
},
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization']
}));
Comment thread backend/index.js
Comment on lines 1998 to 2002
actions: [
{
label: "Open Intake Form",
link: `${baseUrl}/intake?msg=${encodeURIComponent(message)}`
link: `${frontendUrl}/intake?msg=${encodeURIComponent(message)}`
},
Comment on lines 35 to 39
const fullText = `${form.need_type ? form.need_type + ': ' : ''}${form.message}. Location: ${form.location}`

const AI_BASE = import.meta.env.VITE_AI_URL

const aiRes = await fetch(`${AI_BASE}/analyze`, {
const aiRes = await fetch(aiUrl('/analyze'), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants