The Problem

Consultants at major firms spend days, weeks, or months on research that this tool claims to compress into minutes. The repository lacks a license, test coverage, and CI/CD pipelines, meaning any deployment carries legal uncertainty and no regression safety net. The codebase also contains duplicated API logic across 16 files and oversized components that make changes difficult to reason about.

What This Does

ConsultRalph is a Next.js 15 (App Router) application that wraps Valyu's Deep Research API to generate consulting deliverables—PDF reports, CSV spreadsheets, DOCX summaries, and PPTX decks—from research topics. The app operates in two modes: self-hosted (default, single API key for all users) or Valyu mode (OAuth 2.0 with PKCE, each user's own credits). Key files include app/page.tsx (the landing page), app/components/ConsultingResearchForm.tsx (the research input form with 649 lines), app/components/Sidebar.tsx (navigation, 8 levels of nesting), and app/stores/auth-store.ts (Zustand state). API routes under app/api/consulting-research/ handle research creation, status checks, follow-ups, and toggling public status, though 225 repeated 6-line blocks appear across 16 of these routes, indicating copy-paste patterns that reduce maintainability. Authentication is handled through app/components/auth/ with sign-in modal and panel components, while app/lib/oauth.ts and app/lib/email-templates/enterprise-inquiry.ts manage OAuth flows and email generation. The repository uses Tailwind CSS 4 for styling and Zustand for state management, with app/lib/utils.ts providing shared helpers.

How It Is Wired

Execution begins at app/page.tsx, which renders the research form and sidebar. The form in app/components/ConsultingResearchForm.tsx collects a topic and research type, then submits to app/api/consulting-research/route.ts. That route delegates to Valyu's Deep Research API via app/lib/oauth.ts when NEXT_PUBLIC_APP_MODE=valyu, or uses a server-side VALYU_API_KEY in self-hosted mode. Research progress appears to stream through app/components/ResearchResults.tsx, while app/components/ResearchActivityFeed.tsx visualizes stages. Canceling a research job routes to app/api/consulting-research/cancel/route.ts, and toggling public status goes through app/api/consulting-research/toggle-public/route.ts. The sidebar component (app/components/Sidebar.tsx) navigates between research types and reports, and app/components/EnterpriseContactModal.tsx handles enterprise inquiry submissions via app/api/enterprise/inquiry/route.ts. The deep nesting in Sidebar (max indentation depth 8) and the 649-line ConsultingResearchForm make control flow hard to follow; a change in one often ripples widely. The app/layout.tsx contains an empty catch {} that silently discards errors, offering no visibility into failures.

How To Use It

Setup

git clone https://github.com/moses-y/consultralph
cd consultralph
npm install

Configuration Copy .env.example to .env and set the required variables. For self-hosted mode, VALYU_API_KEY is sufficient. For Valyu mode, also set NEXT_PUBLIC_VALYU_CLIENT_ID, VALYU_CLIENT_SECRET, NEXT_PUBLIC_VALYU_AUTH_URL, VALYU_APP_URL, and NEXT_PUBLIC_REDIRECT_URI. The .env.example file documents these entries.

Running it

npm run dev

This starts the Next.js development server at http://localhost:3000. The entry point is app/page.tsx, which renders the research interface.

Real-World Use

A consultant inputs "Stripe" as the company topic and selects "Company Due Diligence." The form submits to the research API route, which triggers Valyu's deep research pipeline. The UI displays real-time progress indicators as the agent queries thousands of sources. Upon completion, the system generates a PDF report, a CSV spreadsheet, an executive summary DOCX, and a PPTX deck, all with cited sources. The consultant can then download or share these deliverables for a client meeting.

Code Health & Issues

  • [HIGH] Add a LICENSE - no licence file at the repository root; redistribution rights are undefined
  • [HIGH] Add a test suite - 49 source files, no test files; any change ships with no signal that existing behaviour still holds
  • [HIGH] Add a CI workflow - 49 source files, no CI configuration; every change merges with nobody having run the build
  • [MEDIUM] Enable Dependabot or Renovate - 1 manifest, no update bot configured
  • [MEDIUM] Move large binaries to Git LFS - consultralph.png is 5.5MB; every clone and CI checkout pays for this data
  • [LOW] Add convention files - missing .editorconfig, .gitattributes, formatter config

The Bottom Line

This repo provides a functional AI research wrapper for consultants with a clean two-mode deployment model and a working Next.js frontend, but it ships without a license, tests, or CI—critical gaps for any production use. The duplicated API logic and outsized components create technical debt that will slow future changes. It's suitable for internal teams willing to add their own governance, but not for public distribution without addressing the health findings first.