UUChat data store

UUChat builds on Sequelize, a promise-based ORM for Node.js. With sequelize, UUChat can be stored in sqlite3, MySQL, postgresql and Microsoft SQL Server. Sqlite3 is the default database for UUChat.

sqlite3

UUChat default run with sqlite3. Sqlite3 installation is done after installing uuchat depended moudles:

$npm i

If node module of sqlite3 is not installed by default, run:

$npm i sqlite3

Defalut Sqlite database file is content/data/uuchat.db
Database setting in src/config.json:

  "database": {
    "dialect": "sqlite",
    "storage": "content/data/uuchat.db"
  }

MySQL

As many applications depend on MySQL as their database, you cant run uuchat with existing MySQL database. If you want to have UUChat configured with MySQL database, you can reconfigure the default settings in the config.json file.

Install mysql module:

$npm i --save mysql2

Change database setting in src/config.json:

"database":{
    "host": "127.0.0.1",
    "dialect": "mysql",
    "username": "root",
    "password": "",
    "database": "uuchat",
    "pool":{
      "max": 5,
      "min": 0,
      "idle": 10000
    }
}

Remember to replace the database host, database-user, database-user-password and database-name with your settings.

session store

Session default store in your database. If you have more than 5 online customers, we suggest you use redis for session store with high performance.

Install redis module:

$npm i --save connect-redis

Modify src/config.json, add the following section:

"redis": {
   "host": "127.0.0.1",
   "port": 6379,
   "ttl": 86400,
   "db": 0
 }

Browser data store

Web page data store in browser localstorage. You can find it in chrome devtools:

>localStorage
Show Comments