This is a small, stable starter you can run locally with Docker Compose and on Kubernetes (Minikube). It includes:
- trips-api — Node.js + Express + MongoDB
- web — static HTML page (Nginx) that calls the API
- k8s manifests — mongo, api, web, ingress
- Optional API key protection for write endpoints via
x-api-key
cd <project-folder>
docker compose build
docker compose up -d
Start-Process "http://localhost:8080"If you kept API_KEY=changeme-123, type that value in the page's "API Key" box for POST/PATCH calls.
minikube start
docker build -t uber-clone-trips-api:latest .\trips-api
docker build -t uber-clone-web:latest .\web
minikube image load uber-clone-trips-api:latest
minikube image load uber-clone-web:latest
kubectl apply -f .\k8s\secret.yaml
kubectl apply -f .\k8s\mongo.yaml
kubectl apply -f .\k8s\trips-api.yaml
kubectl apply -f .\k8s\web.yaml
minikube addons enable ingress
kubectl apply -f .\k8s\ingress.yaml
kubectl get pods -w
Start-Process "http://uber.127.0.0.1.nip.io"GET /→ redirects to/helloGET /hello→ simple JSONGET /healthz→ "ok"GET /drivers,POST /drivers,PATCH /drivers/:id/locationGET /trips,POST /trips,PATCH /trips/:id/assign,PATCH /trips/:id/status
If API_KEY is set (e.g., changeme-123), all non-GET requests require header x-api-key: <value>.
- MongoDB is
mongo:7in Compose and K8s. - K8s Ingress routes
/api/*to the API and/to the web.