How andyherreralao/todomvc works
Project type and purpose
• This is a content-centric Node.js web project (“TodoMVC”), not a single app but a static/dynamic site showcasing the same Todo application implemented in dozens of MV* frameworks.
• It hosts example directories under /examples, a site front end (index.html + assets), a build pipeline (Grunt/Gulp tasks), a Node.js server (server.js), and a test suite for CI.
File structure
• Top level:
• server.js – Express (or similar) app that serves pages and examples
• index.html – site landing page template
• site-assets/ – site CSS/JS
• examples/ – one folder per framework, each with its own HTML/JS code
• bower_components/ – third-party front-end libs fetched by Bower
• tasks/, gulpfile.js – build scripts for concatenation, CSS preprocessing, copying assets
• tooling/ – helper scripts
• tests/ – automated test scripts for verifying site/example correctness
• package.json – Node dependencies and scripts
• Patterns:
• Static asset pipeline (Bower → tasks → site-assets + examples)
• Server-side delivery via server.js
• CI integration via .travis.yml + test-runner.sh
README for additional insights
• Describes purpose: “Helping you select an MV* framework” by hosting many Todo implementations.
a. Main components
• Developer environment
• GitHub repo
• Build tools: Grunt/Gulp (tasks/), Bower
• Tooling: custom scripts
• Continuous Integration
• Travis CI orchestrating test-runner.sh on each push
• Back-end server
• Node.js server.js (Express)
• Middleware: static file serving from /site-assets, /examples, /bower_components
• Front-end site
• index.html + site-assets (CSS, global JS)
• media assets
• dynamically loaded example pages under /examples/<framework>/index.html
• Examples
• Each framework folder is a self-contained JS/HTML Todo app
• May use HTMLImports (Polymer), jQuery, Angular, etc. pulled from bower_components
• Tests
• tests/ scripts simulate browsing, memory tests, known issues
b. Relationships & interactions
• Developer commits → CI (Travis) pulls code → runs build & tests → deploy
• Build step uses Grunt/Gulp:
• Bower install → fetch front-end libs into bower_components
• Copy/compile assets → site-assets + example bundles
• server.js starts → listens for HTTP requests
• Browser requests index.html & assets → server.js serves files
• Browser navigates to examples → server.js serves example HTML + their dependencies
• tests/ suite can drive server.js and make HTTP calls to verify examples
c. Architectural patterns
• Static content server with minimal dynamic logic
• Front-end dependency management via Bower
• Task-based build pipeline (Grunt/Gulp)
• CI pipeline for automated testing
d. Key technologies
• Node.js + Express (server.js)
• Bower (bower.json)
• Grunt/Gulp (gulpfile.js, tasks/)
• HTML/CSS/JS examples spanning frameworks (Angular, React, Ember, Polymer, …)
• Travis CI for continuous integration
• Shell scripts (test-runner.sh, run.sh) for test orchestration