A production-grade, cloud-native OTT platform built using a microservices architecture, deployed on Kubernetes (kubeadm) with automated Blue‑Green deployments, Ingress routing, Redis caching, MongoDB & PostgreSQL, NGINX API Gateway, and secure API integration using TMDB API key.
git clone https://github.com/gauravchile/streamflix.git
cd streamflixcp .env.example .env
# Add your TMDB_API_KEY and DB credentials inside .envdocker compose up --buildhttp://localhost:3000
make k8s-applyStreamflix simulates a real-world OTT ecosystem with a modern DevOps approach. It showcases:
- Kubernetes microservice deployments
- Blue-Green rollouts with zero downtime
- Secure API secrets via Kubernetes Secrets
- Multi-database orchestration (MongoDB + PostgreSQL + Redis)
- Automated CI/CD pipelines
- React.js + Next.js
- TMDB API integration via
.env - Served through NGINX
- User Service (Node.js + PostgreSQL)
- Movie Service (Node.js + MongoDB + TMDB API integration)
- Rating Service (Python Flask + MongoDB)
- Recommendation Service (Node.js + Redis)
- Docker + Kubernetes (kubeadm on AWS EC2)
- Blue/Green Deployments
- Jenkins or GitHub Actions pipelines
- Secrets and ConfigMaps for environment isolation
All API keys are stored securely using Kubernetes Secrets and .env files.
Example: movie-service uses TMDB API for fetching trending movies.
const apiKey = process.env.TMDB_API_KEY;
const response = await fetch(`https://api.themoviedb.org/3/movie/popular?api_key=${apiKey}`);Stored in:
apiVersion: v1
kind: Secret
metadata:
name: streamflix-secrets
namespace: streamflix
type: Opaque
stringData:
TMDB_API_KEY: "your_tmdb_api_key_here"Each microservice includes:
- Multi-stage Dockerfile
- Health checks
- Environment variable configuration
- Lightweight production images
- Blue (current production)
- Green (staging/test)
- Switch versions by changing service selector
apiVersion: v1
kind: Service
metadata:
name: movie-service
namespace: streamflix
spec:
selector:
app: movie-service
version: blue # switch to green during rollout
ports:
- port: 5000
targetPort: 5000Unified external access through NGINX Ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: streamflix-ingress
namespace: streamflix
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api-gateway
port:
number: 80Access via:
http://<EC2_PUBLIC_IP>:<NodePort>
| Service | Database | Description |
|---|---|---|
| User | PostgreSQL | Authentication, sessions |
| Movie | MongoDB | Movie catalog + TMDB data |
| Rating | MongoDB | User ratings |
| Recommendation | Redis | Cached recommendations |
Seeds initial demo data into MongoDB, Redis, and Postgres.
Central routing hub for all microservices.
location /api/movie/ {
proxy_pass http://movie-service.streamflix.svc.cluster.local:5000/;
}- Full microservices setup
- Docker + Kubernetes orchestration
- Blue-Green deployments
- Secure TMDB API integration
- Redis caching for recommendations
- NGINX Ingress routing
- Configurable CI/CD pipelines
- Horizontal scaling ready
docker compose up --buildmake k8s-applymake k8s-deleteIngress not reachable:
kubectl -n ingress-nginx get svc ingress-nginx-controllerCheck secrets:
kubectl -n streamflix get secrets streamflix-secrets -o yamlPod logs:
kubectl logs -n streamflix deploy/movie-service-blue- Secrets managed via
Kubernetes Secrets - Environment variables loaded at runtime
- No hardcoded credentials in code or YAMLs
Never commit: .env, k8s/streamflix-secrets-config.yaml, credentials, or database volumes.
Provide example templates instead:
cp .env.example .envMIT License — free for personal or educational use.
