This guide covers deploying TraceOff to various platforms.
-
Fork this repository
-
Connect to Vercel:
- Go to Vercel Dashboard
- Click "New Project"
- Import your forked repository
- Set Root Directory to
server - Deploy!
-
Configure Environment Variables:
NODE_ENV=production LOG_LEVEL=info CORS_ORIGIN=true CORS_CREDENTIALS=true RATE_LIMIT_GENERAL_MAX=100 RATE_LIMIT_CLEAN_MAX=20 RATE_LIMIT_HEALTH_MAX=1000
# Install Vercel CLI
npm i -g vercel
# Login to Vercel
vercel login
# Deploy from server directory
cd server
vercel --prodcd mobile
flutter build apk --release
# Output: build/app/outputs/flutter-apk/app-release.apkcd mobile
flutter build appbundle --release
# Output: build/app/outputs/bundle/release/app-release.aabcd mobile
flutter build ios --release
# Open Xcode and archive for App Store
open ios/Runner.xcworkspacecd mobile
flutter build web --release
# Deploy the build/web directory to any static hosting# Server Configuration
NODE_ENV=production
PORT=3000
HOST=0.0.0.0
# Logging
LOG_LEVEL=info
# CORS
CORS_ORIGIN=true
CORS_CREDENTIALS=true
# Rate Limiting
RATE_LIMIT_GENERAL_MAX=100
RATE_LIMIT_GENERAL_WINDOW=1m
RATE_LIMIT_CLEAN_MAX=20
RATE_LIMIT_CLEAN_WINDOW=1m
RATE_LIMIT_HEALTH_MAX=1000
RATE_LIMIT_HEALTH_WINDOW=1m
RATE_LIMIT_ADMIN_MAX=50
RATE_LIMIT_ADMIN_WINDOW=1m
# Security
ENABLE_HTTPS=true
RATE_LIMIT_WHITELIST_IPS=127.0.0.1,::1
# Performance
EXTERNAL_API_TIMEOUT=10000
EXTERNAL_API_RETRY_ATTEMPTS=3
CACHE_TTL=3600
ENABLE_CACHE=true
# Monitoring
ENABLE_METRICS=true
ENABLE_SWAGGER=true
ENABLE_DEBUG_ROUTES=falseFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist/ ./dist/
EXPOSE 3000
CMD ["node", "dist/index.js"]# Build server
cd server
npm run build
# Build Docker image
docker build -t traceoff-server .
# Run container
docker run -p 3000:3000 traceoff-server- Connect your GitHub repository
- Set Root Directory to
server - Configure environment variables
- Deploy!
- Create a new Web Service
- Connect your GitHub repository
- Set Root Directory to
server - Configure environment variables
- Deploy!
# Create Procfile
echo "web: node dist/index.js" > server/Procfile
# Deploy
cd server
git init
heroku create your-app-name
git add .
git commit -m "Deploy to Heroku"
git push heroku main- Logs: Available in Vercel dashboard
- Metrics: Built-in performance monitoring
- Alerts: Configure in project settings
# Health check endpoint
curl https://your-app.vercel.app/health
# API status
curl https://your-app.vercel.app/api/strategies-
Build Failures
- Check Node.js version (18+)
- Verify all dependencies are installed
- Check TypeScript compilation errors
-
Runtime Errors
- Verify environment variables
- Check logs for specific errors
- Ensure all required services are running
-
Performance Issues
- Monitor rate limiting
- Check external API timeouts
- Optimize database queries
# Enable debug logging
LOG_LEVEL=debug
ENABLE_DEBUG_ROUTES=true- Caching: Enable Redis for distributed caching
- CDN: Use Vercel's edge network
- Compression: Enable gzip compression
- Rate Limiting: Configure appropriate limits
- Code Splitting: Use lazy loading
- Image Optimization: Compress assets
- Bundle Size: Minimize dependencies
- Offline Support: Cache critical data
- Rate Limiting: Prevent abuse
- CORS: Configure appropriate origins
- Input Validation: Sanitize all inputs
- HTTPS: Always use secure connections
- Certificate Pinning: For API calls
- Data Encryption: Sensitive data at rest
- Secure Storage: Use platform keychain
- Code Obfuscation: Protect intellectual property
- Load Balancers: Distribute traffic
- Multiple Instances: Run multiple servers
- Database Clustering: For persistent storage
- CDN: Global content distribution
- Memory: Increase server memory
- CPU: Upgrade processing power
- Storage: Add more disk space
- Network: Increase bandwidth
For more help, check the Contributing Guide or open an issue.