GithubHelp home page GithubHelp logo

ngeorger / node-ticket-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yi/node-ticket-manager

0.0 1.0 0.0 1.41 MB

a simple ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB

License: MIT License

CoffeeScript 68.31% Ruby 3.91% CSS 0.23% JavaScript 8.08% HTML 19.47%

node-ticket-manager's Introduction

ticket-system

Build Status Dependencies Status

A simple pull-based job/ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB

This system consists of following 3 parts:

  • Ticketman website - a ExpressJS app display the current status of the centeral ticket system
  • TicketManager - a JS Class for create(TicketManager.issue) new ticket
  • TicketWorker - a JS Class pulls ticket from Ticketman website on a routine, it can also complete/giveup/add comment to a ticket. The TicketWorker instance works on one ticket at time.

Install as NodeJS module:

Install the module with:

npm install ticketman

Screenshots

Job (Tickets) List

Ticketman screenshot 01

Ticket detail

Ticketman screenshot 02

Client-worker add comments to ticket

Ticketman screenshot 03

Manage multiple client-workers

Ticketman screenshot 04

Use the Ticketman website

  1. Download and extract the latest release from https://github.com/yi/node-ticket-manager/releases
  2. run "npm install" to install dependencies
  3. run "npm start" to start the service
  4. Open http://localhost:3456 in your web browser

NodeJS Module Usage

var  TicketWorker = require("ticketman").TicketWorker;
var  TicketManager = require("ticketman").TicketManager;

TicketManager API

new TicketManager : (@name, @host, basicAuth) ->

TicketManager.issue()
// issue : (title, category, content, callback)->

TicketWorker API

Instance construction

  constructor: (options={}) ->
  # @param {Object} options, optionally includes:
  #     options.name
  #     options.id
  #     options.consumerSecret
  #     options.host
  #     options.category
  #     options.timeout : ticket processing timeout in ms
  #     options.interval : self checking interval
  #     options.basicAuth : basicAuth
  #

Evnets:

  • on "new ticket", listener signature: eventListener(ticket)
  • on "complete", listener signature: eventListener(ticket)
  • on "giveup", listener signature: eventListener(ticket)

Instance Methods

  • complete : ()->
  • update : (message, kind='default')->
  • giveup: (reason)->

HTTP API Calls:

POST '/api/tickets/new', Admin create ticket

req.body:

{
  title : "title of ticket",
  owner_id : "name of owner",
  category : "category the ticket belongs to",
  content : {
    detailed : "content of ticket",
    mixed : ["data"]
  }
}

PUT '/api/tickets/assign', Worker ask for a ticket assignment

req.body:

{
  worker : "assignment worker"
  category : "category the ticket belongs to"
}

PUT '/api/tickets/:id/comment', Worker add comment to a ticket

req.body:

{
  name : "worker",
  kind : "info",
  content : "test comment"
}

PUT '/api/tickets/:id/complete', Worker complete a ticket

req.body:

{
  name : "worker"
}

PUT '/api/tickets/:id/giveup', Worker giveup a ticket

req.body:

{
  name : "worker"
}

License

Copyright (c) 2014 yi Licensed under the MIT license.

node-ticket-manager's People

Contributors

yi avatar yxdh4620 avatar

Watchers

 avatar

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.