Giter VIP home page Giter VIP logo

openwhisk-react-ui's Introduction

UI for Apache OpenWhisk

This repo is an experiment with the main purpose of learning React & Redux. Because I played around with Apache OpenWhisk earlier, I decided to create a UI for this FaaS platform.

With this UI, you will be able to create actions, triggers and rules. This UI can be useful when working with custom cloud deployments of OpenWhisk.

Technologies

  • React
  • Redux
  • Webpack

Other libraries:

  • axios
  • lodash
  • react-ace
  • react-pagination
  • redux-logger
  • redux-promise
  • redux-thunk

For testing:

  • jest
  • enzyme
  • sinon
  • deep-freeze

Prerequisites

You have 2 options here:

  • Deploy a custom OpenWhisk in your cloud infrastructure
  • Use a hosted version of OpenWhisk on Bluemix:

Remember about disabling the CORS add-on after you're finished playing around.

Run app

  1. After Bluemix CLI is installed, run

    bx wsk property get
  2. Encode whisk auth token, consisting of username and password (username:password):

    echo -n username:password | base64 
  3. Copy whisk API host, whisk API version, returned token from command above and paste into config.js file:

    export const config = {
        baseUrl: 'https://<whisk API host>/api/<whisk API version>/namespaces/<your email>_dev',
        namespace: '<your email>_dev',
        token: 'Basic <token>'
    };
  4. Install all dependencies

    yarn install
  5. Run

    npm start

The application should appear under localhost (port 8080 is set by default).

And Voilà! Have fun!

Simple user journey

  1. Create an action with this code and name it as you want:
function main(params) {
   return {
       result: 'Hello ' + params.name
   };
}
  1. Create a trigger with these parameters:
[
  {
    "key": "name",
    "value": "WRITE_HERE_YOUR_NAME"
  }
]
  1. Create a rule to connect your action and trigger.
  2. Go to Trigger list and Run your trigger.
  3. Go to Activations list and display details. You should see something like this:
{
  "response": {
    "result": {
      "result": "Hello WRITE_HERE_YOUR_NAME"
    },
    "success": true,
    "status": "success"
  },
  "logs": []
}

In case if you don't see new activation, just wait. When you run a trigger, OpenWhisk has to take its parameters, inject them into the action and then create an activation. It can take a while.

Roadmap

There are a couple of things, which will be improved:

  • RWD (the application was tested only on Chrome browser and 15-inch laptop)
  • modals (confirmation before deleting and information in case of any failures)
  • listening for the new activations
  • caching
  • add possibility to run the code using a custom image (blackbox option)
  • create sequence actions (with drag and drop)

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.