This is an application that makes use of Couchbase, Express Framework, Angular 2 with TypeScript, and Node.js (CEAN) for real-time chat with the assistance of Socket.io.
npm install web-chat
npm install
`
This will install all dependencies as defined in the package.json file.
$3
This project requires Couchbase 4.0 or higher in order to function because it makes use of the N1QL query language. With Couchbase Server installed, create a new bucket called web-chat or whatever you've named it in your config.json file.
We're not done yet. In order to use N1QL queries in your application you must create a primary index on your bucket. This can be done by using the Couchbase Query Client (CBQ).
On Mac, run the following to launch CBQ:
`
./Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/cbq
`
On Windows, run the following to launch CBQ:
`
C:/Program Files/Couchbase/Server/bin/cbq.exe
`
With CBQ running, create an index like so:
`
CREATE PRIMARY INDEX ON web-chat USING GSI;
`
Your database is now ready for use.
Testing
With all dependencies installed and Couchbase Server configured, run the following from your Command Prompt or Terminal:
`
node app.js
``