Coding

Replit → Vercel Migration

Migrate a Replit project to Vercel: clean Replit files, update scripts, add secure SendGrid API route, audit DB, add docs, and prepare one-click production depl

#migration#vercel#replit#node20#next.js#vite#express#serverless#sendgrid#environment variables#api routes#prisma#mongodb#readme#gitignore

Prompt

You are an AI agent. Migrate this project from Replit to Vercel.  

Requirements:
- Remove all Replit-specific files/config (.replit, replit.nix, etc).
- Update package.json scripts for Vercel (`dev`, `build`, etc).
- Ensure the app builds and runs cleanly on Vercel (Node 20).
- Default: rely on Vercel’s auto-detection for frameworks and serverless functions.
  - If auto-detection is not sufficient, create a `vercel.json` with the correct functions and routing.
- Check and restructure all API routes so they conform to Vercel standards:
  - For Next.js → move endpoints into `pages/api/*` or `app/api/*/route.ts`.
  - For non-Next.js → implement endpoints as serverless functions under `api/*.ts`.
  - Ensure routes only expose what is safe to the client.

Environment variables in Vercel:
- SENDGRID_API_KEY (server-only, never exposed client-side)

Email:
- Implement a server route for SendGrid (e.g., `api/email/send`) that never exposes SENDGRID_API_KEY to the client.

Database check:
- If the project uses a database:
  - Inspect whether it has any tables or data.
  - If the DB is empty → skip migration (and remove DB code if unnecessary).
  - If the DB has data/tables → STOP and refer back to the user with a summary of what you found, asking for next steps before proceeding.

Docs & hygiene:
- Add `.env.local.example` showing SENDGRID_API_KEY.
- Add `.gitignore`.
- Add a short README with: overview, env var table, local dev, deploy steps, and API route notes.

Deliverables:
- Make code changes in-place.
- Summarize changes (files touched + purpose).
- List manual follow-ups (confirm SENDGRID_API_KEY in Vercel).
- Provide simple deploy steps:  
  1) `npm i && npx vercel link`  
  2) Set SENDGRID_API_KEY in Vercel  
  3) `npx vercel --prod`

Final step:
- Commit and push all changes so the user can immediately test the deployment on Vercel.
Sam Holstein
Written by
Sam Holstein
@msamholstein_6ead51

AI consultant and software creator helping businesses and creators harness artificial intelligence through practical solutions and innovative products. Creator of BestPromptIdeas.com.

Reviews

0 reviews

No reviews yet. Be the first to leave feedback.

Sign in to leave a rating or review.

Related prompts

View category →
Coding

Architecture Review & Fix Strategy

AI chooses between minimal patch, structural refactor, or both; delivers concise architecture review and solution strategy.

#software architecture#code review#refactoring#debugging+3
Sam Holstein
Sam Holstein
Coding

Collaborative Coding Agent

Act as a coding agent that seeks approval before changes and pauses for testing. Review the provided codebase and deliver a concise high‑level summary.

#coding agent#code review#software development#testing+3
Sam Holstein
Sam Holstein
Coding

Whole-Repo Architecture Review (Read-Only)

Run a read-only, whole-repo architecture review with sourced citations, risks, simplifications, target design, and a phased migration plan.

#architecture review#repository analysis#codebase audit#software architecture+9
Sam Holstein
Sam Holstein
Coding

Modernize Objective-C App to Swift & SwiftUI

Convert an 11-year-old Objective-C app into a fully modern SwiftUI app with zero data loss, responsive UI, and native SwiftUI components.

#swiftui#app modernization#objective-c to swift#ios development+2
Sam Holstein
Sam Holstein
Coding

Public Web Portfolio Audit & Cleanup

Audit a portfolio site’s public-facing code and assets for quality, security, and accessibility. Fix issues with reversible commits and produce SUMMARY.md.

#website audit#portfolio site#frontend code review#security hygiene+6
Sam Holstein
Sam Holstein
Coding

Code Performance Analyzer

Analyze any codebase for runtime speed, bottlenecks, and efficiency improvements.

#code analysis#performance optimization#efficiency audit#software engineering
Sam Holstein
Sam Holstein