GithubHelp home page GithubHelp logo

yi / node-ticket-manager Goto Github PK

View Code? Open in Web Editor NEW
82.0 13.0 31.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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-ticket-manager's Issues

npm start not working on localhost

Hi

  1. I download latest release
  2. i ran the command "npm install"
  3. I ran the command "npm start" and I am getting this error.
    ticketmanager
    Can you help me!

这个系统是用来做什么的?

我们团队需要搞一个客服系统,追踪每个客户相关的“事件”。
希望能用Nodejs实现,但是搜遍了全网,没找到合适的项目。
国外的很多网站客服好像都叫做“request a ticket” 不知道这个node-ticket-manager是针对这个场景设计的吗?

package.json issues with just me ?

i am able to run the ticket manager locally on my machine using npm start .
However i tried to install it on openshift.com and it is not starting .. On searching internet i found that the start commands should be part of package.json and npm start is not part of start tag in package.json .
The error on server states :
DEBUG: Running node-supervisor with
DEBUG: program 'lib/index'
DEBUG: --watch '/var/lib/openshift/549c15254382ec58f0000070/app-root/data/.nodewatch'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js|coffee'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node lib/index'
DEBUG: Watching directory '/var/lib/openshift/549c15254382ec58f0000070/app-root/data/.nodewatch' for changes.
DEBUG: Program node lib/index exited with code 0
DEBUG: Starting child process with 'node lib/index'
DEBUG: Program node lib/index exited with code 0
DEBUG: Starting child process with 'node lib/index'

These last commands are reperting and server is not starting .

DO i need to make few changes before i can run it easily on some server for free . In case you have some server instances where u ran it without change for free can u guide me .

Ticketman not connecting to localhost:27017

I am new to using either mongo and/or node. But I have setup a few other packages in the past.

Currently I am running into an issue where it looks like npm start is not allowing the connection to be made to localhost:27017.

Has anyone else experienced this as an issue? I have tired running it from both an Ubuntu 16 system and a windows 10 system. I get the same error on both systems.
`>npm start

[email protected] start C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5
nodemon lib/server.js

[nodemon] 1.11.0
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node lib/server.js
Failed to load c++ bson extension, using pure JS version
Failed to load c++ bson extension, using pure JS version
[express::main] pathToView:C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\views
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
events.js:141
throw er; // Unhandled 'error' event
^

Error: failed to connect to [localhost:27017]
at null. (C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:553:25)
at emitThree (events.js:97:13)
at emit (events.js:175:7)
at null. (C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:140:15)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket. (C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection.js:512:10)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1269:8)
[nodemon] app crashed - waiting for file changes before starting...
^CTerminate batch job (Y/N)? y`

ticketman initial boostrap problem post install

Using node 6.5, npm 3.10.3. windows 7 64 bit:

a) Downloaded the .25 code from Git Hub
b) cd in directory, npm install
c) attempting npm start, and received this error set

Failed to load c++ bson extension, using pure JS version
[express::main] pathToView:C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\views
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
events.js:160
throw er; // Unhandled 'error' event
^

Error: failed to connect to [localhost:27017]
at . (C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\node_modules\mongodb\lib\mongodb\connection\server.js:553:25)
at emitThree (events.js:116:13)
at emit (events.js:194:7)
at . (C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:14
at emitTwo (events.js:106:13)
at emit (events.js:191:7)
at Socket. (C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\node_modules\mongodb\lib\mongodb\connection\connection.js:5
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1272:8)

Solution welcome...

Error creating new Ticket

This is my code:

    var util = require('util'),
        http = require('http'),
        httpProxy = require('http-proxy');

    httpProxy.createProxyServer({target:'http://localhost:9000'}).listen(8000);

    var  TicketManager = require("ticketman").TicketManager;
    var  TicketWorker = require("ticketman").TicketWorker;
    var ticketWorker = null;
    var mongoose = require('mongoose');

    var express = require('express');
    http.createServer(function (req, res, body) {
        res.writeHead(200, { 'Content-Type': 'text/plain' });
        res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2));
        res.end();
    }).listen(9000);
        var ticketManager = new TicketManager("test ticket_manager", "http://localhost:3456");
        // = new TicketWorker({id:1001, name:"test ticket_manager", host:"http://localhost:9000", category:"worker", consumerSecret: "bigSmalls"});
        var category, content, title;
        content = {
            detailed: "content of ticket",
            mixed: ["data"]
        };
        title = "test ticket " + (Date.now());
        category = "sample";
        ticketManager.issue(title, category, content, function (err, ticket) {
            setTimeout(function(){
                console.log(ticket);
                console.log(err);
            }, 500);

        });

}).call(this);

But I am getting this error!
[Error: Fail to create ticket:test ticket 1449613199454#sample, due to MongoErro r: driver is incompatible with this server version]

test version

hello it seems what I need to use for a client of mine since programming it would take too much time from me. I downloaded the latest version unzip it and installed all package but could not get it working it releases to many errors

`Failed to load c++ bson extension, using pure JS version
[express::main] pathToView:/Users/amirmahmoodi/Downloads/node-ticket-manager-0.2.5/views
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
ticketman:server Ticketman app started on port 3456 +90ms
events.js:292
throw er; // Unhandled 'error' event
^

Error: failed to connect to [localhost:27017]`

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.