Follow this guide to deploy CodeLens. v1.0.0 to the professional cloud. This configuration uses Vercel for the frontend, Render for the backend, and Supabase/Neon for the PostgreSQL database.
Since SQLite is disk-based and will be deleted at every restart on Render/Vercel, you must use a managed PostgreSQL service.
- Go to Supabase or Neon.
- Create a new Project called "CodeLens".
- Copy your Connection String (it should look like
postgres://user:pass@host:5432/dbname). - Important: Keep this URL safe—it is your
DATABASE_URL.
Render will host your FastAPI API and your Dockerized environment.
- Go to Render Dashboard.
- New -> Web Service and connect your GitHub repository.
- Configure:
- Runtime:
Docker. - Environment Variables:
DATABASE_URL: (Paste your Supabase/Neon URL here).API_KEY_ENABLED:true(highly recommended for production).API_KEY: A strong secret password.APP_ENV:production.
- Runtime:
- Deploy: Render will automatically build the
Dockerfilein the root and start the service. - Identify: Copy your Render URL (e.g.,
https://codelens-api.onrender.com).
Vercel will host your React/Vite dashboard.
- Go to Vercel.
- Import your
dashboardfolder (or the whole repository and set the root directory todashboard). - Update
vercel.json:- Open
dashboard/vercel.json. - Replace
https://YOUR_BACKEND_URL.render.comwith your real Render URL.
- Open
- Deploy: Vercel will build the React application and provide a global dashboard link.
Once deployed, you can run the benchmark script from your local machine (or any CI) against your production instance:
python scripts/evaluate.py --url https://your-render-url.com --api-key YOUR_SECRET_KEYCaution
Database Migrations: When you first deploy to a new PostgreSQL instance, the tables will be empty. The first request to the API will automatically trigger create_db_and_tables() via the lifespan hook—no manual SQL is required.
Tip
Vercel Rewrites: The vercel.json rewrite rule is what allows the frontend to talk to the backend without CORS issues. Ensure the URL is exactly correct.