Giter Club home page Giter Club logo

tin_can_telephone's Introduction

tct: tin_can_telephone

a stateless back-end web service with the purpose of connecting multiple clients' users via either TCP or HTTP connections, ideally running asynchronously.

First Task: How do you do that?

Well form a TCP Connection with the messaging service.

Then use this predefined format for sending messages :

    { "<Type>" : { ... } }

Currently supported JSON objects to be read by server :

{ "Message" : { "to": "<UserID>", "from": "<UserID>", "msg": "Hello world" } }

{ "GroupMessage" : { "to": "<UserID>", "from": "<UserID>", "msg": "Hello world" } }

{ "Request" : { "to": "<UserID>", "from": "<UserID>", "kind": "<RequestKind>" } }

{ "Response" : { "to": "<UserID>", "from": "<UserID>", "kind": "<ResponseKind>" } }

{ "Register" : { "user": "<UserID>", "psw": "password" } }

{ "RegisterGroup" : { "group": "<UserID>", "admin": "<UserID>" } }

{ "LoginCredentials" : { "user": "<UserID>", "psw": "password" } }

{ "Error" : "Hello error!" }

{ "EOF" }

Note: The "error" json object is only used for the server itself, and is what is produced when there was trouble parsing.

RequestKind : This field evaluates to a string, currently supported requests:

"UserInfo"      // get info about a particular user
"ChatHistory"   // get chat history between a 'to' and 'from'
"GroupHistory"  // group history for 'to'
"GroupInvite"   // Invites a 'to'
"Friends"       // Shows friends

ResponseKind : Produces a JSON object with a single field, which is the name of the request.

The value they are set equal to is either an array or a hashmap. Arrays will be used for *History, as messages occur in linear time. HashMaps will be used for information regarding a particular user / group.

"UserInfo":[]
"ChatHistory":[]
"GroupHistory":[]
"GroupInvite":int // Accepted or declined? true or false / 1 or 0.
"Friends":[]

tin_can_telephone's People

Contributors

colindjk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

joepalazzo

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.