Skip to content

Latest commit

 

History

History
100 lines (81 loc) · 2.71 KB

File metadata and controls

100 lines (81 loc) · 2.71 KB

SOCMINT.AI — Deployment Guide

Quick Start (Docker)

# Clone repo
git clone https://github.com/your-repo/socmint
cd socmint

# Create .env
cat > .env << EOF
JWT_SECRET=your-strong-secret-key-here
GITHUB_TOKEN=your-github-token
TWITTER_BEARER_TOKEN=your-twitter-token
EOF

# Start all services
docker-compose up -d

# Access
- Frontend: http://localhost:3000
- API: http://localhost:4000
- ML: http://localhost:8000
- MongoDB: mongodb://admin:socmint-password@localhost:27017
- Neo4j: http://localhost:7474
- Redis: redis://localhost:6379

Production Deployment (Kubernetes)

# Create namespace
kubectl create namespace socmint

# Deploy
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/secrets.yaml
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/mongodb.yaml
kubectl apply -f k8s/neo4j.yaml
kubectl apply -f k8s/redis.yaml
kubectl apply -f k8s/ml-backend.yaml
kubectl apply -f k8s/backend.yaml
kubectl apply -f k8s/frontend.yaml

# Verify
kubectl get pods -n socmint
kubectl get svc -n socmint

Environment Variables

Variable Required Default Notes
JWT_SECRET ✅ - Min 32 chars, use openssl rand -base64 32
MONGODB_URI ✅ - Format: mongodb://user:pass@host:27017/dbname
NEO4J_URI ✅ - Format: neo4j://host:7687
REDIS_URL ✅ - Format: redis://host:6379
ML_BACKEND_URL ✅ - FastAPI service URL
FRONTEND_URL ✅ - Frontend origin for CORS
GITHUB_TOKEN ⚠️ - Optional, for GitHub enrichment
TWITTER_BEARER_TOKEN ⚠️ - Optional, for Twitter enrichment
NODE_ENV ❌ production development/staging/production

Monitoring

# Check service health
curl http://localhost:4000/api/v1/health
curl http://localhost:8000/api/v1/health/detailed

# View logs
docker logs socmint-backend
docker logs socmint-ml-backend
docker logs socmint-frontend

# Database health
mongodb-shell "mongodb://admin:pass@localhost:27017/socmint"
cypher-shell -a neo4j://localhost:7687 "CALL dbms.components()"

Scaling

  • Horizontal: Run multiple backend/ML instances behind load balancer
  • Vertical: Increase MongoDB replica set, Neo4j cluster size
  • Caching: Redis already integrated for session storage
  • CDN: Put frontend behind CloudFront/Cloudflare

Security Checklist

  • Set strong JWT_SECRET (>32 chars)
  • Enable HTTPS/TLS on reverse proxy
  • Restrict MongoDB/Neo4j to internal network
  • Use secrets management (AWS Secrets, HashiCorp Vault)
  • Enable RBAC on all services
  • Rotate credentials monthly
  • Set up monitoring/alerting
  • Enable database backups
  • Configure rate limiting
  • Enable audit logging