Coder Social home page Coder Social logo

warehouse.ai-ui's Introduction

warehouse.ai-ui

Version npm License npm Downloads Build Status Dependencies

UI for Warehouse.ai. Visual representation of your builds and status events. For convenience, a CLI also exists for Warehouse.ai.

Install

git clone [email protected]:godaddy/warehouse.ai-ui.git
cd warehouse.ai-ui && npm install

Usage

The module provides a bin/server script that starts the UI. Run the UI with npm.

npm start

The client-side bundle already comes packaged with this npm module, but if you need to re-build the assets, for whatever reason, you can do so as follows:

npm run build

API

GraphQL API

Warehouse UI is backed by a GraphQL API. This API transforms the data from the existing warehouse API to a model that is specific to this UI. The GraphQL models are based on warehouse-models and warehouse.ai-status-models. Refer to those schemas for a data reference and properties that are available.

Libraries used

The service mostly uses the reference JS implementation of GraphQL with some Apollo utilities.

  • express-graphql (An express middleware for creating the GraphQL API, and exposes GraphiQL outside of production).
  • graphql-tools (graphql-tools is used for makeExecutableSchema. This allows the schema to be defined in the GraphQL schema language and then easily combined with the resolver map).

For the client we use apollo-client. This enables SSR and client caching without needing any schema changes.

Configuration

At a minimum you, must provide that path where which warehouse.ai-ui can find your configuration. Because this is largely a wrapper around slay, the configuration directory must take the exact same form. Example config files can be found in /lib/config. Additionally, the configuration files should include configuration information for the warehouse.ai-api-client. This information should be under the wrhs key in the config.

const WrhsAiUI = require('warehouse.ai-ui');
const configPath = '/path/to/config/files';

WrhsAiUI({ configPath }, (err, app) => {
  if (err) { throw err; }
  app.log.info(`Listening on ${app.config.get('http')}`);
});

In addition, you can provide authorization and authentication configuration via the auth and routing parameters, which let you define anything else that you would need to secure your UI.

const WrhsAiUI = require('warehouse.ai-ui');

function isLoggedIn (req, res, next) => {
  if (req.secretIdentity !== 'Bruce Wayne') {
    res.redirect('/', 401);
  } else {
    next();
  }
}

function addAdditionalRoutes(app) {
  app.get('/faq', (res, res) => res.send('idk Google it'));
}

const options = {
  auth: isLoggedIn,
  routing: addAdditionalRoutes,
  configPath: '/path/to/config/files'
};

WrhsAiUI(options, err => {
  if (err) throw err;
  app.log.info(`Listening on ${wrhsUI.config.get('http')}`);
});

Test

npm test

warehouse.ai-ui's People

Contributors

dependabot[bot] avatar smehta-godaddy avatar jcrugzz avatar swaagie avatar fritzmonkey avatar msluther avatar agerard-godaddy avatar sivanmehta avatar

Stargazers

Felipe Monteiro avatar  avatar

Watchers

Charlie Robbins avatar Arnout Kazemier avatar Andrew Gerard avatar Fady Matar avatar Antonio Silveira avatar Andrew Burgess avatar Chris Abrams avatar Jason Cline avatar  avatar Adrian Chang avatar  avatar James Cloos avatar Silas Boyd-Wickizer avatar Steven Feltner avatar Shaun avatar Ryan Benedum avatar Jacob Page avatar  avatar Jacopo Daeli avatar  avatar Kawika Bader avatar Rick Markins avatar  avatar Kostas Georgiou avatar  avatar Kawika Bader avatar

Forkers

rxmarbles

warehouse.ai-ui's Issues

Verify accuracy of `README`

Acceptance Criteria:

  • Ensure that the README is still accurate and covers all functionality
  • Includes links back to warehouse docs/diagrams
  • Includes links to relevant repos (e.g. carpenterd-worker should link to workers-factory, probably bffs, etc.)
  • Readme is updated or new issues are created

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.