Overview

HTTPS SSH

MonoChat

MonoChat is an upcoming, work-in-progress web-based distributed IRC client.

Project's homepage is on reddit: http://www.reddit.com/r/MonoChat

Installation

  1. MonoChat is built on Node.js. Download and install the appropriate release of Node.js for your platform.
  2. Download the latest release of MonoChat (zip | tarball) and extract it to wherever you plan to run it from.
  3. Run npm install in the MonoChat program directory to download and install the necessary Node.js modules.
  4. MonoChat comes with database drivers for MySQL and SQLite. Postgres and MariaDB are also supported but the driver modules must be compiled. See the Database Drivers section below to decide which driver is best for you.
  5. Write your config file (see Config File section below).
  6. Run MonoChat with the command node monochat.js

Database Drivers

  • MySQL
    • MySQL is an extraordinarily popular database server. In order to use this database, you must have access to a running MySQL server with a database created on it for MonoChat.
  • SQLite
    • SQLite is a unique type of database in that it runs completely inside the application. SQLite databases are saved in plain files and no special database server is required. If you're not sure, this is probably the best choice.
  • Postgres
    • Postgres is a popular database server. In order to use this database, you must have access to a running PostgreSQL server with a database created on it for MonoChat.
  • MariaDB
    • MariaDB is a popular database server based on MySQL. In order to use this database, you must have access to a running MariaDB server with a database created on it for MonoChat.

Postgres and MariaDB database drivers require compilation and as such are not included with MonoChat. In order to build these modules, you require:

  • On Unix:
    • python (v2.7 recommended, v3.x.x is not supported)
    • make
    • A proper C/C++ compiler toolchain, like GCC
  • On Windows:
    • Python (v2.7.3 recommended, v3.x.x is not supported)
    • Windows XP/Vista/7:
      • Microsoft Visual Studio C++ 2010 (Express version works well)
      • For 64-bit builds of node and native modules you will also need the Windows 7 64-bit SDK
        • If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.
      • If you get errors that the 64-bit compilers are not installed you may also need the compiler update for the Windows SDK 7.1
    • Windows 7/8:
      • Microsoft Visual Studio C++ 2012 for Windows Desktop (Express version works well)

Once you have these prerequisites, you can install your desired driver using these commands:

  • Postgres: npm install pg@~2.0.0
  • MariaDB: npm install mariasql@0.1.x

Config File

The configuration file should be named config.json and placed inside the root directory of the MonoChat program. Here is a sample file:

{
    "database": {
        "type": "mysql",
        "host": "localhost",
        "username": "root",
        "password": "",
        "name": "monochat"
    },

    "http": {
        "security": {
            "cert": "cert.pem",
            "key": "key.pem"
        },

        "port": 443,

        "redirect": {
            "port": 80,
            "host": "https://monochat.example.com"
        }
    }
}
  • database - The database section defines how MonoChat will connect to its database
    • type - One of mysql, sqlite, postgres, mariadb
    • host - The host where the SQL server is running (not necessary for SQLite)
    • username - The username to connect to the database with (not necessary for SQLite)
    • password - The password to use to connect to the database (not necessary for SQLite)
    • name - The name of the database (for SQLite, this will be the filename of the .sqlite file)
  • http - The http section defines how the MonoChat web interface will run
    • security - If this section is defined, MonoChat will create an HTTPS server
      • cert - Path to the certificate file (or just the filename if it's in the MonoChat program directory) in PEM format
      • key - Path to the private key file (or just the filename if it's in the MonoChat program directory) in PEM format
    • port - The port that MonoChat's HTTP(S) server will bind to
    • redirect - Only relevant if you're using security, specifying this section will open a second (plain HTTP) server on another port which will serve as a redirect to the secure one
      • port - The port to bind the redirect HTTP server to
      • host - The host domain where requests will be redirected to, including https:// and the port number if applicable, but without a trailing slash