Spaces:
Sleeping
Sleeping
ClauseGuard β Deployment Guide v3.0
What's running now
| Component | Status | URL |
|---|---|---|
| Gradio demo | β Live | https://huggingface.co/spaces/gaurv007/ClauseGuard |
| ML model | β On Hub | https://huggingface.co/Mokshith31/legalbert-contract-clause-classification |
| FastAPI backend | β Needs host | Code ready in api/ |
| Next.js website | β Needs Vercel | Code ready in web/ |
| Chrome extension | β Needs testing | Code ready in extension/ |
1. Test the Chrome Extension (5 minutes)
The extension works WITHOUT the backend β it uses local regex fallback.
Steps:
1. Download the extension/ folder from the repo
2. Open Chrome β chrome://extensions/
3. Toggle ON "Developer mode" (top right)
4. Click "Load unpacked"
5. Select the extension/ folder
6. Visit any Terms of Service page (try spotify.com/legal or airbnb.com/terms)
7. The extension will auto-scan and highlight unfair clauses
To connect to a running API, change API_BASE in background.js.
2. Deploy the Backend (choose one)
Option A: HuggingFace Spaces (free, easiest)
Create a new Space with Docker SDK:
- Go to https://huggingface.co/new-space
- Name:
clauseguard-api - SDK: Docker
- Copy
api/main.py,api/auth.py,api/requirements.txtinto the Space - Your API will be at:
https://gaurv007-clauseguard-api.hf.space
Option B: Railway (free tier, auto-deploy)
cd api/
railway login
railway init
railway up
After deploying the backend:
Update API_BASE in extension/background.js:
const API_BASE = "https://your-backend-url.com";
3. Deploy the Website on Vercel (10 minutes)
Required environment variables on Vercel:
NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...
SUPABASE_JWT_SECRET=your-jwt-secret
# Payment: Razorpay (used in web/components/checkout-button.tsx and schema.sql)
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_live_...
RAZORPAY_KEY_SECRET=...
RAZORPAY_WEBHOOK_SECRET=...
RESEND_API_KEY=re_...
NEXT_PUBLIC_SITE_URL=https://your-domain.vercel.app
CLAUSEGUARD_API_URL=https://your-backend-url.com
Note: The payment integration uses Razorpay (see
web/components/checkout-button.tsxandweb/lib/supabase/schema.sqlwhich hasrazorpay_subscription_idcolumns).
4. Setup Supabase (5 minutes)
- Go to https://supabase.com β New Project
- Go to SQL Editor β paste and run
web/lib/supabase/schema.sql - Go to Authentication β Providers β Enable Google and GitHub
- Copy from Settings β API:
- Project URL β
NEXT_PUBLIC_SUPABASE_URL anonpublic key βNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYservice_rolekey βSUPABASE_SERVICE_ROLE_KEY- JWT Secret β
SUPABASE_JWT_SECRET
- Project URL β
5. Setup Razorpay (5 minutes)
- Go to https://dashboard.razorpay.com
- Create subscription plans:
- "ClauseGuard Pro" β βΉ999/month or $12/month
- "ClauseGuard Team" β βΉ3999/month or $49/month
- Settings β API Keys β Copy Key ID and Secret
- Settings β Webhooks β Add endpoint:
- URL:
https://your-site.vercel.app/api/webhooks/razorpay - Events:
subscription.activated,subscription.charged,subscription.cancelled,payment.failed
- URL:
- Copy webhook secret
6. Setup Resend (2 minutes)
- Go to https://resend.com β Sign up
- API Keys β Create β Copy key β
RESEND_API_KEY - Add your domain for email sending
Order of operations
1. Supabase (create project, run schema) β 5 min
2. Backend (deploy to Railway/Render/HF) β 5 min
3. Razorpay (create plans) β 5 min
4. Resend (get API key) β 2 min
5. Vercel (deploy with all env vars) β 10 min
6. Extension (update API_BASE, load unpacked) β 2 min
7. Test everything end-to-end β 5 min
Total: ~35 minutes to go fully live.