Overview
Sistema Financiero is a Next.js application that can be deployed to any platform supporting Node.js 20+. This guide covers the most popular deployment platforms.All deployment methods require a configured Supabase project. Complete Supabase Configuration first.
Deployment Platforms Comparison
| Platform | Free Tier | Build Time | Edge Network | Best For |
|---|---|---|---|---|
| Vercel | ✅ Hobby (generous) | ~2 min | ✅ Global CDN | Next.js apps (recommended) |
| Railway | ❌ $5/month | ~3 min | ✅ Global | Full-stack with DB |
| Netlify | ✅ Starter | ~2 min | ✅ Global CDN | Static + serverless |
| Render | ✅ Free tier | ~5 min | ❌ Single region | Simple deployments |
| Cloudflare Pages | ✅ Free (unlimited) | ~2 min | ✅ 300+ locations | Edge-first apps |
| Self-Hosted | ✅ (your server) | ~2 min | ❌ | Full control |
Deploy to Vercel (Recommended)
Prerequisites
- GitHub, GitLab, or Bitbucket account
- Code pushed to a repository
- Supabase project configured
Deployment Steps
Import Project to Vercel
- Go to vercel.com and sign in with GitHub
- Click Add New → Project
- Select your
sistema-financierorepository - Click Import
Vercel auto-detects Next.js and configures build settings.
Configure Environment Variables
Before deploying, add environment variables:
- In the Configure Project screen, expand Environment Variables
- Add each variable:
| Key | Value | Environment |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Your Supabase URL | Production, Preview, Development |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Your Supabase anon key | Production, Preview, Development |
OPENROUTER_API_KEY | Your OpenRouter key (optional) | Production, Preview, Development |
NEXT_PUBLIC_APP_URL | https://your-app.vercel.app | Production |
Deploy
Click Deploy and wait ~2 minutes.You’ll see build logs streaming. Once complete, you’ll get a deployment URL like:
Custom Domain (Optional)
Add Domain in Vercel
- Go to your project Settings → Domains
- Enter your domain (e.g.,
finanzas.tuempresa.com) - Click Add
Configure DNS
Vercel will show DNS records to add:For root domains (example.com):For subdomains (app.example.com):Add these records in your domain registrar (GoDaddy, Namecheap, Cloudflare, etc.)
Continuous Deployment
Vercel automatically deploys on everygit push:
- Production: Commits to
mainbranch →your-app.vercel.app - Preview: Commits to other branches →
your-app-git-branch.vercel.app - Pull Requests: Each PR gets a unique preview URL
Deploy to Railway
Deployment Steps
Create Railway Account
- Go to railway.app
- Sign up with GitHub
- Verify your email
Create New Project
- Click New Project
- Select Deploy from GitHub repo
- Choose your
sistema-financierorepository - Click Deploy Now
Configure Build Settings
Railway auto-detects Next.js. If needed, manually set:
- Build Command:
npm run build - Start Command:
npm run start - Port:
3000(auto-detected)
Custom Domain on Railway
- Go to Settings → Networking
- Click Custom Domain
- Enter your domain and follow DNS instructions
- Add the provided CNAME record to your DNS
Railway provides automatic SSL certificates for custom domains.
Deploy to Netlify
Deployment Steps
Create Netlify Account
- Go to netlify.com
- Sign up with GitHub
Import Project
- Click Add new site → Import an existing project
- Select GitHub
- Authorize Netlify
- Choose your repository
Configure Build Settings
Netlify should auto-detect these settings:
- Build command:
npm run build - Publish directory:
.next - Functions directory:
.netlify/functions(auto-created)
Add Environment Variables
- Go to Site settings → Build & deploy → Environment
- Click Edit variables
- Add each variable:
Deploy to Render
Create Render Account
Sign up at render.com with GitHub.
Create Web Service
- Click New → Web Service
- Connect your GitHub repository
- Configure:
- Name:
sistema-financiero - Environment:
Node - Build Command:
npm install && npm run build - Start Command:
npm run start
- Name:
Deploy to Cloudflare Pages
Configure for Cloudflare Pages
Cloudflare Pages requires adapter configuration. Add to Install adapter:
package.json:package.json
Terminal
Self-Hosted Deployment
Using Docker
Using PM2 (Node.js Process Manager)
Nginx Reverse Proxy
If running on a VPS, use Nginx as a reverse proxy:/etc/nginx/sites-available/sistema-financiero
Terminal
Post-Deployment Checklist
Verify Application Loads
Visit your deployment URL and check:
- ✅ Dashboard loads without errors
- ✅ No console errors in browser DevTools (F12)
- ✅ Favicon and images load
Test Database Connection
- Try adding a transaction via the manual form
- Check if it appears in the dashboard
- Verify data is saved in Supabase Table Editor
Test AI Features (if enabled)
- Go to the AI chat page (
/agente-mejorado) - Send a test message: “Gasté $100 en gasolina”
- Verify the transaction is registered
Check Performance
Run PageSpeed Insights:Target scores:
- Performance: 90+
- Accessibility: 95+
- Best Practices: 95+
- SEO: 90+
Set Up Monitoring (Optional)
Add error tracking with Sentry:Or use Vercel Analytics (free for Vercel deployments):
Terminal
Terminal
app/layout.tsx
Troubleshooting Deployment Issues
Build fails with 'Module not found'
Build fails with 'Module not found'
Problem: Missing dependencies or incorrect imports.Solution:Check import paths are correct:
Application crashes on startup
Application crashes on startup
Problem: Missing environment variables or runtime errors.Solution:
- Check deployment logs for error messages
- Verify all required env vars are set in platform UI
- Ensure
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEYare present - Test locally with production env:
API routes return 500 errors
API routes return 500 errors
Problem: Server-side errors in API routes.Solution:
- Check server logs (Vercel: Deployment logs, Railway: Service logs)
- Common issues:
- Missing
OPENROUTER_API_KEY(if using AI features) - Supabase connection fails (check URL/key)
- CORS issues (check API route headers)
- Missing
- Add error logging:
Slow cold start times
Slow cold start times
Problem: First request after idle takes 10+ seconds.Solution:
- Vercel: Upgrade to Pro plan for always-warm instances
- Railway: No cold starts (paid plans keep services running)
- Render: Free tier spins down after 15min idle (upgrade to keep alive)
- Self-hosted: No cold starts
Database queries are slow
Database queries are slow
Problem: Dashboard takes 5+ seconds to load.Solution:
- Check Supabase region matches deployment region
- Verify indexes exist (see Supabase Configuration)
- Add query optimization:
Rollback Deployment
Vercel
- Go to Deployments tab
- Find previous working deployment
- Click ⋯ → Promote to Production
Railway
- Go to Deployments tab
- Find previous deployment
- Click Redeploy
Git-Based Rollback
For any platform:Terminal
Next Steps
Dashboard Features
Learn how to use the dashboard
API Reference
Integrate with the API
Customization
Customize the UI and features
Troubleshooting
Fix common problems