Skip to content

chore(chat): remove ten dead api routes#1711

Merged
sweetmantech merged 2 commits into
testfrom
chore/remove-dead-routes
Apr 27, 2026
Merged

chore(chat): remove ten dead api routes#1711
sweetmantech merged 2 commits into
testfrom
chore/remove-dead-routes

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented Apr 24, 2026

Summary

Delete ten local /api/* routes that have zero in-repo callers, plus the orphan libs/components/hooks that only existed to feed them. Routes traced to dead-ends via call-chain analysis (route → lib → hook → component → render site).

Routes removed (10):

  • /api/apify, /api/agentkit/get, /api/stripe/session/checked, /api/workspace/create (deprecated shim) — initial pass
  • /api/upload/pfp, /api/stripe/session/list, /api/get_running_agent, /api/get_artists_by_socials, /api/ipfs, /api/funnel_analysis — orphan-traced

Orphan code removed: lib/uploadPfp, lib/uploadPfpToIpfs, lib/stripe/getSession, lib/getRunningAgent, lib/getArtistsByAgent, lib/ipfs/* (whole dir), hooks/useShareHeatMap, components/SocialSharing/, lib/getFunnelAnalysis, lib/getFunnelChatContext, lib/chat/getFunnelAnalysis.

tsc --noEmit produces zero errors related to the deletions (pre-existing errors in SpotifyDeepResearchResult.tsx and extractSendEmailResults.test.ts are unchanged).

Test plan

  • CI green on preview
  • Smoke chat app on preview — login, open a chat, attach a file, hit Stripe checkout/portal, open agents page, open tasks page

Summary by CodeRabbit

  • Deprecations
    • Social sharing heatmap visualization with direct tweet generation capabilities
    • IPFS-based file and profile picture upload functionality
    • Stripe payment session checkout and management features
    • Funnel analysis dashboard and campaign performance reporting
    • Real-time agent monitoring and execution status tracking
    • Workspace creation API endpoints

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-chat Ready Ready Preview Apr 25, 2026 4:11am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b0639232-8ff0-4586-81f6-54189b13d272

📥 Commits

Reviewing files that changed from the base of the PR and between 4c6ca68 and ceb7054.

📒 Files selected for processing (26)
  • app/api/agentkit/get/route.ts
  • app/api/apify/route.ts
  • app/api/funnel_analysis/route.ts
  • app/api/get_artists_by_socials/route.tsx
  • app/api/get_running_agent/route.ts
  • app/api/ipfs/route.tsx
  • app/api/stripe/session/checked/route.ts
  • app/api/stripe/session/list/route.ts
  • app/api/upload/pfp/route.tsx
  • app/api/workspace/create/route.ts
  • components/SocialSharing/SocialSharing.tsx
  • components/SocialSharing/index.tsx
  • hooks/useShareHeatMap.tsx
  • lib/chat/getFunnelAnalysis.tsx
  • lib/getArtistsByAgent.tsx
  • lib/getFunnelAnalysis.tsx
  • lib/getFunnelChatContext.tsx
  • lib/getRunningAgent.tsx
  • lib/ipfs/getIpfsLink.tsx
  • lib/ipfs/hash.ts
  • lib/ipfs/saveFile.tsx
  • lib/ipfs/upload.ts
  • lib/ipfs/uploadToIpfs.tsx
  • lib/stripe/getSession.tsx
  • lib/uploadPfp.tsx
  • lib/uploadPfpToIpfs.tsx
💤 Files with no reviewable changes (26)
  • components/SocialSharing/index.tsx
  • lib/uploadPfp.tsx
  • lib/getRunningAgent.tsx
  • app/api/ipfs/route.tsx
  • lib/ipfs/getIpfsLink.tsx
  • lib/getFunnelAnalysis.tsx
  • components/SocialSharing/SocialSharing.tsx
  • lib/getArtistsByAgent.tsx
  • lib/ipfs/hash.ts
  • lib/ipfs/saveFile.tsx
  • hooks/useShareHeatMap.tsx
  • lib/stripe/getSession.tsx
  • lib/uploadPfpToIpfs.tsx
  • lib/chat/getFunnelAnalysis.tsx
  • app/api/stripe/session/list/route.ts
  • app/api/apify/route.ts
  • app/api/upload/pfp/route.tsx
  • app/api/stripe/session/checked/route.ts
  • app/api/workspace/create/route.ts
  • app/api/get_artists_by_socials/route.tsx
  • lib/getFunnelChatContext.tsx
  • lib/ipfs/upload.ts
  • app/api/agentkit/get/route.ts
  • app/api/get_running_agent/route.ts
  • lib/ipfs/uploadToIpfs.tsx
  • app/api/funnel_analysis/route.ts

📝 Walkthrough

Walkthrough

This pull request removes a comprehensive set of deprecated API routes, React components, hooks, and utility functions across the application. The deletions span agent management endpoints, funnel analysis features, IPFS upload functionality, Stripe session handlers, social sharing components, and associated helper utilities totaling approximately 500+ lines of code removed.

Changes

Cohort / File(s) Summary
API Routes - Agent & Analysis
app/api/agentkit/get/route.ts, app/api/funnel_analysis/route.ts, app/api/get_running_agent/route.ts, app/api/get_artists_by_socials/route.tsx
Removed GET/POST endpoints that fetched agent data, funnel analytics, running agent status, and artist data from Supabase. Deleted associated route config exports (dynamic, fetchCache, revalidate).
API Routes - Webhook & IPFS Upload
app/api/apify/route.ts, app/api/ipfs/route.tsx
Removed Apify webhook POST handler and IPFS file upload POST endpoint with related form data processing and Pinata integration.
API Routes - Stripe Session & Workspace
app/api/stripe/session/checked/route.ts, app/api/stripe/session/list/route.ts, app/api/workspace/create/route.ts
Deleted Stripe session GET endpoints (metadata update and session listing) and deprecated workspace creation POST handler with proxy forwarding.
Components & Hooks - Social Sharing
components/SocialSharing/SocialSharing.tsx, components/SocialSharing/index.tsx, hooks/useShareHeatMap.tsx
Removed SocialSharing component with interactive heatmap visualization and useShareHeatMap hook that converted heatmaps to PNG and uploaded to IPFS.
Utility Functions - Funnel Analysis
lib/chat/getFunnelAnalysis.tsx, lib/getFunnelAnalysis.tsx, lib/getFunnelChatContext.tsx
Deleted functions that fetched funnel analytics from Supabase and compiled analytics context for chat. Removed dependency chain between modules.
Utility Functions - Agent & Artist
lib/getArtistsByAgent.tsx, lib/getRunningAgent.tsx
Removed helper functions that called deleted API endpoints to fetch artist IDs from agent socials and running agent status data.
Utility Functions - IPFS & Hashing
lib/ipfs/saveFile.tsx, lib/ipfs/upload.ts, lib/ipfs/uploadToIpfs.tsx, lib/ipfs/getIpfsLink.tsx, lib/ipfs/hash.ts
Deleted IPFS upload pipeline including Pinata API client, file hashing, CID caching, and gateway URL formatting utilities.
Utility Functions - Stripe & PFP Upload
lib/stripe/getSession.tsx, lib/uploadPfp.tsx, lib/uploadPfpToIpfs.tsx
Removed Stripe session retrieval helper, PFP upload endpoint caller, and IPFS-based PFP upload workflow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • sweetmantech
  • cubic-dev-ai

Poem

🗑️ Routes and hooks bid their farewell,
IPFS dreams and stripe spells cast away,
Funnels flow no more through the well,
Clean slate emerges, a brighter day! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Solid & Clean Code ✅ Passed PR exemplifies clean code practices by removing 600+ lines of orphaned dead code with zero in-repo references, properly cascading dependency cleanup, and maintaining appropriate module sizing in remaining code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-dead-routes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Removing API endpoints, especially webhook and payment-related ones like /api/apify and /api/stripe/session/checked, requires human verification of external dependencies.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b2ede6f3a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread app/api/apify/route.ts
* API endpoint for Apify webhooks.
* Accepts a POST request with a JSON payload, optionally fetches a dataset, and always responds with 200.
*/
export async function POST(req: NextRequest) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep Apify webhook endpoint available

