Deployment & Vercel Strategy
Deployment Overview
The Indian Startup Funding Tracker is optimized for deployment on Vercel. Since the application relies on a static data architecture to ensure high performance and neo-brutalist animations, the deployment strategy involves a pre-build step to generate the funding datasets.
Prerequisites
- A Vercel account.
- The repository pushed to GitHub, GitLab, or Bitbucket.
- Node.js 18+ and npm/pnpm/yarn installed locally.
Data Generation Strategy
Before the Next.js build process begins, the application must process raw data into the format consumed by the UI components. This is handled via a configuration file and a generation script.
- Currency Configuration: Ensure the conversion rate is set in
config/currency.js. - Generate Data: The command
npm run generate-datamust be executed to populatedata/funding-data.ts.
Vercel Deployment Steps
To deploy the application with the required data generation:
- Import Project: In the Vercel Dashboard, click New Project and select your repository.
- Build Settings: Modify the default Build Command to include the data generation script:
- Build Command:
npm run generate-data && next build - Install Command:
npm install
- Build Command:
- Environment Variables: While the core app is static, ensure any future API keys (e.g., for external news sources) are added here.
- Deploy: Click Deploy. Vercel will run the script, generate the TypeScript data files, and compile the optimized Next.js build.
Vercel Analytics Integration
The application includes built-in support for Vercel Analytics via the @vercel/analytics package. This is pre-configured in the RootLayout (app/layout.tsx).
To enable data collection:
- Navigate to the Analytics tab in your Vercel project dashboard.
- Click Enable.
- Redeploy the application (or trigger a new build) to activate the tracking script.
Production Optimization
The deployment utilizes several Vercel-specific features to maintain the "Neo-brutalism" UI performance:
| Feature | Role in Project |
| :--- | :--- |
| Edge Middleware | Handles fast routing for the explore and analytics pages. |
| Static Site Generation (SSG) | All deal pages (app/deal/[id]/page.tsx) are pre-rendered at build time for instant loading. |
| Image Optimization | Automatically handles icons and logos defined in metadata and components. |
Updating Data Post-Deployment
To update the funding records or the USD-to-INR conversion rate on a live site:
- Update the source data or modify
config/currency.js. - Commit the changes to your main branch.
- Vercel will automatically trigger a new deployment, running
npm run generate-dataagain to refresh the analytics and deal lists.
# Example: Manual update and push
git add config/currency.js
git commit -m "chore: update INR conversion rate to 83.50"
git push origin main
Troubleshooting Builds
If the deployment fails during the next build step, verify that the data/funding-data.ts file exists. This file is ignored by .gitignore in some configurations and must be generated during the Vercel build process using the combined command mentioned in the Build Settings section.