Skip to content
shuwangsPublic

About

CaseForge is a citation analysis dashboard that helps users retrieve, organize, and interpret publication impact data from academic sources. The platform is designed to support workflows where understanding scholarly influence is important, such as immigration-related evidence preparation for EB-1A or NIW cases.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

323 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โš–๏ธ CaseForge

TypeScript React Express PostgreSQL BullMQ Redis Gemini

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.

๐ŸŽฌ Live DEMO

CaseForge

๐Ÿ”— Project Links

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.


โ“ Problem

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.

๐Ÿ’ก Solution

CaseForge automates publication collection, citation analysis, and evidence generation, allowing applicants to focus on presenting their achievements rather than gathering data.

โœจ Features

  • 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

๐Ÿš€ Engineering Highlights

  • 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.

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React
  • TypeScript
  • Vite
  • Tailwind CSS
  • AG Grid
  • Chart.js
  • React SVG World Map
  • Clerk React

Backend

  • TypeScript
  • Express
  • PostgreSQL
  • BullMQ
  • Redis
  • Clerk Express middleware
  • Google Gemini API

Testing

  • Vitest
  • React Testing Library
  • Supertest

Infrastructure

  • Docker Compose
  • Render configuration
  • Neon PostgreSQL

Core Workflow

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

๐Ÿ—๏ธ Architecture

System Architecture

Design Architecture

โš™๏ธ Setup

Local Setup

1. Clone the repository

git clone https://github.com/shuwangs/CaseForge.git
cd CaseForge

2. Install dependencies

cd server
npm install

cd ../client
npm install

3. Configure environment files

Create client/.env:

VITE_API_BASE_URL=http://localhost:3000
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key

Create 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_key

For 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_key

4. Set up the database

Run the schema in:

server/db/schema.sql

5. Run Locally

Start Redis:

redis-server

Start the backend API:

cd server
npm run dev:local

Start the citation worker in a second terminal:

cd server
npm run worker:citation:dev

Start the frontend in a third terminal:

cd client
npm run dev

Default local URLs:

Frontend: http://localhost:5173
Backend:  http://localhost:3000
Redis:    redis://localhost:6379

Clerk Webhooks With ngrok

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 3000

Copy 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_secret

If your local database already contains the signed-in Clerk user, ngrok is not required for ordinary app usage.

Run With Docker Compose

From the project root:

docker compose up -d

This starts:

caseforge-app              http://localhost:5173
caseforge-server           http://localhost:3000
caseforge-citation-worker
redis                      localhost:6379

Stop containers:

docker compose down

Stop containers and remove volumes:

docker compose down -v

๐Ÿ“ก API Overview

Most API routes require Clerk authentication.

User

GET /api/user/me

Projects

GET    /api/projects
POST   /api/projects
PUT    /api/projects/:id
DELETE /api/projects/:id
GET    /api/projects/:projectId/status

Publications

POST /api/projects/:projectId/publications/import
GET  /api/projects/:projectId/publications
POST /api/projects/:projectId/publications

Citations


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

AI Summaries

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

๐Ÿค– AI Summary Pipeline

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.

๐Ÿ”ฌ Testing

Run client tests:

cd client
npm run test
npm run coverage

Run server tests:

cd server
npm run test
npm run coverage

Testing coverage

Layer Coverage
Frontend 64.4%
Backend 70.1%

Coverage reports are generated using Vitest, React Testing Library and Supertest.

๐Ÿ”ฎ Future Improvements

  • Deploy citation workers in production
  • Support additional citation providers
  • Generate downloadable evidence reports
  • Add file upload and document management
  • Improve AI-generated evidence drafting

About

CaseForge is a citation analysis dashboard that helps users retrieve, organize, and interpret publication impact data from academic sources. The platform is designed to support workflows where understanding scholarly influence is important, such as immigration-related evidence preparation for EB-1A or NIW cases.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages