├── app ├── views │ └── .gitkeep ├── components │ ├── .gitkeep │ └── contact-card.js ├── helpers │ └── .gitkeep ├── models │ ├── .gitkeep │ └── contact.js ├── routes │ ├── .gitkeep │ ├── .contacts.js.swo │ ├── contacts │ │ └── show.js │ ├── contacts.js │ └── contact.js ├── controllers │ ├── .gitkeep │ └── contacts.js ├── templates │ ├── components │ │ ├── .gitkeep │ │ └── contact-card.hbs │ ├── index.hbs │ ├── contact.hbs │ ├── contacts │ │ └── show.hbs │ ├── application.hbs │ └── contacts.hbs ├── adapters │ └── application.js ├── mirage │ ├── factories │ │ ├── .contact.js.swo │ │ └── contact.js │ ├── scenarios │ │ └── default.js │ └── config.js ├── router.js ├── app.js ├── styles │ └── app.css └── index.html ├── vendor └── .gitkeep ├── tests ├── unit │ ├── .gitkeep │ ├── routes │ │ ├── contact-test.js │ │ ├── contacts-test.js │ │ └── contacts │ │ │ └── show-test.js │ ├── models │ │ └── contact-test.js │ ├── controllers │ │ └── contacts-test.js │ └── adapters │ │ └── application-test.js ├── test-helper.js ├── helpers │ ├── resolver.js │ └── start-app.js ├── acceptance │ └── list-contacts-test.js ├── integration │ └── components │ │ └── contact-card-test.js ├── .jshintrc └── index.html ├── .watchmanconfig ├── public ├── robots.txt └── crossdomain.xml ├── .bowerrc ├── testem.json ├── .ember-cli ├── .gitignore ├── .travis.yml ├── .jshintrc ├── .editorconfig ├── bower.json ├── highlight.css ├── Brocfile.js ├── ember-cli-build.js ├── package.json ├── config └── environment.js ├── README.md └── config.js.html /app/views/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/helpers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/routes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/templates/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/templates/index.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp"] 3 | } 4 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /app/templates/contact.hbs: -------------------------------------------------------------------------------- 1 |

{{model.fullName}}

2 | 3 |

{{model.description}}

4 | {{outlet}} 5 | -------------------------------------------------------------------------------- /app/routes/.contacts.js.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iheanyi/front-porch-demo/master/app/routes/.contacts.js.swo -------------------------------------------------------------------------------- /app/adapters/application.js: -------------------------------------------------------------------------------- 1 | import DS from 'ember-data'; 2 | 3 | export default DS.RESTAdapter.extend({ 4 | namespace: 'api' 5 | }); 6 | -------------------------------------------------------------------------------- /app/mirage/factories/.contact.js.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iheanyi/front-porch-demo/master/app/mirage/factories/.contact.js.swo -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { setResolver } from 'ember-mocha'; 3 | 4 | setResolver(resolver); 5 | -------------------------------------------------------------------------------- /app/templates/components/contact-card.hbs: -------------------------------------------------------------------------------- 1 |
2 |
{{contact.fullName}}
3 | 4 |

{{contact.description}}

