BjoernSchotte / Magento-on-Angular

Angular.js application using Magento as the backend API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mao

Tired of Magento's lack of unit testing? Configuration over convention? Use of Prototype.js? Badly written JavaScript? Untested third-party modules? Likewise! Mao brings Magento into the 21st century.

Angular, Magento, Laravel

Unit Testing

All unit tests for both JavaScript and PHP can be run from the terminal: grunt test.

  • Run PHPUnit tests only: grunt php-test
  • Run Jasmine tests only: grunt js-test
  • PHP specific unit tests are available with the phpunit command from the /api/ directory;
  • JavaScript specific unit tests are available via the URL /store/tests/;

Mao's Events (Hooks)

I've attempted to standardise the events that are fired within the application.

CategoriesController
Broadcasts mao/categories/loaded All categories have been loaded
ProductsController
Broadcasts mao/products/loaded All products have been loaded
Listens mao/categories/set Updates products when the category changes
Listens mao/categories/unset Updates when no category constraints are applied

Laravel API

If you prefer to use another JS framework such as Ember or Meteor, then you're more than welcome to use the API in isolation. Below we've documented the URLs and their purposes:

  • /products – fetch all the products;
  • /product/5 – fetch a product with the ID of 5;
  • /categories – fetch all the categories and their sub-categories;
  • /basket – fetch all of the items in the basket;
  • /basket/add/2 – add an item to the basket with product ID 2;

Specification

  • Angular.js front-end for one-page functionality;
  • Laravel API for interacting with Magento;
  • Simplified PHP back-end REST API;
  • Implement Spreedly as the payment gateway;
  • Front-end and back-end tests with >90% unit-test code coverage;
  • Abides by the rules to make it Google crawlable;
  • Socket.io (WebSockets) for instant product availability;
  • Standardised modules: Facebook Connect, Gift Wrapping, et cetera...;
  • GZipped data packages from back-end API;
  • Real-time currency converter using Google Calculator API;
  • Crossfilter for super-fast filtering across all models;
  • (Future) Fallback to lazy-loading models for mobiles/tablets;

About

Angular.js application using Magento as the backend API