• Stars
    star
    205
  • Rank 190,629 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 15 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JSON-based chat that has web and console clients, and a server

JsChat is a chat system. It has an easy to learn JSON protocol, an ncurses client, a web app, and a server. You can try it right now on jschat.org.

JsChat is similar to IRC, but it’s a fundamentally simpler system.

The web app has lots of interesting features:

  • IRC-like commands: /names, /name new_name (/nick works too), /clear, /lastlog
  • It’s pretty tiny; it’s built with Sinatra and Prototype
  • Auto-linking: pasting an image displays it inline, youtube and vimeo videos will appear as well
  • Last messages are displayed on join: the last 100 messages are displayed, so you don’t feel lost when you join a room
  • Tab completion!

Installation

You can install with rubygems:

gem install jschat

Then run jschat-server and jschat-client to try out the console client locally.

To try out the web client, run jschat-web and visit http://localhost:4567.

Ruby Library Requirements

These gems are required by JsChat:

  • eventmachine
  • ncurses (for the client)
  • json

Usage

  • Run the server with ./server.rb
  • Connect a client with ./client.rb

The web app must be run alongside the server. The web app must be started in production mode:

http/jschat.rb -e production

The web app currently has no database dependencies, it’s a wrapper that links cookies to JsChat server proxies. You can run it on port 80 by configuring Rack or an Apache proxy. I have Apache set up this way on jschat.org.

Configuration Files

These are the default locations of the configuration files. You can override them with --config=PATH:

  • Client: ~/.jschat/config.json
  • Server: /etc/jschat/config.json

The web app will use the same configuration file as the server so it can find out where the server is.

The file format is JSON, like this:

{ "port": 3001 }

Server Configuration Options

{
  "port": integer,
  "ip": "string: IP address to bind to",
  "tmp_files": "string: path to tmp files (including PID file)"
}

Client Commands

  • Change name or identify: /nick name
  • Join a room: /join #room
  • Join a room (alias): /j #room

Protocol Design

The protocol is designed to be as close to executable JSON as possible, so clients and servers are simple to implement.

Look at client.rb JsChat::Protocol to see what I mean.

Hey, this is like Campfire!

I love Campfire and I didn’t intend for JsChat to compete with it. JsChat is just a fun project, it doesn’t offer Campfire’s business-friendly interface, file hosting, transcripts and Basecamp integration.

Credits

JsChat was created by Alex Young for Helicoid. A growing group of friends are helping out:

If you’d like to contribute, send alexyoung a message on GitHub.

More Repositories

1

nodepad

A notepad app written with Node
JavaScript
750
star
2

ircd.js

A Node ircd (IRC daemon)
JavaScript
528
star
3

turing.js

DailyJS's JavaScript framework
JavaScript
309
star
4

ico

JavaScript graph library based on Raphael
JavaScript
223
star
5

nodeinpractice

The source code for the book Node.js in Practice (ISBN: 9781617290930)
JavaScript
198
star
6

dailyjs-backbone-tutorial

JavaScript
182
star
7

nodejsinaction

The Node.js in Action (Manning) code repository
JavaScript
165
star
8

riotjs

JavaScript unit tests.
JavaScript
137
star
9

djsreader

A tutorial app for AngularJS, Yeoman, and some of their friends
JavaScript
101
star
10

usevim

A blog all about Vim
CSS
70
star
11

pop

A static site and blog generator
JavaScript
62
star
12

wingman

A to-do list app that can easily be deployed to Heroku, built with Rails 3, MongoDB, OpenID
JavaScript
60
star
13

javascript-dsl-examples

High-level examples of how to make DSLs in JavaScript
JavaScript
25
star
14

select

A JavaScript database library
JavaScript
24
star
15

zalgo

Ḫ̷̲̫̰̯̭̀̂̑̈ͅĚ̥̖̩̘̱͔͈͈ͬ̚ ̦̦͖̲̀ͦ͂C̜͓̲̹͐̔ͭ̏Oͭ͛͂̋ͭͬͬ͆͏̺͓̰͚͠ͅM̢͉̼̖͍̊̕Ḛ̭̭͗̉̀̆ͬ̐ͪ̒S͉̪͂͌̄
Ruby
23
star
16

dailyjs-survey

A survey for JavaScript programmers
18
star
17

dailyjs-contact-form-tutorial

JavaScript
16
star
18

dystopian_index

