Full Stack: React + TypeScript + Node.js + PostgreSQL + Elasticsearch + OpenAI + Docker + AWS-ready
CaseFlow AI is an intelligent legal workflow automation system designed to help law firms and legal teams analyze, organize, and manage case documents using AI-powered insights.
CaseFlow AI combines natural language processing, document analytics, and data management to streamline legal case workflows. It can summarize documents, extract entities, and classify legal materials such as contracts, motions, and memos — all while offering scalable infrastructure.
Key Capabilities:
- 🤖 AI-driven document analysis using OpenAI
- 🔍 Advanced search via Elasticsearch
- 🧩 Full CRUD case management backend
- 🔐 Secure authentication with JWT
- 🐳 Dockerized, modular, and AWS-ready
- 🧠 Clean local dev flow with one command (
npm run start:all)
[ React (Vite) ] → REST API (Express + TypeScript)
│
▼
[ PostgreSQL + Elasticsearch + OpenAI API ]
Backend handles authentication, AI requests, and database/search integration. Frontend provides the dashboard and document management interface.
| Layer | Technology |
|---|---|
| Frontend | React, TypeScript, Vite |
| Backend | Node.js, Express, TypeScript |
| Database | PostgreSQL 15 |
| Search | Elasticsearch 7.17 |
| AI Engine | OpenAI GPT models |
| Infra | Docker, Docker Compose, AWS Elastic Beanstalk |
| CI/CD | GitHub Actions |
caseflow-ai/
├─ client/ # Frontend (React + Vite)
│ ├─ src/pages/ # Pages: Dashboard, Cases, Documents
│ ├─ src/services/ # API integration (axios)
│ └─ App.tsx # Router setup
│
├─ server/ # Backend (Node + Express + TS)
│ ├─ src/routes/ # Routes: auth, documents, cases
│ ├─ src/services/ # Services: db, elastic, openai
│ └─ index.ts # Entry point
│
├─ docker-compose.yml # Docker configuration
├─ .github/workflows/ # CI/CD setup
└─ README.md
- Node.js v20+
- npm v9+
- Docker Desktop
- PostgreSQL 15+ (optional for local only)
- Elasticsearch 7.17+ (optional for local only)
PORT=5000
JWT_SECRET=your_secret_here
OPENAI_API_KEY=sk-xxxxx
OPENAI_BASE_URL=https://api.openai.com/v1
PGHOST=postgres
PGPORT=5432
PGDATABASE=caseflow
PGUSER=admin
PGPASSWORD=password
ELASTICSEARCH_NODE=http://elasticsearch:9200
ELASTICSEARCH_INDEX=caseflow_docsVITE_API_BASE=http://localhost:5000/apiFor non-Docker local runs, replace
PGHOST=localhostandELASTICSEARCH_NODE=http://localhost:9200.
To start the complete stack (databases in Docker, app locally):
npm run start:all- Stops any running containers
- Starts PostgreSQL & Elasticsearch in Docker
- Waits for both to become healthy
- Launches backend (
server) and frontend (client) locally
- Frontend → http://localhost:5173
- Backend → http://localhost:5000/api
- Elasticsearch → http://localhost:9200
✅ No OpenAI 429 quota errors — backend uses host IP automatically.
If you prefer a fully local setup:
cd server
cp .env.example .env
npm install
npm run devcd client
cp .env.example .env
npm install
npm run devAccess:
- Backend → http://localhost:5000/api
- Frontend → http://localhost:5173
| Role | Password | |
|---|---|---|
| Admin | [email protected] | admin123 |
Change credentials after first launch for security. Admin account is auto-created during seeding.
docker build -t caseflow-ai .
eb init
eb create caseflow-ai-env
eb deployYour app will be available at:
http://caseflow-ai-env.eba-xyz123.us-east-1.elasticbeanstalk.com/
| Issue | Cause | Fix |
|---|---|---|
Error: 429 You exceeded your current quota |
Docker’s shared network IP is rate-limited | Use npm run start:all (runs backend locally) |
ECONNREFUSED 127.0.0.1:5432 |
PostgreSQL not ready | Wait or rerun npm run wait:postgres |
Cannot GET /api |
Base route placeholder | Safe to ignore |
MIT © Sumaiya Shah