How nagkumar/ember_sample1 works
Project type and purpose
• This is an Ember.js single-page application (SPA) generated with Ember CLI.
• It uses Ember Data for models and a small Node/Express “mock” server under server/ to serve JSON endpoints for authors, books, publishers, and reviews.
• Tests are written with QUnit (in tests/) and the build pipeline is managed by Broccoli via ember-cli-build.js.
File structure
Top-level directories and files:
• app/ → Ember application code (models, routes, controllers, components, templates, styles)
• config/ → Ember CLI environment settings
• server/ → Node.js/Express mock API (server/index.js + JSON files under server/mocks/)
• public/ → static assets (robots.txt, crossdomain.xml)
• tests/ → QUnit test suites and helpers
• vendor/ → Bower-managed external libraries
• package.json, bower.json, ember-cli-build.js → dependency & build configurations
• .travis.yml → CI configuration
• _config.yml → might be used for GitHub Pages or style guides
Key insights from README
• Standard Ember CLI workflow (ember server, ember test, ember build)
• No external production API is specified, implying the mock server stands in for a real back-end during development.
a. Browser / Client
– Ember App (Router → Routes → Controllers/Components → Templates)
– Ember Data Adapter & Serializer (in app/adapters/application.js)
– Models (app/models/*.js files for Author, Book, Publisher, Review)
b. Mock API Server
– Express server (server/index.js)
– Mock data endpoints (/authors, /books, /publishers, /reviews) reading JSON from server/mocks/*.js
c. Build & Test Pipeline
– Ember CLI / Broccoli (ember-cli-build.js)
– Testem runner and QUnit tests (tests/)
d. Static Assets & Deployment
– public/ folder served as root when deployed
– config/environment.js drives environment-specific settings
Relationships and data flows
• User interacts with the Ember SPA in the browser → Ember Data issues XHR/REST calls (GET/POST/PUT/DELETE) to the Mock API Server.
• The Server reads JSON mocks and responds → Ember Serializer normalizes data → Ember Data populates Models → Templates update the UI.
• Build tools (Broccoli) transform app/ + vendor/ into a dist/ folder for production.
• Test runner invokes tests in tests/ against the Ember app, optionally using the mock server.
Architectural patterns and principles
– MVC on the front end: Router, Models, Views/Templates, Controllers/Components
– Adapter Pattern in Ember Data for API abstraction
– Client-server separation: UI layer vs. data layer
– Convention over configuration via Ember CLI
Technologies & frameworks
– Ember.js, Ember CLI, Ember Data
– Node.js, Express (mock server)
– Broccoli (build pipeline)
– QUnit + Testem (testing)
– Bower (front-end dependencies)
– GitHub Pages / Travis CI for deployment & CI