Overview
OmniSearches can be deployed to various hosting platforms. This guide covers deployment to Railway (recommended), as well as other popular platforms.Prerequisites
Before deploying, ensure you have:- A Google API key with Gemini API access
- An OpenRouter API key with Deepseek model access
- A GitHub account (for most deployment options)
- Node.js v18 or higher installed locally
Deploy to Railway
Railway is the recommended platform for deploying OmniSearches. It offers simple deployment, automatic scaling, and built-in environment variable management.One-Click Deployment
The fastest way to deploy to Railway:- Click the Deploy on Railway button
- Log in with your GitHub account
- Configure your environment variables:
GOOGLE_API_KEYREASON_MODEL_API_KEYREASON_MODEL_API_URLREASON_MODEL(optional)
- Click Deploy
Manual Railway Deployment
To deploy manually to Railway:- Install Railway CLI:
- Login to Railway:
- Initialize a new project:
- Set environment variables:
- Deploy:
Railway Configuration
Railway automatically detects the build and start commands frompackage.json:
- Build command:
npm run build - Start command:
npm run start
- Installs dependencies (
npm install) - Builds the frontend with Vite
- Bundles the backend with esbuild
- Outputs to the
dist/directory
Railway’s free tier includes 500 execution hours per month and $5 of credit, which is sufficient for testing and small projects.
Deploy to Vercel
Vercel is optimized for frontend applications but can also host Node.js backends using serverless functions.Deployment Steps
- Install Vercel CLI:
- Login:
- Deploy:
- Set environment variables in the Vercel dashboard:
- Go to Project Settings → Environment Variables
- Add all required environment variables
- Redeploy to apply changes
Vercel Configuration
Create avercel.json file in your project root:
vercel.json
Deploy with Docker
For self-hosting or deploying to container platforms:Create Dockerfile
Create aDockerfile in your project root:
Dockerfile
Build and Run
.env file:
Deploy to Heroku
Deploy to Heroku using Git:- Install Heroku CLI:
- Login and create app:
- Set environment variables:
- Deploy:
Heroku Configuration
Create aProcfile in your project root:
Procfile
Deploy to DigitalOcean App Platform
- Connect your GitHub repository to DigitalOcean
- Configure the build settings:
- Build Command:
npm run build - Run Command:
npm start
- Build Command:
- Set environment variables in the App Platform console
- Deploy
Environment-Specific Deployment Notes
Production Checklist
Before deploying to production:Security
Security
- All API keys are set as environment variables (not in code)
-
NODE_ENVis set toproduction -
.envfile is in.gitignore - HTTPS is enabled
- CORS is properly configured if needed
Performance
Performance
- Build process completes successfully
- Static assets are properly bundled
- Production optimizations are enabled
- API rate limits are configured
Monitoring
Monitoring
- Error logging is configured
- API usage monitoring is set up
- Health check endpoint is working
- Deployment notifications are configured
Build Commands Reference
OmniSearches uses these npm scripts for deployment:| Command | Purpose | When to Use |
|---|---|---|
npm run build | Full production build | Deployment, CI/CD |
npm run start | Start production server | After build, in production |
npm run dev | Development server | Local development only |
npm run check | TypeScript type checking | Pre-deployment validation |
The build command compiles both frontend and backend code. Frontend is built with Vite, backend is bundled with esbuild.
Post-Deployment
After deploying, verify your installation:-
Test the application:
- Visit your deployment URL
- Try a search query
- Test reasoning mode
- Check image search functionality
-
Monitor API usage:
- Check Google Cloud Console for Gemini API usage
- Monitor OpenRouter dashboard for credits
-
Set up monitoring:
- Configure uptime monitoring
- Set up error tracking (e.g., Sentry)
- Enable API usage alerts
Troubleshooting
Build Failures
If your build fails:- Check Node.js version (requires v18+)
- Verify all dependencies are listed in
package.json - Review build logs for specific errors
- Ensure TypeScript compilation succeeds locally
Runtime Errors
If your deployed app fails to start:- Verify all required environment variables are set
- Check that
NODE_ENVis set toproduction - Review application logs in your hosting platform
- Ensure API keys are valid and active
API Errors
If search functionality doesn’t work:- Verify API keys have proper permissions
- Check API quotas and rate limits
- Test API keys locally first
- Review error messages in browser console
Continuous Deployment
Most platforms support automatic deployments from GitHub:- Connect your GitHub repository to your hosting platform
- Configure automatic deployments from the main branch
- Push changes to GitHub to trigger deployments
Scaling Considerations
For high-traffic deployments:- Railway: Automatically scales within plan limits
- Vercel: Scales automatically with serverless architecture
- Docker: Use container orchestration (Kubernetes, Docker Swarm)
- Load balancing: Add a reverse proxy (nginx, Caddy) for multiple instances
Need help with deployment? Check the GitHub repository for issues and discussions, or consult platform-specific documentation.