This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Welcome to MoTown

Installation (for dev)

This is all in the MoTown directory:

  1. Install Redis
  2. Install and start MySQL
  3. Create a database:
$     > mysql
mysql > create database motown;
mysql > create user motown;
mysql > grant all on motown.* to 'motown'@'localhost' identified by 'motown';
mysql > exit
  1. Create tables:
$> cat config/database.sql | mysql -umotown -p motown
  1. Install node packages:
$ > cd 
$ > npm install
  1. Start MoTown Runtime:
$ > NODE_ENV=development ./app.js 

Some Notes on Development:

  • Each component can be run separately, have a look in app.js for a listing.
  • It's polite to change the IRC nick your dev bot uses, see config/development.json (motown-{your real nick} probably makes sense)


Sometimes the webserver when in dev mode will be unresponsive from the first request. It seems to be a problem with the passport library and stale sessions.


Database Notes

  • uses mysql
  • creates X tables: networks, ...

MoTown Runtime

MoTown consists of four primary services. Each of these services can be run independantly as they communicate through a combination of Redis queues, published Redis events and MySQL.

IRC Daemon

The IRC Daemon connects to tracks the NICK changes of registered MoTown users and provides WHOIS lookups for other services.


The IRC Daemon listens on a couple queues in Redis to service requests.

irc:whois (nick, responseQueue)

This performs a whois lookup on and returns the results to the specified Redis queue.

redis> lpush irc:whois "[\"wex\", \"irc-resp:1\"]"

redis> lpop irc-resp:1
"{\"nick\":\"wex\",\"user\":\"simon\",\"host\":\"\",\"realname\":\"Simon Wex\",\"channels\":[\"#motown\",\"#b2g\",\"#vancouver\",\"#webdev\",\"#webpagemaker\",\"#socialdev\",\"#identity\",\"#learning\",\"#openwebapps\",\"#labs\"],\"server\":\"\",\"serverinfo\":\"Phoenix, Arizona, USA\",\"idle\":\"2763\"}"
irc:updateUserStatusFromId (, responseQueue)

Updates mysql networks table with the user's current membership and status.

The id of the user in the MySQL users table.

redis> lpush irc:updateUserStatusFromId "[13, \"irc-resp:2\"]"
(integer) 1

redis> lpop irc-resp:2
mysql> select channel, status from networks where user_id = 13;
| channel       | status |
| #b2g          | NULL   |
| #identity     | NULL   |
| #labs         | NULL   |
| #learning     | NULL   |
| #motown       | NULL   |
| #openwebapps  | NULL   |
| #socialdev    | NULL   |
| #vancouver    | NULL   |
| #webdev       | NULL   |
| #webpagemaker | NULL   |

RSS Daemon

This daemon scrapes specified RSS and Atom feeds and generates "stories" which are put on the "stories" Redis queue for the Serializer to pick up.


Definitely accepting name suggestions for this one. The Serializer takes stories added to a Redis queue, saves them to MySQL and publishes a "stories" event to redis. This is currently subscribed to by app/http/socket.js which communicates with the social worker.


This hosts the express web engine that provides content for the website and social sidebar as well as the socket server.


Now see issues: