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+‘s server reads all configuration exclusively from environment variables, loaded via dotenv in development and injected directly by the hosting platform (e.g., Render) in production. To get started locally, copy the example template to create your own env file:
cp packages/server/.env.example packages/server/.env

.env.example

packages/server/.env.example covers the optional variables and placeholders for the required ones. Note that DATABASE_URL is not included in the example file — you must add it manually since it contains your database credentials.
# Required: Groq API key for AI classification features
# Get one at https://console.groq.com
GROQ_API_KEY=

# Optional: Database path (default: data/babel.db)
DB_PATH=data/babel.db

# Optional: Server port (default: 3000)
PORT=3000

# Optional: CORS origin (default: *, set to your Vercel URL in production)
CORS_ORIGIN=*

# Optional: JWT secret for auth (default: dev-only fallback)
JWT_SECRET=

# Optional: Node environment (default: development)
NODE_ENV=development
The root .env.example (monorepo root) documents the client-side variable VITE_API_URL alongside GROQ_API_KEY and JWT_SECRET. See VITE_API_URL below for details.

Variables

Only DATABASE_URL and GROQ_API_KEY are truly required. If either is missing, the server throws a descriptive error at startup and refuses to start — no silent failures.
DATABASE_URL
string
required
PostgreSQL connection string used by Drizzle ORM to connect to the database. If absent, the server throws:
Missing required env DATABASE_URL. PostgreSQL connection string. Create a free DB at https://render.com or use local postgres
DATABASE_URL=postgresql://user:password@localhost:5432/babel
For a free cloud database, see Render PostgreSQL or Neon.
GROQ_API_KEY
string
required
API key for the Groq inference service, used to power AI node classification. If absent, the server throws:
Missing required env GROQ_API_KEY. Get one at https://console.groq.com
Obtain a key at https://console.groq.com.
GROQ_API_KEY=gsk_...
PORT
number
default:"3000"
The port on which the Hono HTTP server listens. Change this if port 3000 is already in use on your machine or if your hosting provider assigns a specific port.
PORT=8080
CORS_ORIGIN
string
default:"*"
The allowed CORS origin returned in Access-Control-Allow-Origin headers. The wildcard default * is convenient for development but should be narrowed to your frontend URL in production.
# Production example
CORS_ORIGIN=https://my-babel.onrender.com
JWT_SECRET
string
default:"dev-secret-change-in-production"
Secret used for signing JWT tokens. Authentication is not yet implemented in the current version of BaBel+, but this secret will be used once auth is added. The default value is intentionally insecure and must be replaced in production.
JWT_SECRET=a-long-random-string-at-least-32-chars
NODE_ENV
string
default:"development"
Controls the server’s runtime mode. When set to production, the Hono server serves the pre-built React SPA from packages/client/dist as static assets. In development, Vite handles the frontend on its own dev server and proxies /api/* requests to the Hono server on port 3000.
NODE_ENV=production
DB_PATH
string
default:"data/babel.db"
Legacy path for SQLite storage from an earlier version of BaBel+. This variable is read by config.ts but is unused in the current PostgreSQL implementation. You can safely omit it.
VITE_API_URL
string
Client-side only — not read by the server. Set in the monorepo root .env or the client package to tell the Vite dev server where to proxy API requests. Defaults to http://localhost:3000 in local development. In a production Render deployment where the frontend and API share the same domain this variable is not needed.
VITE_API_URL=http://localhost:3000
Never use the default JWT_SECRET in production. The value dev-secret-change-in-production is publicly known and provides no security. Generate a strong random secret before deploying — for example:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Development vs Production

Development

In development, the monorepo runs two processes side by side: the Hono API server and the Vite dev server for the React client.
1

Create your env file

Copy packages/server/.env.example to packages/server/.env and fill in DATABASE_URL and GROQ_API_KEY.
2

Start both servers

From the monorepo root, run:
npm run dev
This uses concurrently to start @babel-plus/server (Hono on port 3000) and @babel-plus/client (Vite on its default port 5173) simultaneously.
3

Access the app

Open the Vite dev server URL (typically http://localhost:5173). Vite proxies all /api/* requests to http://localhost:3000, so the client and server communicate transparently.

Production

In production, the server process handles both the API and static file serving for the React SPA.
1

Set production variables

Ensure NODE_ENV=production, a strong JWT_SECRET, and a production CORS_ORIGIN are set in your environment. On Render, these are configured in the service’s Environment tab — no .env file is needed.
2

Build all packages

npm run build
This runs tsc for the server and Vite’s production build for the client, writing the compiled SPA to packages/client/dist.
3

Start the server

npm start
The Hono server starts on PORT, serves /api/* routes, and serves the React SPA from packages/client/dist for all other requests.

Build docs developers (and LLMs) love