v2/examples/rest-api-simple/README-ARCHITECTURE.md
This simple REST API demonstrates clean, minimal architecture patterns using Express.js. The design prioritizes simplicity, clarity, and extensibility while maintaining REST best practices.
server.js file (~200 lines)/api/v1/tasks)examples/rest-api-simple/
โโโ server.js # Main application (all logic)
โโโ server.test.js # Comprehensive test suite
โโโ package.json # Project metadata and scripts
โโโ README.md # User documentation
โโโ architecture.md # Detailed architecture (Mermaid diagrams)
โโโ api-specification.md # Complete API documentation
โโโ implementation-plan.md # Phased development plan
โโโ README-ARCHITECTURE.md # This summary
# Phase 1: Setup
npx claude-flow sparc run code "Setup Express server with health endpoint" --non-interactive
# Phase 2: CRUD with TDD
npx claude-flow sparc run tdd "Implement CRUD operations for tasks" --non-interactive
# Phase 3: Validation
npx claude-flow sparc run code "Add input validation and error handling" --non-interactive
# Phase 4: Documentation
npx claude-flow sparc run docs-writer "Create REST API documentation" --non-interactive
# Phase 5: Security Review
npx claude-flow sparc run security-review "Review API security" --non-interactive
# Complete implementation with parallel agents
npx claude-flow swarm "Build complete simple REST API from architecture docs" \
--strategy development --background --parallel --testing \
--max-agents 4 --output ./examples/rest-api-simple/
# Monitor progress
npx claude-flow monitor
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /api/v1/tasks | List all tasks |
| GET | /api/v1/tasks/:id | Get single task |
| POST | /api/v1/tasks | Create new task |
| PUT | /api/v1/tasks/:id | Update task |
| DELETE | /api/v1/tasks/:id | Delete task |
This architecture provides a solid foundation for a simple REST API that can be easily understood, tested, and extended as requirements grow.