Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DrDigett/Babel/llms.txt

Use this file to discover all available pages before exploring further.

BaBel+ ships with a render.yaml Blueprint that provisions a Node.js web service and a managed PostgreSQL database on Render’s free tier in a single click. No manual service wiring is required — Render reads the Blueprint, creates both resources, and automatically injects the database connection string into the web service’s environment.

render.yaml

The Blueprint file at the repository root defines the full infrastructure:
render.yaml
services:
  - type: web
    name: babel-plus-api
    runtime: node
    plan: free
    buildCommand: npm ci --include=dev && npm run build
    startCommand: npm start
    healthCheckPath: /api/health
    envVars:
      - key: NODE_ENV
        value: production
      - key: DATABASE_URL
        fromDatabase:
          name: babel-plus-db
          property: connectionString
      - key: CORS_ORIGIN
        value: "*"
      - key: JWT_SECRET
        generateValue: true
      - key: GROQ_API_KEY
        value: placeholder

databases:
  - name: babel-plus-db
    databaseName: babel
    plan: free
What each block does:
BlockPurpose
services[0]The babel-plus-api Node.js web service that runs the Hono server and serves the compiled React SPA as static files in production.
buildCommandInstalls all dependencies (including devDependencies for TypeScript compilation) then runs npm run build to compile both the server and client packages.
startCommandRuns npm start, which calls tsx src/index.ts in the server package — applying migrations and seeding before the HTTP server begins listening.
healthCheckPathRender polls GET /api/health to determine service health. The endpoint returns {"status":"ok"}.
DATABASE_URLAutomatically populated from the babel-plus-db managed database’s connection string — no manual copy-pasting required.
JWT_SECRETAuto-generated by Render on first deploy, ensuring a unique secret per deployment.
GROQ_API_KEYSet to placeholder in the Blueprint; you must replace this with your real key before the AI endpoints will function (see Step 4 below).
databases[0]Provisions a free-tier Render PostgreSQL instance named babel-plus-db with a database called babel.

Deploy steps

1

Fork or push the repository to your GitHub account

Render Blueprints require access to a GitHub (or GitLab) repository. Fork https://github.com/DrDigett/Babel to your account, or push a local clone to a new repository you control.
2

Create a new Blueprint on Render

In the Render dashboard, click New → Blueprint and connect your GitHub account if you haven’t already. Select the forked or pushed BaBel+ repository from the list.
3

Render provisions the services automatically

Render reads render.yaml from the repository root and creates two resources in parallel:
  • babel-plus-api — the Node.js web service.
  • babel-plus-db — the managed PostgreSQL database.
The DATABASE_URL is wired between them automatically via the fromDatabase reference; you do not need to copy the connection string manually.
4

Add your Groq API key

The Blueprint sets GROQ_API_KEY to placeholder as a safe default. Before triggering a deploy, update this value:
  1. Open the babel-plus-api service in the Render dashboard.
  2. Navigate to EnvironmentEnvironment Variables.
  3. Find GROQ_API_KEY and replace placeholder with your real key (starts with gsk_).
  4. Save the changes.
Get a free Groq API key at https://console.groq.com.
5

Trigger a deploy

Click Manual Deploy → Deploy latest commit (or push a new commit to trigger an automatic deploy). Render will run the build command:
npm ci --include=dev && npm run build
This compiles both the server TypeScript and the Vite client bundle. Build output for the SPA lands in packages/client/dist.
6

First-start bootstrap

On the first start, the Hono server’s bootstrap() function runs automatically and:
  1. Runs migrations — creates the nodes, relations, lists, and list_nodes tables via raw SQL (CREATE TABLE IF NOT EXISTS).
  2. Seeds the database — if the nodes table is empty, inserts ~20 philosophy and film nodes with pre-built relations.
  3. Starts the HTTP server — binds to 0.0.0.0 on the configured port and begins serving the React SPA from packages/client/dist (because NODE_ENV=production).
Once the health check at GET /api/health returns {"status":"ok"}, Render marks the service as live and your BaBel+ instance is publicly accessible.

Health check

The Hono server exposes a lightweight health endpoint that Render polls continuously:
curl https://your-service.onrender.com/api/health
{"status":"ok"}
Render uses healthCheckPath: /api/health to decide whether to route traffic to a newly deployed instance and to detect crashes in running instances.
Free PostgreSQL databases on Render expire after 90 days. After expiry the database and all its data are deleted permanently. For any data you care about, upgrade to a paid Render database plan or supply your own DATABASE_URL pointing to a managed PostgreSQL provider (e.g. Supabase, Neon, or AWS RDS) before the 90-day window closes.

Manual / self-hosted deployment

You can run BaBel+ on any machine with Node.js ≥ 18 and access to a PostgreSQL database, without Render.
1

Set environment variables

Export the required variables in your shell or create a packages/server/.env file:
DATABASE_URL=postgresql://user:password@your-host:5432/babel
GROQ_API_KEY=gsk_...
JWT_SECRET=a-long-random-secret
NODE_ENV=production
PORT=3000
CORS_ORIGIN=https://your-domain.com
2

Build all packages

From the monorepo root, compile the server TypeScript and bundle the React client:
npm ci --include=dev && npm run build
This runs tsc for the server and vite build for the client. The client bundle is emitted to packages/client/dist.
3

Start the server

npm start
This runs tsx src/index.ts inside @babel-plus/server. Because NODE_ENV=production, the Hono server automatically serves the React SPA from packages/client/dist for any request that doesn’t match an /api/* route — no separate static file server or reverse proxy required.
For process management in production, consider running npm start under PM2 or as a systemd service so the process restarts automatically on crash or reboot.

Build docs developers (and LLMs) love