This guide covers different deployment options for the InternBot application.
Best for: Easy deployment with automatic scaling
-
Connect Repository:
- Go to Vercel
- Import your GitHub repository
- Select the
frontendfolder as root directory
-
Configure Environment Variables:
VITE_BACKEND_URL=https://your-backend-url.railway.app VITE_NODE_ENV=production -
Deploy: Vercel will automatically build and deploy
-
Connect Repository:
- Go to Railway
- Connect your GitHub repository
- Select the
backendfolder
-
Add Database:
- Add PostgreSQL service
- Enable pgvector extension
-
Configure Environment Variables:
DB_HOST=your-db-host DB_PORT=5432 DB_USER=postgres DB_PASSWORD=your-password DB_NAME=internbot -
Deploy: Railway will automatically build and deploy
Best for: Cost-effective solution with good performance
-
Connect Repository:
- Go to Netlify
- Connect your GitHub repository
- Set build command:
cd frontend && npm run build - Set publish directory:
frontend/dist
-
Configure Environment Variables:
VITE_BACKEND_URL=https://your-backend-url.com
-
Create App:
- Go to DigitalOcean App Platform
- Create new app from GitHub
- Select backend folder
-
Add Database:
- Add managed PostgreSQL database
- Enable pgvector extension
-
Configure Environment Variables:
DB_HOST=your-db-host DB_PORT=5432 DB_USER=postgres DB_PASSWORD=your-password DB_NAME=internbot
Best for: Complete control and custom infrastructure
-
Prepare VPS:
# Install Docker and Docker Compose curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh sudo usermod -aG docker $USER # Install Docker Compose sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
-
Deploy Application:
# Clone repository git clone <your-repo-url> cd InternBot # Configure environment variables cp .env.example .env # Edit .env with your configuration # Start services docker-compose up -d --build
-
Configure Reverse Proxy (Nginx):
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location /api/ { proxy_pass http://localhost:8000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
- ECS: Use ECS with Fargate for container orchestration
- EC2: Deploy on EC2 instances with Docker
- RDS: Use RDS PostgreSQL with pgvector
- Cloud Run: Serverless container deployment
- GKE: Kubernetes cluster deployment
- Cloud SQL: Managed PostgreSQL with pgvector
- Container Instances: Simple container deployment
- AKS: Kubernetes service
- Azure Database: Managed PostgreSQL
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your-password
DB_NAME=internbot
# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=false
# Security
SECRET_KEY=your-secret-key# API Configuration
VITE_BACKEND_URL=https://your-backend-url.com
VITE_NODE_ENV=production
# Optional: Analytics
VITE_GA_TRACKING_ID=your-ga-id- Frontend:
GET /- Should return 200 - Backend:
GET /health- Should return 200 - Database: Connection test
# Docker logs
docker-compose logs -f
# Specific service logs
docker-compose logs -f backend
docker-compose logs -f frontend
docker-compose logs -f db# Pull latest changes
git pull origin main
# Rebuild and restart
docker-compose down
docker-compose up -d --build- Use Let's Encrypt for free SSL certificates
- Configure HTTPS redirects
- Set secure headers
- Use strong passwords
- Enable SSL connections
- Restrict network access
- Regular backups
- Rate limiting
- CORS configuration
- Input validation
- Error handling
- Enable gzip compression
- Use CDN for static assets
- Implement caching strategies
- Optimize images
- Database connection pooling
- Caching frequently accessed data
- Optimize database queries
- Use async/await properly
- Proper indexing
- Regular maintenance
- Connection pooling
- Query optimization
- Check CORS configuration
- Verify backend URL in environment variables
- Check network connectivity
- Verify database credentials
- Check network connectivity
- Ensure pgvector extension is installed
- Check Node.js version compatibility
- Verify all dependencies are installed
- Check for TypeScript errors
# Check service status
docker-compose ps
# View logs
docker-compose logs -f [service-name]
# Access container shell
docker-compose exec [service-name] /bin/bash
# Check database connection
docker-compose exec db psql -U postgres -d internbotFor deployment issues:
- Check the logs first
- Verify environment variables
- Test connectivity between services
- Create an issue in the repository
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to production
run: |
# Your deployment commands hereThis deployment guide should help you get your InternBot application running in production! π