Removing this handler breaks webhook-based Apify ingestion whenever a scraper run is triggered: both lib/apify/posts/runInstagramProfilesScraper.ts and lib/apify/comments/runInstagramCommentsScraper.ts still append APIFY_WEBHOOKS_VALUE as the webhook target, and that config is still the chat app webhook (/api/apify) in lib/consts.ts. With this route deleted, completed Apify runs will callback to 404, so downstream processing (dataset handling, saves, follow-up runs, notifications) no longer executes.

Useful? React with 👍 / 👎.

- /api/upload/pfp, /api/stripe/session/list, /api/get_running_agent,
  /api/get_artists_by_socials, /api/ipfs, /api/funnel_analysis
- orphan libs/components only reachable from these routes:
  lib/uploadPfp, lib/uploadPfpToIpfs, lib/stripe/getSession,
  lib/getRunningAgent, lib/getArtistsByAgent, lib/ipfs/*,
  hooks/useShareHeatMap, components/SocialSharing/,
  lib/getFunnelAnalysis, lib/getFunnelChatContext, lib/chat/getFunnelAnalysis

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@arpitgupta1214 arpitgupta1214 changed the title chore(chat): remove four dead api routes chore(chat): remove ten dead api routes Apr 25, 2026
@sweetmantech sweetmantech merged commit 7372f17 into test Apr 27, 2026
4 checks passed
@sweetmantech sweetmantech deleted the chore/remove-dead-routes branch April 27, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants