CaseForge is a full-stack TypeScript web application that helps researchers and immigration applicants transform publication and citation data into evidence-ready analytics for EB-1A and NIW petitions.
Users can import publications through ORCID, automatically collect citation records, analyze research impact through interactive dashboards, and generate AI-powered evidence summaries. The platform provides journal impact analytics, citation trend visualizations, geographic citation insights, and exportable evidence artifacts to support immigration petitions.
By automating data collection and analysis, CaseForge reduces the manual effort required to document scholarly influence and helps applicants present their research achievements more effectively.
Deployment Limitation: Citation fetching is unavailable in the deployed version due to production worker hosting limitations. The feature works correctly in local and Dockerized environments.
Researchers preparing EB-1A or NIW petitions often need to:
- Collect publication records from multiple sources
- Gather citation evidence
- Analyze research impact
- Prepare supporting documentation
This process is time-consuming and highly manual.
CaseForge automates publication collection, citation analysis, and evidence generation, allowing applicants to focus on presenting their achievements rather than gathering data.
- ORCID-based publication retrieval and persistence
- Asynchronous citation collection and processing
- Citation processing progress tracking
- Journal impact analytics dashboard
- Citation trend visualization and Geographic citation analysis
- AI-generated evidence summaries powered by Gemini
- Summary persistence and retrieval
- Clerk-based authentication and project ownership
- CSV export for analytics tables and PNG export for citation visualizations
- Migrated the backend from JavaScript to TypeScript to improve type safety and maintainability.
- Designed an asynchronous processing pipeline using BullMQ, Redis, and background workers for citation collection.
- Built AI-powered analytics summaries using Gemini with persisted results stored in PostgreSQL.
- Containerized the application using Docker Compose for reproducible local development.
- Configured automated testing with Vitest, React Testing Library, and Supertest.
- Implemented automated testing using Vitest, React Testing Library, and Supertes
- Added code quality and CI validation through Biome formatting and automated test checks.
- Configured deployment environments using Render, PostgreSQL, Redis, and worker services.
- React
- TypeScript
- Vite
- Tailwind CSS
- AG Grid
- Chart.js
- React SVG World Map
- Clerk React
- TypeScript
- Express
- PostgreSQL
- BullMQ
- Redis
- Clerk Express middleware
- Google Gemini API
- Vitest
- React Testing Library
- Supertest
- Docker Compose
- Render configuration
- Neon PostgreSQL
Create project
โ Import publications from ORCID
โ Review publication list
โ Fetch citations
โ Citation worker processes jobs in the background
โ Dashboard renders saved citation analytics
โ Generate AI evidence summaries
โ Saved summaries reload on future visit
git clone https://github.com/shuwangs/CaseForge.git
cd CaseForgecd server
npm install
cd ../client
npm installCreate client/.env:
VITE_API_BASE_URL=http://localhost:3000
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_keyCreate server/.env.local for local development:
PORT=3000
DATABASE_URL=your_postgres_connection_string
PUBLICATION_API=https://api.opencitations.net/meta/v1/author/orcid:
OPENALEX_URL=https://api.openalex.org/works?filter=cites:
REDIS_URL=redis://localhost:6379
CLERK_SECRET_KEY=your_clerk_secret_key
CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_WEBHOOK_SIGNING_SECRET=your_clerk_webhook_signing_secret
GEMINI_API_KEY=your_gemini_api_keyFor Docker Compose, create server/.env.docker with the same server variables,
but use the Compose Redis service hostname:
PORT=3000
DATABASE_URL=your_postgres_connection_string
PUBLICATION_API=https://api.opencitations.net/meta/v1/author/orcid:
OPENALEX_URL=https://api.openalex.org/works?filter=cites:
REDIS_URL=redis://redis:6379
CLERK_SECRET_KEY=your_clerk_secret_key
CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_WEBHOOK_SIGNING_SECRET=your_clerk_webhook_signing_secret
GEMINI_API_KEY=your_gemini_api_keyRun the schema in:
server/db/schema.sql
Start Redis:
redis-serverStart the backend API:
cd server
npm run dev:localStart the citation worker in a second terminal:
cd server
npm run worker:citation:devStart the frontend in a third terminal:
cd client
npm run devDefault local URLs:
Frontend: http://localhost:5173
Backend: http://localhost:3000
Redis: redis://localhost:6379
CaseForge uses Clerk for authentication and a Clerk webhook to sync signed-up users into the local PostgreSQL database.
For local development, browser sign-in works without ngrok, but Clerk webhooks
cannot reach localhost. If you need to test new user signup and user sync
locally, expose the backend with ngrok:
ngrok http 3000Copy the generated HTTPS forwarding URL and configure the Clerk webhook endpoint as:
https://your-ngrok-url.ngrok-free.app/api/webhook
Make sure server/.env.local includes:
CLERK_WEBHOOK_SIGNING_SECRET=your_clerk_webhook_signing_secretIf your local database already contains the signed-in Clerk user, ngrok is not required for ordinary app usage.
From the project root:
docker compose up -dThis starts:
caseforge-app http://localhost:5173
caseforge-server http://localhost:3000
caseforge-citation-worker
redis localhost:6379
Stop containers:
docker compose downStop containers and remove volumes:
docker compose down -vMost API routes require Clerk authentication.
GET /api/user/me
GET /api/projects
POST /api/projects
PUT /api/projects/:id
DELETE /api/projects/:id
GET /api/projects/:projectId/status
POST /api/projects/:projectId/publications/import
GET /api/projects/:projectId/publications
POST /api/projects/:projectId/publications
POST /api/projects/:projectId/citations/jobs
GET /api/projects/:projectId/citations/status
GET /api/projects/:projectId/yearly-counts
GET /api/projects/:projectId/map
GET /api/projects/:projectId/journals
POST /api/projects/:projectId/ai/journal-impact-summary
POST /api/projects/:projectId/ai/trend-summary
POST /api/projects/:projectId/ai/map-summary
GET /api/projects/:projectId/ai/summary
Fetch analytics
โ Build structured insights
โ Generate prompt
โ Call Gemini
โ Save summary to PostgreSQL
โ Render saved summary in dashboard
CaseForge currently generates summaries for:
- Journal/publication impact
- Citation trend
- Geographic citation reach The AI is constrained to use only provided analytics data and avoid unsupported legal conclusions.
Run client tests:
cd client
npm run test
npm run coverageRun server tests:
cd server
npm run test
npm run coverage| Layer | Coverage |
|---|---|
| Frontend | 64.4% |
| Backend | 70.1% |
Coverage reports are generated using Vitest, React Testing Library and Supertest.
- Deploy citation workers in production
- Support additional citation providers
- Generate downloadable evidence reports
- Add file upload and document management
- Improve AI-generated evidence drafting

