top
(README.md)
# chitchat

A basic websocket-based chat service written in Go

## Building

You need the following:

- [Go](http://golang.org/)
- [Node](https://nodejs.org/)
- [NPM](https://www.npmjs.com/)
- [Bower](http://bower.io/)
- [Gulp](http://gulpjs.com/)

```bash
# Build our application
go get
go build

# Install assets
npm install
bower install

# Compile/minify assets
gulp
```

## Running

With all defaults:

```bash
# Development mode
./chitchat

# Production mode
./chitchat --production
```

There are flags that you can pass, and will probably have to at least for your database.

You can view them all in `flags.go` or pass the `--help` flag to the application.

```bash
./chitchat --help
```

## Tasks

Conceptually, the service should have five high-level capabilties:

 - [x] Connect
 - [x] Login
 - [x] Send Message
 - [x] Receive Message (push)
 - [x] Fetch Message History

### Service requirements

- Connect to server

    The server should accept HTTP requests and upgrade them to websocket connections.

- "Login" with username

    A connected client should be able to authenticate with a given username.
    Don't worry about passwords at this point.

- Send Message to another username

    An authenticated connection should be able to send a text message to a given username.
    Messages should be persisted to a database.

- Receive Messages in realtime

    An authenticated connection should receive messages sent to its authenticated username.
    (What happens if multiple connections are authenticated with the same username?)

- Fetch Message History

    Mobile apps go offline and online all the time.
    An authenticated connection should be able to fetch missed messages.

Imports 8 package(s) ΒΆ

  1. github.com/gin-gonic/gin
  2. github.com/gorilla/securecookie
  3. github.com/gorilla/websocket
  4. golang.org/x/crypto/bcrypt
  5. github.com/go-sql-driver/mysql
  6. github.com/rubenv/sql-migrate
  7. gopkg.in/alecthomas/kingpin.v2
  8. github.com/gorilla/sessions