Skip to content

Latest commit

 

History

History
147 lines (112 loc) · 4.47 KB

File metadata and controls

147 lines (112 loc) · 4.47 KB

Veridas Deployment Guide

This guide will walk you through deploying the Veridas platform to make it publicly accessible.

Architecture

  • Frontend: Deployed on Vercel (Next.js)
  • Backend: Deployed on Render (FastAPI)
  • Database: PostgreSQL with pgvector on Render
  • Cache: Redis on Render

Prerequisites

  1. GitHub account (already set up ✅)
  2. Vercel account (free)
  3. Render account (free)

Step 1: Deploy Backend on Render

1.1 Create Render Account

  1. Go to https://render.com/register
  2. Sign up with your GitHub account
  3. Authorize Render to access your repositories

1.2 Deploy Using Blueprint

  1. Click "New +""Blueprint"
  2. Connect your GitHub repository: NEBUMARK001/Veridas
  3. Render will detect the render.yaml file automatically
  4. Click "Apply" to create all services:
    • veridas-backend (Web Service)
    • veridas-db (PostgreSQL Database)
    • veridas-redis (Redis)

1.3 Configure Environment Variables

After deployment starts, go to the veridas-backend service:

  1. Click on "Environment" tab
  2. Add the following variable:
    • Key: FRONTEND_URL
    • Value: (Leave blank for now, we'll update after Vercel deployment)
  3. Click "Save Changes"

1.4 Wait for Deployment

  • Initial deployment takes 5-10 minutes
  • You'll see build logs in real-time
  • Once complete, you'll get a URL like: https://veridas-backend.onrender.com

1.5 Verify Backend

Visit your backend URL and you should see:

{"message": "Welcome to Veridas API"}

Step 2: Deploy Frontend on Vercel

2.1 Create Vercel Account

  1. Go to https://vercel.com/signup
  2. Sign up with your GitHub account
  3. Authorize Vercel to access your repositories

2.2 Import Project

  1. Click "Add New...""Project"
  2. Import NEBUMARK001/Veridas repository
  3. Configure project:
    • Framework Preset: Next.js
    • Root Directory: frontend
    • Build Command: npm run build
    • Output Directory: .next

2.3 Configure Environment Variables

Before deploying, add environment variable:

  1. Click "Environment Variables"
  2. Add:
    • Key: NEXT_PUBLIC_API_URL
    • Value: Your Render backend URL (e.g., https://veridas-backend.onrender.com)
  3. Click "Deploy"

2.4 Wait for Deployment

  • Deployment takes 2-5 minutes
  • You'll get a URL like: https://veridas.vercel.app

Step 3: Update Backend CORS

Now that you have the Vercel URL, update the backend:

  1. Go back to Render dashboard
  2. Open veridas-backend service
  3. Go to "Environment" tab
  4. Update FRONTEND_URL to your Vercel URL (e.g., https://veridas.vercel.app)
  5. Click "Save Changes"
  6. Service will automatically redeploy

Step 4: Verify Deployment

4.1 Test Frontend

  1. Visit your Vercel URL
  2. Homepage should load with all styling
  3. Navigation should work

4.2 Test Backend Connection

  1. Try to sign up for a new account
  2. If successful, backend connection is working!

4.3 Test Full Flow

  1. Sign up / Log in
  2. Upload a test document (PDF)
  3. Ask a question in the chat
  4. Verify response is generated

Troubleshooting

Backend Issues

  • 503 Service Unavailable: Free tier databases sleep after 15 minutes. Wait 30-60 seconds for wake up.
  • Database Connection Error: Check that DATABASE_URL is correctly set in Render environment variables.

Frontend Issues

  • API Connection Failed: Verify NEXT_PUBLIC_API_URL is set correctly in Vercel.
  • CORS Error: Ensure FRONTEND_URL is set in Render backend environment variables.

Database Issues

  • Migration Errors: Render should auto-run migrations. Check backend logs if issues occur.

Important Notes

⚠️ Free Tier Limitations:

  • Render free databases sleep after 15 minutes of inactivity
  • First request after sleep takes 30-60 seconds
  • For production use, upgrade to paid tiers

🔒 Security:

  • Secret keys are auto-generated by Render
  • Never commit .env files to git
  • Use environment variables for all sensitive data

Your Deployment URLs

After completing the steps above, save your URLs:

  • Frontend: https://veridas.vercel.app (or your custom domain)
  • Backend: https://veridas-backend.onrender.com
  • API Docs: https://veridas-backend.onrender.com/docs

Next Steps

  • Set up custom domain on Vercel (optional)
  • Configure monitoring and alerts
  • Set up CI/CD for automatic deployments
  • Consider upgrading to paid tiers for production use