This guide outlines steps to deploy the Ledger AI application in production, keep the backend active, and launch local environments.
Migration Note: The backend has been migrated from Rust to Node.js/Express. Authentication has been migrated from Firebase to Supabase. See Supabase Setup Guide for Supabase configuration.
Configure the web app on Netlify using the following settings:
- Repository:
LedgerAI - Branch to Deploy:
main - Build Command:
npm run build - Publish Directory:
dist - Environment Variables:
VITE_SUPABASE_URL: Your Supabase project URL (e.g.https://your-project.supabase.co).VITE_SUPABASE_ANON_KEY: Your Supabase anon public key.VITE_API_URL: The public URL of your deployed backend (e.g.https://ledgerai-vjt8.onrender.com).
Deploy the Node.js/Express backend as a Web Service on Render:
- Repository:
LedgerAI - Language:
Node - Root Directory:
server - Build Command:
npm install - Start Command:
node index.js - Environment Variables:
SUPABASE_URL: Your Supabase project URL.SUPABASE_SERVICE_ROLE_KEY: Your Supabase service role secret key (NOT the anon key).MONGODB_URI: Your MongoDB connection string (for spreadsheet storage).PORT:5000(or let Render assign it).GOOGLE_CLIENT_ID: Google OAuth client ID (for email notifications).GOOGLE_CLIENT_SECRET: Google OAuth client secret.GOOGLE_REFRESH_TOKEN: Gmail OAuth2 refresh token.GOOGLE_EMAIL: The Gmail address sending notifications.GEMINI_API_KEY: (Optional, Google Gemini API key for AI attribution).GITHUB_TOKEN: (Optional, GitHub Personal Access Token β raises the GitHub API rate limit for candidate GitHub analysis from 60/hr to 5,000/hr).
To prevent Render's free tier from going to sleep after 15 minutes of inactivity:
- Log in to UptimeRobot.com.
- Create a new monitor of type
HTTP(s). - Name it
LedgerAI Node API. - Set the URL to your Render health endpoint:
https://your-render-app.onrender.com/api/user/departments - Set the monitoring interval to
5 minutes.
To start both frontend and backend dev servers concurrently locally:
- Configure
.env(frontend) andserver/.env(backend) with Supabase and MongoDB credentials. - Execute this single command from the project root:
npm run dev
- This runs
vite(web frontend onhttp://localhost:5173) andnode index.js(backend API onhttp://localhost:5000) concurrently.
Before deploying, ensure your Supabase project is configured:
- Create a Supabase project at https://app.supabase.com
- Run
server/supabase_schema.sqlin Supabase Dashboard β SQL Editor - Enable Google OAuth in Authentication β Providers β Google
- Set the redirect URI to
https://your-project.supabase.co/auth/v1/callback - See Supabase Setup Guide for full instructions