Overview
Railway provides a managed platform for deploying Timepoint Pro with internal service networking. This guide covers deploying both the standalone open-source engine and the Pro-Cloud wrapper.Railway Configuration
The open-source repo includes a minimalrailway.toml for basic deployments:
Service Architecture
For Pro-Cloud deployments, Railway manages these services:Standalone Engine Deployment
Deploy the open-source engine directly:1. Create Railway Project
2. Add Postgres Service
DATABASE_URL.
3. Configure Environment Variables
In Railway dashboard, add:4. Deploy
5. Verify Deployment
Pro-Cloud Deployment
Full production deployment with Celery, Redis, and JWT auth.Service Definitions
1. Postgres Service
${{Postgres.DATABASE_URL}}- Connection string- Automatic backups
- Managed scaling
2. Redis Service
${{Redis.REDIS_URL}}- Connection string- Used for Celery broker and result backend
3. API Service (FastAPI)
railway.toml:
4. Celery Worker Service
Procfile:
railway.toml:
Internal Networking
Railway services communicate via internal DNS:Database Migrations
Initial Schema
Using Alembic
railway.toml:
Scaling
API Service Scaling
Celery Worker Scaling
Monitoring
Railway Logs
Metrics
Railway dashboard shows:- CPU usage
- Memory usage
- Network traffic
- Request count
- Error rate
Health Checks
API health endpoint:Postgres Configuration
Connection Pooling
Read Replicas (Railway Pro)
For high-traffic deployments:Environment Variable Management
Secrets Management
Store secrets in Railway’s environment variables:Environment Inheritance
Deployment Workflow
GitHub Integration
- Connect GitHub repo in Railway dashboard
- Enable auto-deploy on push to
main - Preview deployments for PRs (optional)
CI/CD Pipeline
Cost Optimization
Railway Pricing
- Starter: $5/month per service
- Pro: Usage-based pricing
- Postgres/Redis: Separate charges
Optimization Tips
- Use sleep mode: Railway can sleep inactive services
- Right-size resources: Monitor and adjust CPU/memory
- Connection pooling: Reduce database connections
- Redis caching: Cache expensive queries
- Batch jobs: Use Celery for background processing
Troubleshooting
Common Issues
“Database connection failed”- Check health endpoint is responding
- Verify
PORTenvironment variable is used - Check Railway logs for startup errors
Security
Network Security
- Railway services are isolated by default
- Internal networking uses private DNS
- Public endpoints require explicit configuration
Secrets Rotation
Database Security
- Railway manages SSL certificates
- Use connection string with
sslmode=require - Enable Postgres connection logging (Railway Pro)
Next Steps
- Pro-Cloud Architecture - Understand the wrapper layer
- Docker Setup - Container configuration
- Local Development - Run locally before deploying

