A tiny Node.js + Express app with a minimal UI, wired to a Jenkins CI/CD pipeline and containerized with Docker. Includes a health endpoint, tests, and a Docker-based deploy step with smoke testing.
- Express API:
GET /api/healthreturns{ status: "ok" } - UI/UX: Static site in
public/with a dynamic health badge - Tests: Jest + Supertest with JUnit output for CI
- Pipeline: Jenkins stages for Install, Test, and Docker Deploy + health check
- Docker: Production Dockerfile with
--omit=devinstalls - Helpers: npm scripts for docker build/run/stop/logs/health
npm ci
npm test
npm start
# open http://localhost:3000npm run docker:build
npm run docker:run
npm run docker:health
# open http://localhost:3001Stop/cleanup:
npm run docker:stopstart: start Express on port3000test: run Jest teststest:ci: run tests with coverage + JUnit outputdocker:build: build imagecicd-sample-app:localdocker:run: run container ascicd-sample-appmapping3001:3000docker:health: retry health probe againsthttp://localhost:3001/api/healthdocker:stop: stop and remove the containerstart:docker: chain build → run → health
flowchart LR
A[Commit] --> B["Jenkins: Checkout"]
B --> C["Install: npm ci"]
C --> D["Test: jest"]
D --> E["Build Docker image"]
E --> F["Run container"]
F --> G{Health check}
G -->|OK| H["Archive logs + coverage"]
G -->|Fail| I["Fail pipeline"]
- Tests publish JUnit to
test-results/junit.xmland archive coverage fromcoverage/**. - Deploy stage builds an image, runs a container, smoke-tests
/api/health, archives logs, and cleans up.
.
├── app.js # Express app (exports app)
├── index.js # Server entry (listens on PORT)
├── public/ # Minimal UI (static)
│ ├── index.html
│ ├── styles.css
│ └── app.js
├── __tests__/ # Jest + Supertest tests
│ └── app.test.js
├── Jenkinsfile # CI/CD pipeline (Install/Test/Deploy via Docker)
├── Dockerfile # Production image
├── .dockerignore
├── .gitignore
└── package.json
GET /api/health→{ status: "ok" }
- 3D animated banner: see the wireframe animation above.
- WebGL demo (external): Rotating cube on Three.js examples → https://threejs.org/examples/#webgl_animation_keyframes
- Animated pipeline: You can attach your Jenkins job status badge or a GIF of your pipeline run here.
Tip: For richer visuals, consider adding a GIF of your app UI or a short video capture of the Jenkins run.
- Node.js 18+
- Docker (optional for local runs, required for Deploy stage in Jenkins agents)
Build and run manually without npm helpers:
docker build -t cicd-sample-app:local .
docker run --rm -d --name cicd-sample-app -p 3001:3000 cicd-sample-app:local
curl http://localhost:3001/api/health- Express + UI, tests, Dockerfile, and Jenkins pipeline are ready to go.
- Deploy stage performs a containerized smoke test automatically.