This section clarify some API that use from the product, this is base on the Dokan API and some extra customize Wordpress site

Common File

File locate: src/Common**

  • Config.js: main config variables for the app
  • Colors.js: config theme color for the app
  • Constants.js: Config wordpress URL, icons, categories...
  • Images.js: list of all images use for the app
  • Languages.js: main language file config
  • Layout.js: Use to config the main flexible homepage.
  • Tools.js: Common functions

Components

  • Files locate in: src/Components
  • Common components that could be used many time, this could be a custom button, comment component, icon input...

Containers

  • Files locate in: src/Containers
  • most components of the app is putting here, you could change or re-structure by matching with your own project design.

Expo

  • Files locate in: src/Expo
  • Wrapper Expo function

Services

  • Files locate in : src/Services
  • The Wodpress Api for the app you can refer to the Wordpress API -http://v2.wp-api.org/and custom your own function if you want to add more feature for the app.
  • App/Containers
    most container/pages of the app is putting here, you could change or re-structure by matching with your own project design.
  • App/Navigation:
    Wrapper function for react-nativigation and main screens of navigation
  • Wrapper function for react-nativigation v2.0

Redux

  • Files locate: App/Redux
  • Contain main action and reducers

project-structure-1

Debug app with Reacttotron

Link download on desktop: http://bit.ly/2L0R9gY

It's already configed with the project, after installed the Reacttotron you can see list of Log, Image, connection, API, Redux actions....

reacotron-debug

You can able to the config the app to work with Reactotron or React Native Debugger by change useReactotron:false (file common/Constants.js)

Common API

  1. GET - Get Products ( https://your-hosting.com/wp-json/wc/v2/products)

  2. This endpoint allows you to get list of products, detail from - http://bit.ly/2L3vvJi
  3. page (number): Current page of the collection. Default is 1.
  4. per_page(number): Maximum number of items to be returned in result set. Default is 10.

get-products

  1. GET - Get Product Categories ( https://your-hosting.com/wp-json/wc/v2/categories)**

  2. This help to list all the categories
  3. page (number): Current page of the collection, default is 1.
  4. per_page(number): Maximum number of items to be returned in result set. Default is 10.

get-product-categories

  1. GET - List all payment gateways ( https://your-hosting.com/wp-json/wc/v2/payments_gateways)**

  2. This API helps you to view all the payment gateways
  3. page (number): Current page of the collection, default is 1.
  4. per_page(number): Maximum number of items to be returned in result set. Default is 10.

get-payments