safetyMaster / RAILWAY_DEPLOY_GUIDE.md
mrvero's picture
Upload folder using huggingface_hub
0469d65 verified

A newer version of the Gradio SDK is available: 5.43.1

Upgrade

πŸš€ Deploy SafetyMaster Pro to Railway

βœ… Pre-Deployment Checklist

Your app is now Railway-ready! I've optimized:

  • βœ… Dockerfile for cloud deployment
  • βœ… Port configuration for Railway
  • βœ… Health check endpoints
  • βœ… Environment variable support
  • βœ… Docker build optimization

🎯 Quick Deploy (5 Minutes)

Step 1: Push to GitHub

# Add all the new Railway configuration files
git add .
git commit -m "Optimize for Railway deployment"
git push origin main

Step 2: Deploy to Railway

  1. Go to railway.app
  2. Sign up/Login with your GitHub account
  3. Click "New Project"
  4. Select "Deploy from GitHub repo"
  5. Choose your safetyMaster repository
  6. Railway auto-detects Dockerfile and deploys!

Step 3: Configure Environment (Optional)

In Railway dashboard β†’ Variables tab:

FLASK_ENV=production
SECRET_KEY=your-secret-key-here

Step 4: Access Your App

  • Railway provides a URL like: https://your-app-name.railway.app
  • HTTPS is automatically enabled
  • Custom domains available in settings

πŸŽ₯ Camera Access in Cloud

Important: Cloud deployments can't access your local camera directly. Users will need to:

  1. Access the web app from devices with cameras (phones, laptops)
  2. Grant camera permissions when prompted by the browser
  3. Use the web interface to start monitoring

The AI processing happens on Railway's servers, but video comes from user devices.

πŸ’° Pricing

  • Hobby Plan: $5/month + usage
  • Pro Plan: $20/month + usage
  • Usage: ~$0.01-0.10 per hour of active monitoring

πŸ”§ Troubleshooting

Build Issues

If build fails, check Railway logs:

  1. Go to Railway dashboard
  2. Click on your project
  3. Check "Deployments" tab for error logs

Camera Not Working

  • Ensure HTTPS is enabled (Railway provides this automatically)
  • Users must grant camera permissions in browser
  • Test with different browsers/devices

Performance Issues

  • Upgrade to Railway Pro plan for better performance
  • Monitor resource usage in Railway dashboard

🌟 Production Features

Your deployed app includes:

  • Real-time AI safety detection
  • Web dashboard with live video
  • Violation logging and alerts
  • Multi-device camera support
  • Professional UI with statistics
  • Automatic violation capture

πŸ”— Next Steps

  1. Deploy now using the steps above
  2. Test with your camera on the deployed URL
  3. Share the URL with your team
  4. Monitor usage in Railway dashboard
  5. Set up custom domain (optional)

πŸ†˜ Need Help?

If you encounter any issues:

  1. Check Railway deployment logs
  2. Verify all files are committed to GitHub
  3. Ensure camera permissions are granted
  4. Test on different devices/browsers

Your SafetyMaster Pro is ready for production deployment! πŸŽ‰