Skip to content

Axheladini/WordPress-SPA-WP-RESTful-API-Vue.js-

Repository files navigation

WordPress SPA APP - Creat and Read of the small CRUD

Simple and small app for testing WP RESTful Endpoints with Vue.js

This small APP is based on Wordpress REST API technology and Vue.js framework for frontend.

AWS free tier EC2 instance link
https://wp-api.agonxheladini.com/

Requirements and Instalation

1. This app is build as child theme of Beans theme. Therefore as a first step you must install Beans theme. GitHub repository can be found here:

https://github.com/Getbeans/Beans

2. When working with Wordpress REST API you need to install and activate JSON Basic Authentication plugin. The plugin repo can be found on this link:

https://github.com/WP-API/Basic-Auth

3. To speed up the proceess of coding and structuring the APP I have used a ready made Custom Post Typs (CPT) class by jjgrainger for creating the CPT 'Client'. The same class is imported with composer. The repo for this class can be found here:

https://github.com/jjgrainger/wp-custom-post-type-class

4. With this app a 'client' can use a form and register to our platform by using WP REST API, there is a need for authentication method. Since it is test project i have used Basic Authentication method. For enterprise usage I strongly advice OAuth2 as authentication method for WP REST API. For this reason in the child theme directory inside include directory search for a file called ax_wp_spa_enqueue_assets.php, on line 23 replace username and password with your user information.

wp_localize_script( 'app_vue_js', 'axSettings', array( 'root' => esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'username'=>'admin', 'passwd' => 'admin' ) );

5. The last step is to upload the child theme (wp-spa) or clone this repo to your Wordpress theme directory.

6. After you pass all steps dont forget to update Composer.

  • Developed under Wordpress version: 4.9.4
  • Vue.js v2.5.13

About

Create and Read of the small CRUD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published