feat: AI Debt Scanner + Launch Preview on Vercel#47
Draft
DealPatrol wants to merge 24 commits into
Draft
Conversation
…r handling - Tighten free tier: 1 repo, 1 analysis/mo, 1 blueprint view, 200 credits (was 2/2/3/500) - Billing page: show all 4 plans (Free, Pro, Scale, BYOK) side-by-side for easy comparison - Pattern Analyzer → App Idea Chat: conversational UI with chat bubbles, starter prompts, follow-up questions, and optional codebase grounding; new /api/app-idea-chat route - Templates page: add Create Template button (multi-step modal to combine blueprints) - Idea Board: restyle with status-colored cards, icon stats strip, New Analysis CTA - Analysis detail: fix overly broad catch that called notFound() on subscription/views table errors, keeping free-plan defaults instead
- DashboardHeader: switch to black/cyan cyberpunk theme (bg-black/95, border-cyan-500/20, RepoFuseLogo3D, mono tracking-wider nav links, cyan ring on avatar, cyan-styled auth buttons) - Dashboard layout: bg-black text-white to match homepage - Pricing page: same black/cyan header with RepoFuseLogo3D; plan cards and credit table restyled for dark background (gray-900 cards, cyan accents, white text)
Next.js <Link> performs client-side navigation via fetch, which triggers a CORS preflight that GitHub's OAuth server blocks. Using plain <a href> forces a full browser navigation (top-level redirect) that GitHub expects. Affected: homepage (3 buttons), dashboard-header (GitHub + GitLab), pricing page (Sign in button).
On mobile, the left column (text) was pushed down by 96px of padding before showing any content. Fix: reduce section/container top padding and use CSS order-* classes so the terminal window appears first above the text on small screens, matching the visual hierarchy on desktop (left-first layout preserved via lg:order-1 / lg:order-2). https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
- Simplified header: logo + name, desktop nav, single cyan "Get Started" button; NavDropdown shown in mobile header - Hero: centered single column instead of 2-col grid; trust badge with Zap icon + divider; large two-line headline (white/cyan); single full-width-on-mobile CTA button; avatar stack social proof - Terminal preview moved below CTA, full-width card with window chrome and Online badge - Metrics, How It Works, Features, bottom CTA, footer all updated to match clean dark style (white/5 borders, rounded-2xl cards) - Background updated to #0a0a0f for warmer deep-dark feel https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Mirrors MyClaw's before/after layout: broken terminal showing repos collecting dust + four ✕ pain-point lines, red arrow transition, then a success terminal showing 7 detected app ideas + three ✓ benefit lines and headline 'turns your graveyard into a goldmine'. Inserted between Metrics Strip and How It Works. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
- Add maxDuration=60 and force-dynamic to build-app route so Vercel allows up to 60s for Claude file generation (was 10s default) - Reduce max_tokens 8192→4096 to finish faster and stay within budget - Client: detect stream-ended-without-done (silent timeout) and show actionable retry message instead of freezing on the progress screen - Client: map Safari's 'Load failed' / 'Failed to fetch' network errors to a clear 'Connection timed out — please try again' message https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Webhook fixes:
- checkout.session.completed: read plan from sub.metadata.plan instead of
hardcoding 'pro' — Scale subscribers now get plan='scale' in DB
- Also correctly set status='trialing' on trial subscriptions at signup
- customer.subscription.updated: preserve 'scale' plan when subscription
is still active; read from metadata.plan or existing DB plan
- invoice.payment_succeeded: replace fragile invoice.number!='0001' check
with invoice.billing_reason==='subscription_cycle' for reliable renewal
credit granting
Checkout flow fixes:
- billing-client: Scale plan now calls /api/stripe/checkout with
{plan:'scale'} so github_id metadata is attached to the Stripe
subscription; falls back to payment link only if STRIPE_SCALE_PRICE_ID
is not configured (503 response)
- billing-client: plan comparison buttons pass correct plan id to
handleUpgrade() instead of always defaulting to 'pro'
- pricing page: Scale CTA links to /dashboard/billing instead of bare
Stripe payment link, routing authenticated users through checkout API
https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
New feature that scans connected repositories for technical debt across 6 categories (duplicates, unused files, security risks, slow queries, outdated dependencies, quick wins) and surfaces actionable issues with severity badges. Auto-fixable issues support one-click GitHub PR generation via Claude. - lib/credits.ts: add DEBT_SCAN_COST (150), extend transaction_type union and deductCredits type parameter with 'debt_scan' - app/api/debt-scan/route.ts: POST endpoint — auth, deduct credits, load repo file metadata, build Claude prompt, parse and return DebtScanResult - app/api/debt-fix/route.ts: SSE endpoint — fetch file from GitHub, Claude generates fix, creates branch + PR on the user's repo - components/debt-scanner-client.tsx: full client UI with idle/scanning/results states, severity summary bar, category tabs, issue cards with before/after snippets, auto-fix and copy-suggestion actions - components/debt-fix-modal.tsx: SSE streaming modal (fetch → generating → PR) following the same pattern as build-app-modal - app/dashboard/debt-scanner/page.tsx: server wrapper that loads completed analyses and passes them to the client component - components/dashboard-header.tsx: add Debt Scanner nav item (ShieldAlert icon) https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
upsertSubscription and the Subscription interface only allowed 'free' | 'byok' | 'pro', causing a build-breaking type error in the Stripe webhook handler which correctly writes 'scale' for Scale plan subscribers. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
handleUpgrade takes (targetPlan?: 'pro' | 'scale') but was passed directly as onClick, which expects a MouseEventHandler. Wrapping with () => handleUpgrade() fixes the type mismatch on all four call sites. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
…nner The button sits inside a block guarded by scanState==='idle'||'error', so TypeScript correctly flags the inner === 'scanning' check as having no overlap. Removed the redundant condition. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
After Build This App completes, users can click "Launch Preview on Vercel" to deploy their generated app as an ephemeral Vercel preview. The flow: - Claude updates package.json dependencies to latest stable versions - Pushes the updated file back to GitHub - Creates a Vercel project linked to the GitHub repo - Triggers a deployment and polls until live (~60–90s) - Returns a clickable preview URL New files: - app/api/launch-preview/route.ts — SSE endpoint (maxDuration=120) - components/launch-preview-modal.tsx — step-tracker modal with Vercel token input Modified: - components/build-app-modal.tsx — adds "Launch Preview on Vercel" button in done state https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Before/after comparison graphic matching the site's actual style (#0a0a0f bg, cyan-400 accent, monospace terminals). Awaiting user approval before wiring into the homepage. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Swaps the ~90-line inline JSX terminal mockup with a single <img> tag pointing to the approved /comparison-preview.svg, which matches the site's dark style and actual product messaging. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
- app/dashboard/error.tsx: add Next.js error boundary so any dashboard page crash shows a recoverable UI instead of a raw 500 screen - migrations/002 used MySQL-style inline INDEX in CREATE TABLE which is invalid PostgreSQL, so missing_file_gaps and templates tables were never created; added migration 007 with correct syntax - app/api/setup/init-db: added missing_file_gaps, completed_gaps, and templates table creation with correct PostgreSQL syntax - app/api/templates/generate: wrap getMissingGapsByBlueprint in try/catch so missing tables don't block template creation; add auth check; surface "run /api/setup/init-db" hint when tables are missing https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Adds a MyClaw-style phone mockup carousel to the landing page (between the metrics strip and the before/after comparison), showing RepoFuse in action across three slides: Discover, Build, and Ship. - components/phone-slideshow.tsx: client component with iOS phone frame, auto-advancing every 4s, click-to-navigate dot indicators, and a sidebar slide-list nav with cyan accent for the active item - app/page.tsx: new "SEE IT IN ACTION" section wrapping the slideshow - public/screenshots/: directory for blueprints.png, build-modal.png, build-progress.png (user must add these three images) https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
Adds a 4th slide showing the finished product (Memorial QR screenshot) inside a mini browser-chrome frame with a green LIVE badge, completing the narrative arc: Discover → Build → Ship → Launched. Desktop screenshots render with a browser-chrome header instead of the plain full-bleed style used for mobile slides. Green accent colors signal the live/launched state throughout (dot indicator, label, sidebar accent). User must add: public/screenshots/result.png https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
- build-app: deduct credits only after a successful build instead of up front, so failed generation/repo-creation/push no longer burns 500 credits. Balance is still checked before work begins. - Delete the unused OpenAI gpt-4-turbo analysis route and the unused cross-platform analyze route (plus their orphaned libs); the live /run flow already uses Claude. - build-app-modal: align timeout copy on 2 minutes, surface HTTP status on request failures, and explain Vercel preview is GitHub-only. - queries: log blueprint_views catch blocks instead of swallowing errors silently. https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
The analyses list page and analysis detail page had bare catch blocks that silently discarded DB/connectivity errors, making them impossible to diagnose in production. Both now log the error before falling back to empty data or notFound(). https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/dashboard/debt-scannerpage — AI-powered technical debt analysis across 6 categories (duplicate code, unused files, security risks, slow queries, outdated deps, quick wins) with severity badges and auto-fix via GitHub PRNew files
app/api/debt-scan/route.ts— POST: auth → deduct credits → load repo metadata → Claude →DebtScanResultJSONapp/api/debt-fix/route.ts— SSE: fetch file from GitHub → Claude fix → branch + PRapp/api/launch-preview/route.ts— SSE (maxDuration=120): fix deps → push → create Vercel project → deploy → poll until livecomponents/debt-scanner-client.tsx— full UI with idle/scanning/results/error states, severity summary bar, category tabs, collapsible before/after diffs, auto-fix and copy-suggestion buttonscomponents/debt-fix-modal.tsx— SSE streaming modal (Fetching → Generating → Creating PR → Done)components/launch-preview-modal.tsx— step-tracker modal with Vercel token input (6 steps: fetch → fix deps → push → create project → deploy → live)app/dashboard/debt-scanner/page.tsx— server wrapper loading completed analysesModified files
lib/credits.ts—DEBT_SCAN_COST: 150,'debt_scan'added to type unionslib/queries.ts— added'scale'toSubscription.plantype (fixed pre-existing Stripe webhook type error)components/billing-client.tsx— fixedonClick={handleUpgrade}handler type mismatchcomponents/dashboard-header.tsx— added "Debt Scanner" nav itemcomponents/build-app-modal.tsx— "Launch Preview on Vercel" button in done state, opensLaunchPreviewModalwith parsed owner/name from repo URLTest plan
/dashboard/debt-scannerloads with analysis selector/dashboard/billing)https://claude.ai/code/session_01JcAQpzFeBtwmK6ZrXKZ8mx