Rails plugin for Tokyo Dystopia
Ruby
16
star
19

securetrading-rails

Secure Trading Rails plugin
12
star
20

dailyjs-cloudinary-gallery

DailyJS Cloudinary tutorial
JavaScript
10
star
21

async-testing-tutorial

JavaScript
10
star
22

turing-test.js

DailyJS.com unit test tutorial
JavaScript
9
star
23

dailyjs-heroku-postgres

Heroku PostgreSQL example
JavaScript
9
star
24

stextile

A simple textile parser
JavaScript
9
star
25

jadedown

Combining Jade and Markdown
JavaScript
9
star
26

sirtet

JavaScript
8
star
27

captor

A GUI for Capistrano
Ruby
7
star
28

twitter-scheduler

Schedules posts to Twitter
Ruby
7
star
29

twitter2delicious

Imports links to your Delicious account from Twitter
Ruby
7
star
30

through

Small geolocation web app
Ruby
6
star
31

snake-shoes

A snake game written with Ruby and Shoes
6
star
32

conway-js

Conway's game of life made with Processing.js
JavaScript
5
star
33

closure

A little JavaScript OO and functional library
JavaScript
5
star
34

ssbx

Unified API for single site browsers
JavaScript
5
star
35

stateaware

A rails application that aims to centralise government data collection through APIs and screen scraping
Ruby
5
star
36

Azukilib

A collection of JavaScript classes, images and CSS for building web applications
JavaScript
5
star
37

alexyoung.org

Alex's blog
HTML
5
star
38

fire.js

Processing.js fire example
4
star
39

rsyncdiff

Makes it easier to visualize changes between local and remote stuff
4
star
40

pop-disqus

Pop Disqus plugin
JavaScript
4
star
41

pop-gallery

A gallery for Pop
JavaScript
4
star
42

weather

weather experiments
JavaScript
4
star
43

gobbler-js

4
star
44

http-wizard

An app for making HTTP requests
JavaScript
4
star
45

basecamp-mobile

An open source Rails application that wraps around Basecamp to provide a mobile-friendly interface
Ruby
4
star
46

gallery

A rails sample application used in a Linux Format tutorial
3
star
47

gitlocker

Sinatra application that stores versions of things in Git repositories
Ruby
3
star
48

jsmon

Tiny app that can be used to monitor remote services
Ruby
3
star
49

minesweeper

A basic Swift SpriteKit game for Mac OS
Swift
3
star
50

tunnel-p5r

Tunnel effect written with Ruby Processing
3
star
51

react-create-permitted-elements

Create React elements based on HTML strings
JavaScript
3
star
52

dailyjs-bot

IRC bot for freenode.net #dailyjs
JavaScript
3
star
53

twitterircbot

An IRC bot that allows you to access your twitter accounts from your favourite IRC client
Ruby
3
star
54

growlexample

An Objective-C example on how to use Growl
Objective-C
3
star
55

loom-exceptions-rails-plugin

Add Loom exception reporting to your Rails apps
Ruby
2
star
56

node-unix-slides

Slides about Node and Unix, powered by bash
Shell
2
star
57

gitlocker-client

A client library for Gitlocker, including a Rails ActiveRecord plugin
Ruby
2
star
58

shoes-ball

Bouncing balls examples for Shoes
Ruby
2
star
59

hackerstats

Uses JSON APIs to generate a developer profile
2
star
60

istype.js

JavaScript
2
star
61

gobbler

Displays a real time twitter stream
JavaScript
2
star
62

fire-p5r

A fire algorithm in Ruby Processing
2
star
63

mtail

tail multiple files
JavaScript
2
star
64

depwhack

Compares dependencies between a local and remote rails project
1
star
65

jackdaw

Clojure GUI apps
Clojure
1
star
66

notes

Programming notes
1
star
67

cojor

Colourful strings in Clojure
1
star
68

xpcomcore

XPCOM "Core" library emulating many of the features available in the standard Ruby one.
JavaScript
1
star
69

alexyoung.github.com

A page for me
1
star
70

plants.js

A Node test runner
JavaScript
1
star
71

kite

An experiment from back in 2007 to make a mobile search site
Ruby
1
star
72

helicoid_blog

Helicoid's Blog
Ruby
1
star
73

pop-pages

Pop blog
JavaScript
1
star
74

tiktrac-widget

A widget for Tiktrac.com
JavaScript
1
star