Skip to content

Moqui Introduction & Setup

Janvi Talreja edited this page Feb 25, 2022 · 7 revisions

Moqui Introduction

Prerequisites

  1. You must have your GitHub account created.

  2. You must have GIT installed on your computer.

    Go to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git to see installation instructions.

  3. The Java version should be java 8 or higher. Check java version of your machine.

    java -version

  4. Use MySQL version 5.7.x. Please check the MySQL version in your machine.

  5. You should know how to navigate to file directories on your machine via the terminal window, if you are on Linux/Mac.

  6. Learn to use Postman for testing the APIs.

    Go to https://learning.postman.com/docs/getting-started/introduction/ to learn about Postman.

Introduction to Moqui Framework

  1. https://www.moqui.org/docs/framework/Introduction.
  2. https://www.moqui.org/m/docs/framework/Run+and+Deploy.

Set up Moqui Framework for application development

Watch the below video to get an overview for Moqui Framework and setup.

https://youtu.be/Q2ZM4BcVoC

  1. Open a Terminal window

  2. Go to ~/sandbox (or create the development directory)

  3. Clone the Moqui framework repository

    git clone -b master https://github.com/hotwax/moqui-framework.git

  4. Go to moqui-framework directory, add the runtime component

    cd moqui-framework

    git clone -b master https://github.com/hotwax/moqui-runtime.git runtime

  5. Go to moqui-framework/runtime/component, clone the below required component.

    git clone -b master https://github.com/hotwax/mantle.git

  6. Fork the below repository

    https://github.com/hotwax/moqui-tutorial.git

  7. Clone the repository that you forked above.

  8. Run the application from the moqui-framework directory.

    ./gradlew run

    Note: Ignore the warnings and errors in the console for Moqui connecting to ElasticSearch.

  9. Go to http://localhost:8080

  10. Verify that the application is up and running.

IDE Setup

Follow the link below to set up the moqui-framework project in the IDE.

https://www.moqui.org/m/docs/framework/IDE+Setup/IntelliJ+IDEA+Setup

Adding XML Schemas

Add the xsd locations as given under the heading XML Schemas in the link.

https://www.moqui.org/m/docs/framework/IDE+Setup/IntelliJ+IDEA+Setup

Configure the xsd files for the Entity Definition, Service Definition and Service REST API XML schema locations in your IDE.

Database Configuration

  1. Watch the below video to get an overview of the database configuration and data load in Moqui.

    https://youtu.be/b-2Wu4CC1hg

  2. JDBC driver dependencies

    MySQL JDBC dependency is already added in the component’s build.gradle that you cloned above.

    You can check the dependency in the build.gradle file, added as below.

    runtime 'mysql:mysql-connector-java:5.1.47'

  3. Create Database

    Create a database using the following command:

    CREATE DATABASE moqui CHARACTER SET utf8

  4. Update the Mysql configuration

    For Development:

  • Update the runtime/conf/MoquiDevConf.xml and add the mysql database name, your user, and password detail
<default-property name="entity_ds_db_conf" value="mysql"/>
<default-property name="entity_ds_host" value="127.0.0.1"/>
<default-property name="entity_ds_database" value="moqui"/>
<default-property name="entity_ds_user" value="moqui"/>
<default-property name="entity_ds_password" value="moqui"/>

Data Load

  1. Go to the moqui framework directory and run the command to load data.

    ./gradlew load