5 |
6 | 7 | {{yield}} 8 | -------------------------------------------------------------------------------- /app/routes/contacts/show.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend({ 4 | model(params) { 5 | return this.store.find('contact', params.id); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /app/templates/contacts/show.hbs: -------------------------------------------------------------------------------- 1 |

{{model.fullName}}

2 | 3 |

E-Mail: {{model.email}}

4 | 5 |

{{model.description}}

6 | 7 | {{outlet}} 8 | -------------------------------------------------------------------------------- /app/components/contact-card.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Component.extend({ 4 | 5 | actions: { 6 | someAction: function() { 7 | 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /app/controllers/contacts.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | sortProperties: ['fullName'], 5 | sortedContacts: Ember.computed.sort('model', 'sortProperties') 6 | }); 7 | -------------------------------------------------------------------------------- /app/mirage/scenarios/default.js: -------------------------------------------------------------------------------- 1 | export default function( server ) { 2 | 3 | // Seed your development database using your factories. This 4 | // data will not be loaded in your tests. 5 | 6 | server.createList('contact', 10); 7 | } 8 | -------------------------------------------------------------------------------- /app/routes/contacts.js: -------------------------------------------------------------------------------- 1 | // app/routes/contact.js 2 | import Ember from 'ember'; 3 | 4 | export default Ember.Route.extend({ 5 | model() { 6 | // fetches every contact from api/contacts 7 | return this.store.find('contact'); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html?hidepassed", 4 | "disable_watching": true, 5 | "launch_in_ci": [ 6 | "PhantomJS" 7 | ], 8 | "launch_in_dev": [ 9 | "PhantomJS", 10 | "Chrome" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log 17 | testem.log 18 | *.swp 19 | -------------------------------------------------------------------------------- /tests/unit/routes/contact-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleFor, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleFor('route:contact', { 7 | // Specify the other units that are required for this test. 8 | // needs: ['controller:foo'] 9 | }); 10 | 11 | test('it exists', function(assert) { 12 | var route = this.subject(); 13 | assert.ok(route); 14 | }); 15 | -------------------------------------------------------------------------------- /tests/unit/routes/contacts-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleFor, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleFor('route:contacts', { 7 | // Specify the other units that are required for this test. 8 | // needs: ['controller:foo'] 9 | }); 10 | 11 | test('it exists', function(assert) { 12 | var route = this.subject(); 13 | assert.ok(route); 14 | }); 15 | -------------------------------------------------------------------------------- /tests/unit/routes/contacts/show-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleFor, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleFor('route:contacts/show', { 7 | // Specify the other units that are required for this test. 8 | // needs: ['controller:foo'] 9 | }); 10 | 11 | test('it exists', function(assert) { 12 | var route = this.subject(); 13 | assert.ok(route); 14 | }); 15 | -------------------------------------------------------------------------------- /tests/unit/models/contact-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForModel, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForModel('contact', { 7 | // Specify the other units that are required for this test. 8 | needs: [] 9 | }); 10 | 11 | test('it exists', function(assert) { 12 | var model = this.subject(); 13 | // var store = this.store(); 14 | assert.ok(!!model); 15 | }); 16 | -------------------------------------------------------------------------------- /app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | var Router = Ember.Router.extend({ 5 | location: config.locationType 6 | }); 7 | 8 | export default Router.map(function() { 9 | this.route('contacts', function() { 10 | this.route('show', {path: '/:id'}); 11 | }); 12 | 13 | //this.route('contact', {path: '/contacts/:id'}); 14 | }); 15 | -------------------------------------------------------------------------------- /tests/unit/controllers/contacts-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleFor, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleFor('controller:contacts', { 7 | // Specify the other units that are required for this test. 8 | // needs: ['controller:foo'] 9 | }); 10 | 11 | // Replace this with your real tests. 12 | test('it exists', function(assert) { 13 | var controller = this.subject(); 14 | assert.ok(controller); 15 | }); 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | - "0.12" 5 | 6 | sudo: false 7 | 8 | cache: 9 | directories: 10 | - node_modules 11 | 12 | before_install: 13 | - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH 14 | - "npm config set spin false" 15 | - "npm install -g npm@^2" 16 | 17 | install: 18 | - npm install -g bower 19 | - npm install 20 | - bower install 21 | 22 | script: 23 | - npm test 24 | -------------------------------------------------------------------------------- /app/routes/contact.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend({ 4 | model(params) { 5 | 6 | /*this.store.filter('contact', function(contact) { 7 | return contact.get('firstName')[0] === "A"; 8 | });*/ 9 | 10 | return this.store.find('contact', params.id).then(function(contact) { 11 | contact.set('firstName', 'Iheanyi'); 12 | contact.save(); 13 | }); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /tests/unit/adapters/application-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleFor, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleFor('adapter:application', 'ApplicationAdapter', { 7 | // Specify the other units that are required for this test. 8 | // needs: ['serializer:foo'] 9 | }); 10 | 11 | // Replace this with your real tests. 12 | test('it exists', function(assert) { 13 | var adapter = this.subject(); 14 | assert.ok(adapter); 15 | }); 16 | -------------------------------------------------------------------------------- /app/templates/application.hbs: -------------------------------------------------------------------------------- 1 | 15 | {{outlet}} 16 | -------------------------------------------------------------------------------- /app/models/contact.js: -------------------------------------------------------------------------------- 1 | // app/models/contact.js 2 | import DS from 'ember-data'; 3 | 4 | export default DS.Model.extend({ 5 | firstName: DS.attr('string'), 6 | lastName: DS.attr('string'), 7 | avatar: DS.attr('string'), 8 | email: DS.attr('string'), 9 | description: DS.attr('string'), 10 | fullName: Ember.computed('firstName', 'lastName', function(key, value) { 11 | return `${this.get('firstName')} ${this.get('lastName')}`; 12 | }) 13 | }); 14 | -------------------------------------------------------------------------------- /app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | import config from './config/environment'; 5 | 6 | var App; 7 | 8 | Ember.MODEL_FACTORY_INJECTIONS = true; 9 | 10 | App = Ember.Application.extend({ 11 | modulePrefix: config.modulePrefix, 12 | podModulePrefix: config.podModulePrefix, 13 | Resolver: Resolver 14 | }); 15 | 16 | loadInitializers(App, config.modulePrefix); 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /app/styles/app.css: -------------------------------------------------------------------------------- 1 | /*@import 'bootstrap'; 2 | */ 3 | 4 | 5 | .contacts__sidebar { 6 | width: 30%; 7 | float: left; 8 | } 9 | 10 | .contacts__detail { 11 | width: 70%; 12 | } 13 | 14 | .contacts__list { 15 | list-style: none; 16 | padding: 0; 17 | } 18 | 19 | .contacts__list__item { 20 | margin: 8px 0; 21 | } 22 | 23 | .contact__sidebar__picture { 24 | border-radius: 50%; 25 | height: 50px; 26 | width: 50px; 27 | } 28 | 29 | .contact__sidebar__name { 30 | margin-left: 8px; 31 | } 32 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import config from '../../config/environment'; 4 | 5 | export default function startApp(attrs) { 6 | var application; 7 | 8 | var attributes = Ember.merge({}, config.APP); 9 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 10 | 11 | Ember.run(function() { 12 | application = Application.create(attributes); 13 | application.setupForTesting(); 14 | application.injectTestHelpers(); 15 | }); 16 | 17 | return application; 18 | } 19 | -------------------------------------------------------------------------------- /public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "server", 4 | "document", 5 | "window", 6 | "-Promise" 7 | ], 8 | "browser": true, 9 | "boss": true, 10 | "curly": true, 11 | "debug": false, 12 | "devel": true, 13 | "eqeqeq": true, 14 | "evil": true, 15 | "forin": false, 16 | "immed": false, 17 | "laxbreak": false, 18 | "newcap": true, 19 | "noarg": true, 20 | "noempty": false, 21 | "nonew": false, 22 | "nomen": false, 23 | "onevar": false, 24 | "plusplus": false, 25 | "regexp": false, 26 | "undef": true, 27 | "sub": true, 28 | "strict": false, 29 | "white": false, 30 | "eqnull": true, 31 | "esnext": true, 32 | "unused": true 33 | } 34 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | insert_final_newline = false 22 | indent_style = space 23 | indent_size = 2 24 | 25 | [*.css] 26 | indent_style = space 27 | indent_size = 2 28 | 29 | [*.html] 30 | indent_style = space 31 | indent_size = 2 32 | 33 | [*.{diff,md}] 34 | trim_trailing_whitespace = false 35 | -------------------------------------------------------------------------------- /app/templates/contacts.hbs: -------------------------------------------------------------------------------- 1 |
2 |

Contacts Route

3 | 4 |
5 | 17 |
18 | 19 |
20 | {{outlet}} 21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FrontPorchDemo 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | {{content-for 'head-footer'}} 16 | 17 | 18 | {{content-for 'body'}} 19 | 20 | 21 | 22 | 23 | {{content-for 'body-footer'}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "front-porch-demo", 3 | "dependencies": { 4 | "ember": "1.13.7", 5 | "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", 6 | "ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.3", 7 | "ember-data": "1.13.8", 8 | "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5", 9 | "ember-qunit": "0.4.9", 10 | "ember-qunit-notifications": "0.0.7", 11 | "ember-resolver": "~0.1.18", 12 | "jquery": "^1.11.3", 13 | "loader.js": "ember-cli/loader.js#3.2.1", 14 | "qunit": "~1.18.0", 15 | "pretender": "~0.7.0", 16 | "ember-inflector": "~1.3.1", 17 | "lodash": "~3.7.0", 18 | "Faker": "~3.0.0", 19 | "ember-mocha": "~0.8.0", 20 | "bootstrap": "~3.3.5" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /highlight.css: -------------------------------------------------------------------------------- 1 | /* Style definition file generated by highlight 3.22, http://www.andre-simon.de/ */ 2 | 3 | /* Highlighting theme: Kwrite Editor */ 4 | 5 | body.hl { background-color:#e0eaee; } 6 | pre.hl { color:#000000; background-color:#e0eaee; font-size:10pt; font-family:'Courier New',monospace;} 7 | .hl.num { color:#b07e00; } 8 | .hl.esc { color:#ff00ff; } 9 | .hl.str { color:#bf0303; } 10 | .hl.pps { color:#818100; } 11 | .hl.slc { color:#838183; font-style:italic; } 12 | .hl.com { color:#838183; font-style:italic; } 13 | .hl.ppc { color:#008200; } 14 | .hl.opt { color:#000000; } 15 | .hl.ipl { color:#0057ae; } 16 | .hl.lin { color:#555555; } 17 | .hl.kwa { color:#000000; font-weight:bold; } 18 | .hl.kwb { color:#0057ae; } 19 | .hl.kwc { color:#000000; font-weight:bold; } 20 | .hl.kwd { color:#010181; } 21 | 22 | -------------------------------------------------------------------------------- /Brocfile.js: -------------------------------------------------------------------------------- 1 | /* global require, module */ 2 | 3 | var EmberApp = require('ember-cli/lib/broccoli/ember-app'); 4 | 5 | var app = new EmberApp(); 6 | app.import("bower_components/bootstrap/dist/css/bootstrap.css"); 7 | // Use `app.import` to add additional libraries to the generated 8 | // output files. 9 | // 10 | // If you need to use different assets in different 11 | // environments, specify an object as the first parameter. That 12 | // object's keys should be the environment name and the values 13 | // should be the asset to use in that environment. 14 | // 15 | // If the library that you are including contains AMD or ES6 16 | // modules that you would like to import into your application 17 | // please specify an object with the list of modules as keys 18 | // along with the exports of each module as its value. 19 | 20 | module.exports = app.toTree(); 21 | -------------------------------------------------------------------------------- /tests/acceptance/list-contacts-test.js: -------------------------------------------------------------------------------- 1 | /* jshint expr:true */ 2 | import { 3 | describe, 4 | it, 5 | beforeEach, 6 | afterEach 7 | } from 'mocha'; 8 | import { expect } from 'chai'; 9 | import Ember from 'ember'; 10 | import startApp from '../helpers/start-app'; 11 | 12 | describe('Acceptance: ListContacts', function() { 13 | var application; 14 | 15 | beforeEach(function() { 16 | application = startApp(); 17 | }); 18 | 19 | afterEach(function() { 20 | Ember.run(application, 'destroy'); 21 | }); 22 | 23 | it('can visit /contacts and see 10 contacts', function() { 24 | server.createList('contact', 10); 25 | 26 | visit('/contacts'); 27 | 28 | andThen(function() { 29 | expect(currentPath()).to.equal('contacts.index'); 30 | expect(find('.contacts__list__item').length).to.equal(10); 31 | }); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/integration/components/contact-card-test.js: -------------------------------------------------------------------------------- 1 | /* jshint expr:true */ 2 | import { expect } from 'chai'; 3 | import { 4 | describeComponent, 5 | it 6 | } from 'ember-mocha'; 7 | import hbs from 'htmlbars-inline-precompile'; 8 | 9 | describeComponent( 10 | 'contact-card', 11 | 'Integration: ContactCardComponent', 12 | { 13 | integration: true 14 | }, 15 | function() { 16 | it('renders', function() { 17 | // Set any properties with this.set('myProperty', 'value'); 18 | // Handle any actions with this.on('myAction', function(val) { ... }); 19 | // Template block usage: 20 | // this.render(hbs` 21 | // {{#contact-card}} 22 | // template content 23 | // {{/contact-card}} 24 | // `); 25 | 26 | this.render(hbs`{{contact-card}}`); 27 | expect(this.$()).to.have.length(1); 28 | }); 29 | } 30 | ); 31 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | /* global require, module */ 2 | var EmberApp = require('ember-cli/lib/broccoli/ember-app'); 3 | 4 | module.exports = function(defaults) { 5 | var app = new EmberApp(defaults, { 6 | // Add options here 7 | }); 8 | 9 | // Use `app.import` to add additional libraries to the generated 10 | // output files. 11 | // 12 | // If you need to use different assets in different 13 | // environments, specify an object as the first parameter. That 14 | // object's keys should be the environment name and the values 15 | // should be the asset to use in that environment. 16 | // 17 | // If the library that you are including contains AMD or ES6 18 | // modules that you would like to import into your application 19 | // please specify an object with the list of modules as keys 20 | // along with the exports of each module as its value. 21 | 22 | return app.toTree(); 23 | }; 24 | -------------------------------------------------------------------------------- /app/mirage/factories/contact.js: -------------------------------------------------------------------------------- 1 | /* 2 | This is an example factory definition. 3 | 4 | Create more files in this directory to define additional factories. 5 | */ 6 | import Mirage, {faker} from 'ember-cli-mirage'; 7 | 8 | export default Mirage.Factory.extend({ 9 | // name: 'Pete', // strings 10 | // age: 20, // numbers 11 | // tall: true, // booleans 12 | 13 | // email: function(i) { // and functions 14 | // return 'person' + i + '@test.com'; 15 | // } 16 | 17 | // firstName: faker.name.firstName // using faker 18 | // lastName: faker.name.firstName 19 | // zipCode: faker.address.zipCode 20 | firstName: faker.name.firstName, 21 | lastName: faker.name.lastName, 22 | email: faker.internet.email, 23 | avatar: faker.internet.avatar, 24 | description: faker.lorem.paragraphs(4) 25 | }); 26 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "server", 4 | "document", 5 | "window", 6 | "location", 7 | "setTimeout", 8 | "$", 9 | "-Promise", 10 | "define", 11 | "console", 12 | "visit", 13 | "exists", 14 | "fillIn", 15 | "click", 16 | "keyEvent", 17 | "triggerEvent", 18 | "find", 19 | "findWithAssert", 20 | "wait", 21 | "DS", 22 | "andThen", 23 | "currentURL", 24 | "currentPath", 25 | "currentRouteName" 26 | ], 27 | "node": false, 28 | "browser": false, 29 | "boss": true, 30 | "curly": true, 31 | "debug": false, 32 | "devel": false, 33 | "eqeqeq": true, 34 | "evil": true, 35 | "forin": false, 36 | "immed": false, 37 | "laxbreak": false, 38 | "newcap": true, 39 | "noarg": true, 40 | "noempty": false, 41 | "nonew": false, 42 | "nomen": false, 43 | "onevar": false, 44 | "plusplus": false, 45 | "regexp": false, 46 | "undef": true, 47 | "sub": true, 48 | "strict": false, 49 | "white": false, 50 | "eqnull": true, 51 | "esnext": true, 52 | "unused": true 53 | } 54 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FrontPorchDemo Tests 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | {{content-for 'test-head'}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for 'head-footer'}} 18 | {{content-for 'test-head-footer'}} 19 | 20 | 21 | 22 | {{content-for 'body'}} 23 | {{content-for 'test-body'}} 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for 'body-footer'}} 31 | {{content-for 'test-body-footer'}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "front-porch-demo", 3 | "version": "0.0.0", 4 | "description": "Small description for front-porch-demo goes here", 5 | "private": true, 6 | "directories": { 7 | "doc": "doc", 8 | "test": "tests" 9 | }, 10 | "scripts": { 11 | "build": "ember build", 12 | "start": "ember server", 13 | "test": "ember test" 14 | }, 15 | "repository": "", 16 | "engines": { 17 | "node": ">= 0.10.0" 18 | }, 19 | "author": "", 20 | "license": "MIT", 21 | "devDependencies": { 22 | "broccoli-asset-rev": "^2.1.2", 23 | "ember-cli": "1.13.8", 24 | "ember-cli-app-version": "0.5.0", 25 | "ember-cli-babel": "^5.1.3", 26 | "ember-cli-content-security-policy": "0.4.0", 27 | "ember-cli-dependency-checker": "^1.0.1", 28 | "ember-cli-deploy": "0.4.3", 29 | "ember-cli-htmlbars": "0.7.9", 30 | "ember-cli-htmlbars-inline-precompile": "^0.2.0", 31 | "ember-cli-ic-ajax": "0.2.1", 32 | "ember-cli-inject-live-reload": "^1.3.1", 33 | "ember-cli-mirage": "0.1.6", 34 | "ember-cli-mocha": "0.9.2", 35 | "ember-cli-release": "0.2.3", 36 | "ember-cli-sri": "^1.0.3", 37 | "ember-cli-uglify": "^1.2.0", 38 | "ember-data": "1.13.8", 39 | "ember-disable-proxy-controllers": "^1.0.0", 40 | "ember-export-application-global": "^1.0.3" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | modulePrefix: 'front-porch-demo', 6 | environment: environment, 7 | baseURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. 'with-controller': true 13 | } 14 | }, 15 | 16 | APP: { 17 | // Here you can pass flags/options to your application instance 18 | // when it is created 19 | } 20 | }; 21 | 22 | if (environment === 'development') { 23 | // ENV.APP.LOG_RESOLVER = true; 24 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 25 | // ENV.APP.LOG_TRANSITIONS = true; 26 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 27 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 28 | } 29 | 30 | if (environment === 'test') { 31 | // Testem prefers this... 32 | ENV.baseURL = '/'; 33 | ENV.locationType = 'none'; 34 | 35 | // keep test console output quieter 36 | ENV.APP.LOG_ACTIVE_GENERATION = false; 37 | ENV.APP.LOG_VIEW_LOOKUPS = false; 38 | 39 | ENV.APP.rootElement = '#ember-testing'; 40 | } 41 | 42 | if (environment === 'production') { 43 | ENV['ember-cli-mirage'] = { 44 | enabled: true 45 | } 46 | } 47 | 48 | return ENV; 49 | }; 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Front-porch-demo 2 | 3 | This README outlines the details of collaborating on this Ember application. 4 | A short introduction of this app could easily go here. 5 | 6 | ## Prerequisites 7 | 8 | You will need the following things properly installed on your computer. 9 | 10 | * [Git](http://git-scm.com/) 11 | * [Node.js](http://nodejs.org/) (with NPM) 12 | * [Bower](http://bower.io/) 13 | * [Ember CLI](http://www.ember-cli.com/) 14 | * [PhantomJS](http://phantomjs.org/) 15 | 16 | ## Installation 17 | 18 | * `git clone ` this repository 19 | * change into the new directory 20 | * `npm install` 21 | * `bower install` 22 | 23 | ## Running / Development 24 | 25 | * `ember server` 26 | * Visit your app at [http://localhost:4200](http://localhost:4200). 27 | 28 | ### Code Generators 29 | 30 | Make use of the many generators for code, try `ember help generate` for more details 31 | 32 | ### Running Tests 33 | 34 | * `ember test` 35 | * `ember test --server` 36 | 37 | ### Building 38 | 39 | * `ember build` (development) 40 | * `ember build --environment production` (production) 41 | 42 | ### Deploying 43 | 44 | Specify what it takes to deploy your app. 45 | 46 | ## Further Reading / Useful Links 47 | 48 | * [ember.js](http://emberjs.com/) 49 | * [ember-cli](http://www.ember-cli.com/) 50 | * Development Browser Extensions 51 | * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) 52 | * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) 53 | 54 | -------------------------------------------------------------------------------- /app/mirage/config.js: -------------------------------------------------------------------------------- 1 | export default function() { 2 | this.namespace = '/api'; 3 | 4 | this.get('/contacts', function(db) { 5 | return {contacts: db.contacts}; 6 | }); 7 | 8 | this.get('/contacts/:id', function(db, request) { 9 | return {contacts: db.contacts.find(request.params.id)}; 10 | }); 11 | 12 | // These comments are here to help you get started. Feel free to delete them. 13 | // 14 | 15 | /* 16 | Config (with defaults). 17 | 18 | Note: these only affect routes defined *after* them! 19 | */ 20 | // this.namespace = ''; // make this `api`, for example, if your API is namespaced 21 | // this.timing = 400; // delay for each request, automatically set to 0 during testing 22 | 23 | /* 24 | Route shorthand cheatsheet 25 | */ 26 | /* 27 | GET shorthands 28 | 29 | // Collections 30 | this.get('/contacts'); 31 | this.get('/contacts', 'users'); 32 | this.get('/contacts', ['contacts', 'addresses']); 33 | 34 | // Single objects 35 | this.get('/contacts/:id'); 36 | this.get('/contacts/:id', 'user'); 37 | this.get('/contacts/:id', ['contact', 'addresses']); 38 | */ 39 | 40 | /* 41 | POST shorthands 42 | 43 | this.post('/contacts'); 44 | this.post('/contacts', 'user'); // specify the type of resource to be created 45 | */ 46 | 47 | /* 48 | PUT shorthands 49 | 50 | this.put('/contacts/:id'); 51 | this.put('/contacts/:id', 'user'); // specify the type of resource to be updated 52 | */ 53 | 54 | /* 55 | DELETE shorthands 56 | 57 | this.del('/contacts/:id'); 58 | this.del('/contacts/:id', 'user'); // specify the type of resource to be deleted 59 | 60 | // Single object + related resources. Make sure parent resource is first. 61 | this.del('/contacts/:id', ['contact', 'addresses']); 62 | */ 63 | 64 | /* 65 | Function fallback. Manipulate data in the db via 66 | 67 | - db.{collection} 68 | - db.{collection}.find(id) 69 | - db.{collection}.where(query) 70 | - db.{collection}.update(target, attrs) 71 | - db.{collection}.remove(target) 72 | 73 | // Example: return a single object with related models 74 | this.get('/contacts/:id', function(db, request) { 75 | var contactId = +request.params.id; 76 | 77 | return { 78 | contact: db.contacts.find(contactId), 79 | addresses: db.addresses.where({contact_id: contactId}); 80 | }; 81 | }); 82 | 83 | */ 84 | } 85 | 86 | /* 87 | You can optionally export a config that is only loaded during tests 88 | export function testConfig() { 89 | 90 | } 91 | */ 92 | -------------------------------------------------------------------------------- /config.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | app/mirage/config.js 6 | 7 | 8 | 9 |
export default function() {
 10 |   this.namespace = '/api';
 11 |   
 12 | 	this.get('/contacts', function(db) {
 13 |     return {contacts: db.contacts};
 14 |   });
 15 | 
 16 |   this.get('/contacts/:id', function(db, request) {  
 17 |     return {contacts: db.contacts.find(request.params.id)};
 18 |   });
 19 | 
 20 |   // These comments are here to help you get started. Feel free to delete them.
 21 |   //
 22 | 
 23 |   /*
 24 |     Config (with defaults).
 25 | 
 26 |     Note: these only affect routes defined *after* them!
 27 |   */
 28 |   // this.namespace = '';    // make this `api`, for example, if your API is namespaced
 29 |   // this.timing = 400;      // delay for each request, automatically set to 0 during testing
 30 | 
 31 |   /*
 32 |     Route shorthand cheatsheet
 33 |   */
 34 |   /*
 35 |     GET shorthands
 36 | 
 37 |     // Collections
 38 |     this.get('/contacts');
 39 |     this.get('/contacts', 'users');
 40 |     this.get('/contacts', ['contacts', 'addresses']);
 41 | 
 42 |     // Single objects
 43 |     this.get('/contacts/:id');
 44 |     this.get('/contacts/:id', 'user');
 45 |     this.get('/contacts/:id', ['contact', 'addresses']);
 46 |   */
 47 | 
 48 |   /*
 49 |     POST shorthands
 50 | 
 51 |     this.post('/contacts');
 52 |     this.post('/contacts', 'user'); // specify the type of resource to be created
 53 |   */
 54 | 
 55 |   /*
 56 |     PUT shorthands
 57 | 
 58 |     this.put('/contacts/:id');
 59 |     this.put('/contacts/:id', 'user'); // specify the type of resource to be updated
 60 |   */
 61 | 
 62 |   /*
 63 |     DELETE shorthands
 64 | 
 65 |     this.del('/contacts/:id');
 66 |     this.del('/contacts/:id', 'user'); // specify the type of resource to be deleted
 67 | 
 68 |     // Single object + related resources. Make sure parent resource is first.
 69 |     this.del('/contacts/:id', ['contact', 'addresses']);
 70 |   */
 71 | 
 72 |   /*
 73 |     Function fallback. Manipulate data in the db via
 74 | 
 75 |       - db.{collection}
 76 |       - db.{collection}.find(id)
 77 |       - db.{collection}.where(query)
 78 |       - db.{collection}.update(target, attrs)
 79 |       - db.{collection}.remove(target)
 80 | 
 81 |     // Example: return a single object with related models
 82 |     this.get('/contacts/:id', function(db, request) {
 83 |       var contactId = +request.params.id;
 84 | 
 85 |       return {
 86 |         contact: db.contacts.find(contactId),
 87 |         addresses: db.addresses.where({contact_id: contactId});
 88 |       };
 89 |     });
 90 | 
 91 |   */
 92 | }
 93 | 
 94 | /*
 95 | You can optionally export a config that is only loaded during tests
 96 | export function testConfig() {
 97 | 
 98 | }
 99 | */
100 | 
101 | 102 | 103 | 104 | --------------------------------------------------------------------------------