Skip to content
This open source mMessages microservice created by the mimik team is an example cross-platform solution for text messaging.
Branch: master
Clone or download
Latest commit 2919c74 Mar 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
deploy Delete index.js Oct 15, 2018
src Update index.js Oct 17, 2018
.eslintrc Publish mMessages microservice Oct 15, 2018
.gitignore Update .gitignore Oct 17, 2018
.npmrc Publish mMessages microservice Oct 15, 2018
README.md Update README.md Mar 6, 2019
package-lock.json Update package-lock.json Nov 6, 2018
package.json Publish mMessages microservice Oct 15, 2018
webpack.config.js Publish mMessages microservice Oct 15, 2018

README.md

mMessages

This open source mMessages microservice created by the mimik team is an example cross-platform solution for text messaging. More specifically, this edgeSDK microservice has the following functionality:

  1. Uploading user's messages to mMessages's local database.

  2. Retrieving user's messages from local database.

  3. Retrieving other users' messages from their individual local database.

Releases & Deployment

For latest update: https://developer.mimik.com/docs/microservices/deploy

How to obtain the built-version of this microservice?

Please visit the releases section of this GitHub page to download the ready-to-deploy container image file of this microservice.

How to deploy this microservice on edgeSDK?

  1. Please make sure that you have downloaded the latest edgeSDK and it is running correctly on your targeted development platform.

  2. Please check that you have performed all the following prerequisite steps to setup you edgeSDK on your targeted platform:

    1. Register yourself on mimik's developer portal and add your application information to the portal to get authorization of edgeSDK access. Note: For information about Redirect URL, please go to link.

      Attention: Please safe keep your App-ID and Redirect URL for OAuth authorization later on.

    2. Get your edgeSDK access token from following OAuth tool of your targeted platform:

      Please read this on how to use the OAuth tool: Instruction on How to use the OAuth tool.

      OAuthtool application for Windows
      OAuthtool application for MacOs
      OAuthtool application for Linux

      Attention: Please safe keep your edgeSDK access token for later deployment use.

    3. If you have not downloaded the latest built version of the microservice at here, please download it now.
  1. Now you are ready to deploy this microservice on the edgeSDK, please run the following command on the bash terminal:

    Note: For Windows user, please download Cygwin or Git Bash to perform this.

    Attention: Please run the following commend under the same directory of your downloaded microservice file.

    The following curl command is for deploying this microservice to the edgeSDK:

    curl -i -H 'Authorization: Bearer **Replace withYourToken**' -F "image=@games-v1.tar" http://localhost:8083/mcm/v1/images

    The following curl command is for specifying the environment variable:

    curl -i -H 'Authorization: Bearer **ReplacewithYourToken**' -d '{"name": "messages-v1", "image": "messages-v1", "env": {"MCM.BASE_API_PATH": "/messages/v1"} }' http://localhost:8083/mcm/v1/containers

  2. The output of the above command will return status code of 200 after the deployment is successful.

  3. Now you can read about the APIs in this microservice and check their functionalities on SwaggerHub.

How to build a microservice

Tools that you need:

Steps to build:

  1. Clone the microservice project from GitHub somewhere accessible on your home directory. This guide will start from the Downloads folder

    cd ~/Downloads

    git clone https://github.com/mimikgit/mMessages.git

  2. Navigate to the directory of the cloned repository.

  3. Install dependencies:

    npm install

  4. Next run build script:

    npm run-script build

  5. Verify that index.js is copied under /build directory.

    Attention: You will need to have the root permission to perform the following task.

  6. Change owner group of the build script in the deploy directory

    sudo chmod a+x deploy/build.sh

  7. Run build script to create an image for the container under deploy directory:

    cd deploy/ && ./build.sh

  8. Verify that a tar file of mimik container image is created as messages-v1.tar under deploy directory

  9. Now you can redirect back to the deployment section and deploy your newly built microservice.

Source Code Navigation

This Repository Folders

- src/     the main source code for the microservice
- build/   the compiled javascript (after running build scripts)
- deploy/  image file for the container

For more details about the src/ directory, please visit the README file under the src/ directory.

You can’t perform that action at this time.