Coder Social home page Coder Social logo

gotalk's Introduction

goTalk

A simple Go based IM system. The Project is based on Go 1.3.1 currently. Has Tested onGo 1.4.1.

Image of goTalk

To Run

  1. Install Golang to your computer,
  2. Checkout the project,
  3. Go to the project folder and run go run imServer.go to start the server.

The default port is 9000 (e.g. entry: localhost:9000/), can be changed in imServer.go.

The login services is not implemented yet.

Currently, the project has not connect to any database but will in the future.

Todo: need do a sh file for compile project and run (a easy way to run)!

The Software Architecture

![Image of goTalk arch](https://github.com/alvindaiyan/goTalk/blob/master/config/goTalk Arch v0.png) The user can has two role in this simple IM system. One is the sender, and one is the receiver. Each user has a channel to store message. goTalk is designed to obtain the http transfer standard.

The Message Sending Process

This section will introduce the message sending process of the goTalk. The service name is send, requires FOUR parameters and is a POST method. The three params are the Token, the id(send user), the username (senduser) the sendTo(user id of the receiver) and the message content. (After checking the validability of the token) When a message is sent, the server firstly receive the message and parse to a User object and a Message object. A receive message will be send back. Then the server find the channel regarding of the receive user's id and add to it. If the receiver Id is valid but there is not a channel for it, a new channel will be created and added to the appConfig. An example ajax call is:

      $.post('/send', 
				{
					username: username,
					id: id,
					sendToId: sendToId,
					content: content
				}, function(data) {
				// data is in Json format
				...
				});

The Message Receiving Process

There is a map to store all the message channel and indexed by the user id. When the server receive a request to sync the user's message status, the services name is sync, require two params: Token, id(user id). The message will be dequeue from the channel and pass back to the user as Json string.

Problem: The message could be lost if the message is not successfully send at first time. need to be fixed!

Security (Not Decide yet)

Currently, using AES256.

gotalk's People

Contributors

alvindaiyan avatar

Watchers

xufc 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.