CaseForward takes documents from multiple channels (web uploads, email, call transcripts), processes them through AI specialists who deliberate on findings, and generates action cards for attorney creating an efficient workflow that bridges the gap between AI-powered analysis and human legal expertise.
- Node.js 18+
- MongoDB Atlas or local instance
- Google AI API Key (Gemini)
- Cloudflare R2 bucket + Worker
- (Optional) Solana devnet wallet
1. Clone the Repository
git clone https://github.com/your-org/CaseForwardAI
cd CaseForwardAI2. Install Dependencies
cd caseforward
npm installDev Dependencies:
npm install -D @tailwindcss/postcss @types/formidable @types/node @types/react @types/react-dom eslint eslint-config-next tailwindcss tsx typescriptDependencies:
npm install @ai-sdk/google @auth0/nextjs-auth0 @google/generative-ai @solana/web3.js ai bson dotenv formidable lucide-react mongodb mongoose next pdf-parse react react-dom zod3. Configure Environment Variables
cp .env.example .env.localRequired variables:
# Database
MONGODB_URI=mongodb+srv://...
# Auth0
AUTH0_SECRET=...
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL=https://your-tenant.auth0.com
AUTH0_CLIENT_ID=...
AUTH0_CLIENT_SECRET=...
# Google AI
GOOGLE_GENERATIVE_AI_API_KEY=...
# Cloudflare R2
CF_WORKER_UPLOAD_URL=https://your-worker.workers.dev
INTERNAL_API_KEY=...4. Deploy Cloudflare Worker
cd caseforward-worker
npx wrangler deploy5. Run Development Server
cd caseforward
npm run dev6. Access the Application
Open http://localhost:3000 in your browser.
| Category | Technologies |
|---|---|
| 🖼️ Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS |
| ⚙️ Backend | Next.js API Routes, MongoDB, Mongoose |
| 🤖 AI | Google Gemini 2.5, Vercel AI SDK, Zod |
| ☁️ Storage | Cloudflare R2, Cloudflare Workers |
| 🔐 Auth | Auth0 |
| 🛠️ Dev Tools | ESLint, TSX, pnpm/npm |
CaseForward AI follows a modern serverless architecture with clear separation between the client application, server APIs, AI orchestration layer, and storage services.
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CASEFORWARD AI SYSTEM │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ CLIENT LAYER (Next.js) AI LAYER (Round Table) │
│ ────────────────────── ────────────────────── │
│ │
│ ┌──────────────────┐ ┌─────────────────────┐ │
│ │ Dashboard UI │◄────────────►│ Orchestrator │ │
│ │ (React 19) │ └──────────┬──────────┘ │
│ └──────────────────┘ │ │
│ ┌──────────┴──────────┐ │
│ ┌──────────────────┐ │ Round Table │ │
│ │ Swipe Interface │◄────────────►│ ┌───────┬───────┐ │ │
│ │ (Action Cards) │ │ │Client │Evidence│ │ │
│ └──────────────────┘ │ │ Guru │Analyzer│ │ │
│ │ ├───────┴───────┤ │ │
│ │ │ Settlement │ │ │
│ │ │ Valuator │ │ │
│ │ └───────────────┘ │ │
│ └─────────────────────┘ │
│ │
│ DATA LAYER (MongoDB) STORAGE LAYER │
│ ──────────────────── ───────────── │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────────────────┐ │
│ │ Cases │ │Documents│◄─────────►│ Cloudflare R2 │ │
│ └─────────┘ └─────────┘ │ (raw files) │ │
│ └─────────────────────┘ │
│ ┌─────────┐ ┌─────────┐ │
│ │ Actions │ │ Liens │ ┌─────────────────────┐ │
│ └─────────┘ └─────────┘ │ Solana Devnet │ │
│ │ (audit hashes) │ │
│ ┌─────────┐ ┌─────────┐ └─────────────────────┘ │
│ │AuditLogs│ │Feedback │ │
│ └─────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────────┘
The AI layer implements a novel "Round Table" multi-agent deliberation system powered by Google Gemini.
Agent Roles:
| Agent | Role | Expertise |
|---|---|---|
| Orchestrator | Moderator | Routes tasks, sets context, synthesizes conclusions |
| Client Guru | Empathy Expert | Client communication, emotional intelligence, relationship management |
| Evidence Analyzer | Facts Expert | Document analysis, gap identification, inconsistency detection |
| Settlement Valuator | Numbers Expert | Case valuation, lien calculations, net recovery projections |
Deliberation Flow:
- Orchestrator introduces the topic with full case context
- Each specialist provides their perspective (parallel analysis)
- Optional follow-up rounds for consensus building
- Orchestrator synthesizes discussion into an Action Card
- Action Card returned with structured schema validation
Security Archetecture can be found Here
CaseForward AI - Intelligent Legal Case Management