- Node.js 20+
- PostgreSQL 16+ (or use Docker)
- npm or yarn
- Push to GitHub
- Import project on vercel.com
- Add environment variables
- Deploy
DATABASE_URL=postgresql://...
NEXTAUTH_SECRET=your-secret
NEXTAUTH_URL=https://your-domain.vercel.app
Use Neon, Supabase, or Railway for PostgreSQL.
# Build image
docker build -t ideabank .
# Run with PostgreSQL
docker-compose up -dservices:
app:
build: .
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/ideabank
depends_on:
- db
db:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ideabank
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:- Create account on railway.app
- New Project → Deploy from GitHub
- Add PostgreSQL plugin
- Set environment variables
- Deploy
- Linux server (Ubuntu 22.04+)
- Node.js 20+
- PostgreSQL 16+
- Nginx (reverse proxy)
- PM2 (process manager)
# Clone repository
git clone https://github.com/khamal/ideabank.git
cd ideabank
# Install dependencies
npm ci
# Setup environment
cp .env.example .env.local
# Edit .env.local with your values
# Build
npm run build
# Start with PM2
pm2 start npm --name "ideabank" -- start
pm2 save
pm2 startupserver {
listen 80;
server_name ideabank.dev;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}# Create migration
npx prisma migrate dev --name migration_name
# Apply to production
npx prisma migrate deploy
# Reset database (dev only)
npx prisma migrate resetcurl https://your-domain/api/health
# {"status":"ok","timestamp":"...","version":"0.1.0"}# PM2 logs
pm2 logs ideabank
# Docker logs
docker-compose logs -f app- Check DATABASE_URL format
- Ensure PostgreSQL is running
- Check firewall rules
- Verify credentials
- Run
npm installto ensure dependencies - Check Node.js version (20+)
- Verify environment variables
- Increase Node.js memory:
NODE_OPTIONS="--max-old-space-size=4096" - Check for memory leaks in logs
- Consider scaling horizontally