avinashjoshi / cakephp-3-backend-api-angularjs-frontend

CakePHP 3 as a powerful back-end API, using AngularJS as frontend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CakePHP 3 as a powerful back-end API

Notes

  1. I highly recommend you to use this repository as a template only.
  2. Consider the folder backend and frontend as its own separate repositories. It is merged into one for ease.
  3. frontend contains the Frontend AngularJS code, a basic site.
  4. backend contains the Backend CakePHP code.
  5. presentation.pdf are slides I presented at CakeFest 2016.

Recommended setup

You are welcome to get createive in your setup. This is how i have my repositories setup:

  • blob.dev points to frontend
  • api.blob.dev points to backend

If you prefer to use a different frontend domain, be sure to add that to the $origin in backend/src/Routing/Filter/CorsFilter.php.

The main logic / core lies in Dispatch Filters. Read more about it here: http://book.cakephp.org/3.0/en/development/dispatch-filters.html

Frontend

Run the following command inside frontend folder:

$ bower install

Backend

Set it up like you would setup any CakePHP 3 app. That is run the composer command inside backend folder:

$ composer install

Run migrations:

$ bin/cake migrations migrate

About

CakePHP 3 as a powerful back-end API, using AngularJS as frontend


Languages

Language:PHP 79.0%Language:CSS 11.0%Language:JavaScript 4.1%Language:HTML 3.2%Language:Shell 1.5%Language:Batchfile 0.8%Language:ApacheConf 0.4%