Pluralsight Course Demo: Master CircleCI pipelines with a real-world Node.js API
Welcome to the Globomantics Robotics Control API! This project serves as the hands-on companion to the Pluralsight CircleCI course. You'll use this fully functional REST API to learn CI/CD concepts in a practical, engaging way.
Globomantics (our fictional robotics company) needs a control system for their robot fleet. This API lets you:
- Register robots into the fleet with unique identifiers
- Execute commands like move, rotate, grab, and release
- Monitor battery levels that drain realistically with usage
- Calibrate sensors including temperature, proximity, and pressure
- Manage the fleet with full CRUD operations
# Clone and install
git clone https://github.com/your-org/globomantics-robotics-api.git
cd globomantics-robotics-api
npm install
# Start the server
npm start
# API running at http://localhost:3000
# Run tests
npm testGET /health
# Returns: { "status": "healthy", "timestamp": "..." }POST /api/robots
Content-Type: application/json
{
"name": "Atlas-7",
"type": "arm", # arm, manipulator, or mobile
"location": "Factory Floor A"
}POST /api/robots/:id/command
Content-Type: application/json
# Movement (mobile robots)
{ "command": "move", "direction": "forward" }
{ "command": "rotate", "degrees": 90 }
{ "command": "stop" }
# Manipulation (arm/manipulator robots)
{ "command": "grab" }
{ "command": "release" }
# Battery management
{ "command": "charge" }POST /api/robots/:id/calibrate
# Recalibrates temperature, proximity, and pressure sensorsGET /api/robots # List all robots
GET /api/robots/:id # Get specific robot
DELETE /api/robots/:id # Remove robot from fleetThis project demonstrates key CircleCI concepts you'll master in the course:
ββββββββββββββββ
β install-deps β β Caches node_modules for speed
ββββββββ¬ββββββββ
β
ββββββββββββββββ¬ββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββ βββββββββββββ βββββββββββββββββββ
β lint β β test-unit β β test-integrationβ
ββββββ¬ββββββ βββββββ¬ββββββ ββββββββββ¬βββββββββ
β β β
βββββββββββββββββ΄βββββββββββββββββββ
β
βΌ
βββββββββββββ
β build β β Creates dist/ artifact
βββββββ¬ββββββ
β
ββββββββββββββ΄βββββββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββββββ
βdeploy-stagingβ βhold-for-approval β β Manual gate
β(all branches)β β (main only) β
ββββββββββββββββ ββββββββββ¬ββββββββββ
βΌ
βββββββββββββββββββ
βdeploy-productionβ
β (main only) β
βββββββββββββββββββ
| Concept | Where It's Used |
|---|---|
| Dependency Caching | install-deps job caches npm packages |
| Workspace Persistence | node_modules shared across jobs |
| Parallel Jobs | lint, unit tests, and integration tests run simultaneously |
| Artifacts | Build output and test results stored for download |
| Branch Filtering | Different deploy paths for main vs feature branches |
| Approval Gates | Manual approval required for production deploys |
| Test Splitting | Unit and integration tests run as separate jobs |
.circleci/config.yml- The complete pipeline definitionpackage.json- Script definitions referenced by CircleCIjest.config(in package.json) - Test output configured for CircleCI insights
# Full test suite with coverage report
npm test
# Watch mode for TDD
npm run test:watch
# Run specific test file
npx jest tests/robot-controller.test.js
# Lint check
npm run lint
# Production build
npm run buildβββ .circleci/
β βββ config.yml # β CircleCI pipeline config
βββ src/
β βββ index.js # Express server & routes
β βββ robot-controller.js # Command execution logic
β βββ sensor-calibration.js # Sensor management
β βββ logger.js # Winston logging setup
βββ tests/
β βββ api.test.js # API integration tests
β βββ robot-controller.test.js
β βββ sensor-calibration.test.js
β βββ integration/
βββ scripts/
βββ build.js # Build script for dist/
As you progress through the course, you'll:
- Module 1: Examine the existing pipeline and understand job dependencies
- Module 2: Modify caching strategies and measure build time improvements
- Module 3: Add new test jobs and configure parallelism
- Module 4: Implement branch-based deployment rules
- Module 5: Set up approval workflows and environment variables
Tests failing locally but passing in CI?
- Ensure you're on Node 18.19:
node --version - Clear node_modules and reinstall:
rm -rf node_modules && npm install
CircleCI build not triggering?
- Check that
.circleci/config.ymlis valid:circleci config validate - Ensure the project is connected in the CircleCI dashboard
Port 3000 already in use?
- Kill the process:
npx kill-port 3000 - Or use a different port:
PORT=3001 npm start
- Runtime: Node.js 18.19
- Framework: Express.js 4.18
- Testing: Jest 29 + Supertest
- Linting: ESLint 8
- Logging: Winston 3
- CI/CD: CircleCI 2.1
Built with β€οΈ for Pluralsight learners | Report Issues