The Zero-Cost
Community Manual

How we built a professional, scalable infrastructure for GanitSūtram using the "Golden Quadrilateral" of modern cloud providers—globally, for $0/month.

🏛️ Architecture Overview

We use a decentralized architecture to leverage the best-in-class free tiers of several specialized providers. This ensures maximum performance without overhead.

Database

Supabase (PostgreSQL) - Persistent storage with built-in connection pooling.

Backend API

Render (Node.js) - Auto-deployment from GitHub with robust health monitoring.

Frontend UI

Cloudflare Pages - Global Edge CDN with zero-latency static hosting.

Orchestration

GitHub - The source of truth and automated CI/CD pipeline.

🌍 Step 1: Database (Supabase)

Crucial Tip Use the Session Pooler (Port 5432) for your production string. This prevents your Express app from overwhelming the database during traffic spikes.

⚡ Step 2: Backend (Render)

☁️ Step 3: Frontend (Cloudflare Pages)

Cloudflare Pages is the secret weapon for lightning-fast performance. Be careful not to use "Workers" for static files.

Correct Settings Build Output Directory: websites
This ensures your entire website's structure is served starting from the websites folder.

🧩 Step 4: Connecting the Dots

Your code must be smart enough to know where it's running. Use a dynamic configuration pattern.

const API_BASE = window.location.hostname === 'localhost'
   ? 'http://localhost:3000/api'
   : 'https://ganitsutram.onrender.com/api';

Ensure your backend CORS settings allow requests from your Cloudflare domain.

"Ancient Wisdom. Modern Implementation."

Created by Jawahar R. Mallah | AITDL