Giter VIP home page Giter VIP logo

ticketingservice's Introduction

TicketingService

This is a ticketing service using tornado framework.

Tornado version : 5.1.1

Torndb version : 0.3

Author : Mohammad Ali Poorafsahi

PreRequirements

  • python
  • mysql

Debian distribution command to install python and mysql:

$ apt install python mysql

installation

step 0:cloning the repository

$ git clone https://github.com/MohammadAliAfsahi/TicketingService.git $ cd ticketing_project

step 1: Mysql

check if mysql service is running using following command: $ service mysql status

if mysql is running you're free to skip, if not use following command in order to start mysql service: $ service mysql start

run following command as a user that has root privillege or a user that can create database(you can change root to desired user):

$ mysql -u root

mysql> CREATE DATABASE ticket;

Allow the "ticket" user to connect with the password "ticket":

mysql> GRANT ALL PRIVILEGES ON ticket.* TO 'ticket'@'localhost' IDENTIFIED BY 'ticket';

step 2: create table

mysql> use ticket;

mysql> CREATE TABLE user ( id smallint unsigned not null auto_increment, username varchar(20) not null, password varchar(20) not null,firstname varchar(20),lastname varchar(20),apitoken varchar(100), admin BOOLEAN NOT NULL,constraint pk_example primary key (id));

mysql> CREATE TABLE tickets ( id smallint unsigned not null auto_increment, subject varchar(50) not null,body varchar(500) NOT NULL, status VARCHAR(20) NOT NULL, userid INT NOT NULL, date DATETIME DEFAULT CURRENT_TIMESTAMP, response VARCHAR(500),constraint pk_example primary key (id) );

Give a user Admin privilege

if you want to give a specific user admin privilege you need to do it manully in mysql database using following command: mysql> update user set admin=1 where id = userid

you need to replace userid in where clause with id of user you want to become admin.

Run project

$ python server/server.py

Usage

There is a .mp4 file in this page which you can see how to use this project. For both POST and GET method running codes are the same(the difference is in implementation).

The main features are:

  1. login
  2. signup
  3. logout
  4. Sending ticket
  5. Get tickets (user privilege)
  6. Close ticket(user privilege)
  7. Change status of ticket (admin privilege)
  8. Response to ticket (admin privilege)
  9. Get tickets (admin privilege)

This project supports both POST and GET methods.

Client

In order to run client code you need request module which is pre-installed in python but if not use following command:

$ pip install requests

$ python client/client-get.py or $ python client/client-post.py

Support:

special thanks to :

@limner

ticketingservice's People

Contributors

mohammadaliafsahi avatar

Watchers

James Cloos 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.