Nestr Deployment Guide
Production-ready deployment guide for Nestr engine (Railway) and web (Vercel).π Documentation Quick Links
- PRODUCTION_DEPLOYMENT - Complete production deployment guide with automated scripts
- DEPLOYMENT_QUICK_REFERENCE - Quick command reference cheatsheet
- This document - Detailed manual deployment steps
π Quick Deploy (Recommended)
For automated deployment with pre-deployment checks:Prerequisites
- Railway CLI installed:
npm install -g @railway/cli - Vercel CLI installed:
npm install -g vercel - Docker installed (for local testing)
- Node.js 18+ and Yarn
- Go 1.25+
Architecture Overview
- Web:
https://nestr.vercel.app(or custom domain) - API:
https://nestr-engine.up.railway.app(or custom domain)
Part 1: Railway Deployment (Engine - Backend)
Step 1: Initialize Railway Project
Step 2: Configure Environment Variables
In Railway dashboard or via CLI:Step 3: Deploy
Step 4: Verify Health
Step 5: Configure Custom Domain (Optional)
Part 2: Vercel Deployment (Web - Frontend)
Step 1: Prepare Environment
Step 2: Initialize Vercel Project
Step 3: Configure Environment Variables
In Vercel dashboard (Settings β Environment Variables) or via CLI:Step 4: Deploy to Production
Step 5: Verify Deployment
Visit your Vercel URL and test:- Homepage loads
- API connection works
- WebSocket connections establish (if applicable)
- Graph visualization renders
Step 6: Configure Custom Domain (Optional)
Part 3: CORS Configuration
Update Railway Environment
Update REST Server (if needed)
The engine automatically readsCORS_ALLOWED_ORIGINS from environment. Verify in internal/server/rest.go that CORS middleware is properly configured.
Part 4: Database & Persistence
Railway Volume Configuration
SQLite database is stored at/app/data/nestr.db in the container.
To persist data across deployments:
- Go to Railway dashboard β Your service β Settings
- Scroll to βVolumesβ
- Click βAdd Volumeβ
- Mount Path:
/app/data - Size: 1GB (or as needed)
- Mount Path:
- Redeploy service
Part 5: Monitoring & Observability
Health Check Endpoints
Monitor these endpoints for service health:Railway Logs
Vercel Analytics
Enable in Vercel dashboard:- Settings β Analytics β Enable Web Analytics
- Provides insights on performance, visitors, and errors
Part 6: CI/CD Pipeline (Optional)
GitHub Actions for Automated Deployment
Create .github/workflows/deploy.yml:RAILWAY_TOKENRAILWAY_PROJECT_IDVERCEL_TOKENVERCEL_ORG_IDVERCEL_PROJECT_ID
Part 7: Rollback Procedures
Railway Rollback
Vercel Rollback
Part 8: Troubleshooting
Engine Not Starting
Check logs:- Missing environment variables β Check
railway variables - Port binding β Ensure
PORTmatches Dockerfile EXPOSE - Database path β Verify volume is mounted
Frontend API Connection Failed
Check CORS:Database Locked
SQLite can lock under high concurrency:- Consider migrating to PostgreSQL for production
- Enable WAL mode (already enabled in code)
- Add connection pooling
Part 9: Performance Optimization
Railway
- Enable caching headers
- Use Railwayβs built-in CDN
- Consider upgrading plan for more resources
Vercel
- Enable Edge Functions (if needed)
- Configure caching policies in
vercel.json - Use ISR (Incremental Static Regeneration) for dynamic content
Part 10: Security Checklist
- Environment variables secured (not in code)
- HTTPS enforced on both services
- CORS properly configured
- Rate limiting enabled in engine
- API keys rotated regularly
- Database backups scheduled
- Health checks monitored
- Logs reviewed for suspicious activity
- Dependencies up to date (
yarn upgrade,go get -u)
Quick Reference
Support
- Railway docs: https://docs.railway.app
- Vercel docs: https://vercel.com/docs
- Nestr issues: https://github.com/Dev4rno/nestr/issues