Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Orders API

A small stateless order API designed to demonstrate a complete container delivery workflow.

Endpoints

  • GET /health and GET /ready — Kubernetes probes
  • GET /orders — list in-memory orders
  • POST /orders — create an order with customer and non-empty items

Run and test

npm test
npm start
# or: docker compose up --build
curl -X POST localhost:3000/orders -H 'content-type: application/json' \
  -d '{"customer":"Ada","items":["keyboard"]}'

Portfolio highlights

Node.js built-in test runner, non-root/read-only container, GitHub Actions, GHCR publishing, Kubernetes probes, resource limits and HorizontalPodAutoscaler. Replace OWNER in k8s/app.yaml before deployment.

Architecture

Client -> Node API (/orders, /health, /ready) -> Docker Compose (local) / Kubernetes HPA (prod)

Key files

  • src/server.js — in-memory order store, payload limit and JSON validation.
  • .github/workflows/ci-cd.yml — test, build, publish and gated deploy jobs.
  • k8s/app.yaml — Deployment, Service, probes, limits and HorizontalPodAutoscaler.

What I learned

Autoscaling is only useful when the metrics and the HPA target are right: couple the HPA to CPU and expose a /metrics endpoint when you expect load spikes. A read-only root container with explicit requests/limits keeps the node process honest about its footprint, and validating the request body (non-empty items) at the edge prevents bad orders from ever reaching the store.

Endpoints

Path Method Purpose
POST /orders POST create an order (customer + non-empty items)
GET /orders GET list stored orders
GET /health, /ready GET Kubernetes probes

About

Node.js order API with CI/CD and Kubernetes autoscaling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages