A simple project to manage real estate for agency to work in WordPress plugin development using WordPress Rest API, WP-script, React, React Router, Tailwind CSS, PostCSS, Eslint, WP-Data, WP-Data Store, React Components, React CRUD, i18n, PHPUnit Test, JestUnit Test, e2e Test, Gutenberg blocks and PHP OOP plugin architecture easily in a minute.
- WordPress Rest API
- WP-script Setup
- React
- React Router
- TypeScript
- Tailwind CSS [Nested + ]
- Scss
- PostCSS
- Eslint
- WP-Data
- WP-Data Redux Store [Redux Saga, Generator function, Thunk, Saga Middleware]
- React Components
- React CRUD Operations - Create, Reade, Update, Delete, Status changes and so many...
- Internationalization - WP i18n
- PHPUnit Test [Test + Fix]
- JestUnit Test
- Jest-Pupetter e2e Test
- PHP OOP plugin architecture [Traits + Interfaces + Abstract Classes]
- Gutenberg blocks
# Clone the Git repository
git clone https://github.com/dearvn/land-lite.git
# Install PHP-composer dependencies [It's empty]
composer install
# Install node module packages
npm i
# Start development mode
npm start
# Start development with hot reload (Frontend components will be updated automatically if any changes are made)
npm run start:hot
# To run in production
npm run build
After running start
, or build
command, there will be a folder called /build
will be generated at the root directory.
You need activate the plugin from plugin list page. http://[domain]/wp-admin/plugins.php
# One by one.
npm run build
npm run makepot
npm run version
npm run zip
# Single release command - which actually will run the above all in single command.
npm run release
After running release
command, there will be a folder called /dist
will be generated at the root directory with wp-land-lite.zip
project files.
composer run test
composer run test:all
npm run test:unit
WordPress core doc link: https://make.wordpress.org/core/2019/06/27/introducing-the-wordpress-e2e-tests/
Requirements:
- Must have docker installed and running by ensuring these commands -
npm run env:stop
npm run env:start
Normal e2e test
npm run test:e2e
Interactive e2e test
npm run test:e2e:watch
Get all errors of the project:
composer run phpcs
Fix all errors of the project:
composer run phpcbf
Full Composer test run:
composer run test:all
http://[domain]/wp-admin/admin.php?page=landlite#/
- Product Types
- Method:
GET
- URL: http://[domain]/wp-json/product-real-estate/v1/product-types
- Method:
- Cities dropdown
- Method:
GET
- URL: http://[domain]/wp-json/product-real-estate/v1/cities/dropdown
- Method:
- Product Lists
- Method:
GET
- URL: http://[domain]/wp-json/product-real-estate/v1/products
- Method:
- Product Details
- Method:
GET
- URL By ID: http://[domain]/wp-json/product-real-estate/v1/products/1
- URL By Slug: http://[domain]/wp-json/product-real-estate/v1/products/first-product
- Method:
- Create Product
- Method:
POST
- URL: http://[domain]/wp-json/product-real-estate/v1/Products
- Body:
{ "title": "Simple Product Post", "slug": "simple-product-post", "description": "Simple product post description", "city_id": 1, "product_type_id": 2, "is_active": 1 }
- Method:
- Update Product
- Method:
PUT
- URL: http://[domain]/wp-json/product-real-estate/v1/products/1
- Body:
{ "title": "Simple Product Post Updated", "slug": "simple-product-post-updated", "description": "Simple product post description", "city_id": 1, "product_type_id": 2, "is_active": 1 }
- Method:
- Delete Products
- Method:
DELETE
- URL: http://[domain]/wp-json/product-real-estate/v1/products
- Body:
{ "ids": [1, 2] }
- Method:
Detailed Documentation - View Detailed documentations with parameters and responses of the REST API
v0.0.1 - 05/12/2022
- New Feature : Product Create.
- New Feature : Product Update.
- New Feature : Product Delete.
- New Feature : Product Status change.
- New API: City dropdown list.
- New: Updated logo icon and plugin name.
- New Components: Input Text-Editor, Improved design.
- Refactor: Refactored codebase and updated docs.
- New: Product type seeder.
- Chore: Zip file generator.
- Chore: i18n localization generator.
Options for specific files:
Get specific file errors of the project:
vendor/bin/phpcs product-real-estate.php
Fix specific file errors of the project:
vendor/bin/phpcbf product-real-estate.php
Simple Version with raw PHP
Version with EsLint and i18n Setup
https://github.com/dearvn/land-lite/releases/tag/vSimpleEslint
Version with EsLint, i18n and React Router Setup
https://github.com/dearvn/land-lite/releases/tag/vReactRouter
Version with PostCSS and Tailwind CSS Setup
https://github.com/dearvn/land-lite/releases/tag/vTailwindCss
Version with PHPCS setup
Version with PHP OOP Architecture
Inside src/blocks
you'll find gutenberg block for ready block setup -
Contribution is open and kindly accepted. Before contributing, please check the issues tab if anything in enhancement or bug. If you want to contribute new, please create an issue first with your enhancement or feature idea. Then, fork this repository and make your Pull-Request. I'll approve, if everything goes well.
Find me at donald.nguyen.it@gmail.com