Note: Those updating from 0.2.8 to 0.3.0 need to run:
composer dump-autoload from
api/ and update the new
Heapshots: Moa uses HeapDump to take memory snapshots. Send a
kill -USR2 <pid> where
<pid> is your Node.js process ID.
config.json.samplewith your own paths, and hostnames; rename
php artisan productsfrom
example.com/Magento-on-Angular/store/in your browser;
Magento Admin > Configuration > Webif you did a fresh installation of Magento.
Optionally, you may prefer to structure your config and folders in the manner described in this wiki page: https://github.com/Wildhoney/Magento-on-Angular/wiki/Preferred-Folder-Structure-and-Config
If things are not working correctly, take a look at
api/public/attributes/color for any Laravel/Magento issues. Please don't spend too much time debugging – file a bug!
phpunitcommand from the
Since your product collection might be a little slow because of Magento's EAV database structure, Moa allows you to create a cache key via the terminal instead – however a cached copy will still be generated if you access it via your browser.
In order to generate a cache for the product collection, you can run
php artisan products from the terminal. Once completed, the normal API method via the browser will use this cache key.
Please note that by default the cache is using plain old file cache. If you want to use Redis, change the configuration on line 18 of
redis. More information on the cache configuration is available on http://laravel.com/docs/cache#configuration.
At first glance the directories may seem over-complicated. However there's method in all of the madness!
apicontains the Laravel framework which interfaces with Magento;
distcontains production-ready minified JS/CSS files for Moa;
nodecontains Node.js server for delivering products via Snapshot;
storecontains the actual Angular.js Moa application;
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/4– add an item to the basket with product ID 2 and quantity 4;
/basket/remove/2– Remove an item from the basket;
/attributes/color– fetch attributes by name;
/currencies– fetch a list of currencies and their conversion rates;
/account– fetch details of currently logged in user;
/account/login– login a user;
/account/logout– logout a user;
/account/register– create a new user account;