Skip to content

HKPV2003/uber-clone-final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uber Clone — Minimal, Stable Starter

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

Quickstart (Docker Compose)

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.

Kubernetes (Minikube)

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"

Endpoints

  • GET / → redirects to /hello
  • GET /hello → simple JSON
  • GET /healthz → "ok"
  • GET /drivers, POST /drivers, PATCH /drivers/:id/location
  • GET /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>.

Notes

  • MongoDB is mongo:7 in Compose and K8s.
  • K8s Ingress routes /api/* to the API and / to the web.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors