Giter VIP home page Giter VIP logo

rethinkdb-example-nodejs-chat's Introduction

What is it

A fork of the node.js chat app by @orkj using socket.io, rethinkdb, passport and bcrypt on an express app.

Note:

This is an example application. Even though it shows an example of how to integrate Passport and bcrypt, you shouldn't assume it is free from security vulnerabilities. Have the code audited carefully by an expert before you put anything modeled on it into production.

Complete stack

Installation

git clone [email protected]:rethinkdb/rethinkdb-example-nodejs-chat.git
cd rethinkdb-example-nodejs-chat && npm install

Note: If you don't have RethinkDB installed, you can follow these instructions to get it up and running.

Running the application

Running the app is as simple as:

node app

Then open a browser: http://localhost:8000.

Note: If you want to override the default RethinkDB connection details, you can specify them as environment variables:

  • RDB_HOST: the RethinkDB host (default: localhost)
  • RDB_PORT: the port (default 28015)
  • RDB_DB: the app database (default: chat)

If you want to enable logging for the database queries (see debug docs for more configuration options:

DEBUG=rdb:* node app

License

This demo application is licensed under the MIT license: http://opensource.org/licenses/mit-license.php

rethinkdb-example-nodejs-chat's People

Contributors

al3xandru avatar chrisabrams avatar coffeemug avatar danielmewes avatar deontologician avatar dependabot[bot] avatar gabor-boros avatar mchail avatar mglukhovsky avatar neumino avatar ralphtheninja avatar vansteki avatar veggiemonk avatar wonglok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rethinkdb-example-nodejs-chat's Issues

No more rows in the cursor error

> [email protected] start /Users/dev/mydockerbuild/rethinkdb-example-nodejs-chat
> node app

   info  - socket.io started
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
RqlDriverError: No more rows in the cursor.
node -v // v.0.12.7``
sw_vers -productVersion // 1.0.10.4
docker -v // DOcker version 1.8.2, build 0a8c2e3

Can't run app

I am unable to run this app on Win10 and node v7.3.0. npm install output

C:\Users\ziemniak\Documents\GitHub\rethinkdb-example-nodejs-chat\node_modules\socket.io\lib\store.js:35
Store.prototype.__proto__ = EventEmitter.prototype;
                                        ^

TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (C:\Users\ziemniak\Documents\GitHub\rethinkdb-example-nodejs-chat\node_modules\socket.io\lib\store.js:35:41)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\ziemniak\Documents\GitHub\rethinkdb-example-nodejs-chat\node_modules\socket.io\lib\manager.js:16:13)
    at Module._compile (module.js:571:32)```

Unable to run the app

Just followed the instructions on the readme.

cloned and ran npm install

running node app gives:

 ✘ shdsouza@L3011  ~/proj/_rethinkdb/rethinkdb-example-nodejs-chat   master  node app
   info  - socket.io started
(node:41118) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.

/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/async.js:43
        fn = function () { throw arg; };
                           ^
AssertionError: ReqlDriverError: Could not connect to localhost:28015.
connect ECONNREFUSED 127.0.0.1:28015
    at /Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/lib/db.js:36:12
    at tryCatcher (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/util.js:26:23)
    at Promise.errorAdapter (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/nodeify.js:36:34)
    at Promise._settlePromiseAt (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/promise.js:579:21)
    at Promise._settlePromises (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/promise.js:697:14)
    at Async._drainQueue (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/Users/shdsouza/proj/_rethinkdb/rethinkdb-example-nodejs-chat/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:566:20)
    at tryOnImmediate (timers.js:546:5)
    at processImmediate [as _immediateCallback] (timers.js:525:5)
 ✘ shdsouza@L3011  ~/proj/_rethinkdb/rethinkdb-example-nodejs-chat   master 

App does not start

Hi,
when I clone , npm install , and start the app I get :

AssertionError: RqlDriverError: Server dropped connection with message: "ERROR: The PROTOBUF client protocol is no longer supported"

How to fix , Is there somewhere a newer example?

nextTick() used 'for effect' - is this necessary, if so, why?

https://github.com/rethinkdb/rethinkdb-example-nodejs-chat/blob/master/app.js#L48 has

passport.use(new local(
  function(username, password, done) {
    // asynchronous verification, for effect...
    process.nextTick(function () {

Is the nextTick() actually necessary, or is it 'for effect'?

  • If it's necessary, why is it necessary? The comment is very vague.
  • If it's not necessary, should the nextTick be removed?

Thanks for taking the time to answer this - I understand what nextTick() does, but it's not apparent why it's being used here.

Project not starting up

I have tried entering node app
on the directory, but it does not work. This is what I got:
"node app
info - socket.io started

/home/me/node/app.js:17
app.configure(function() {
^
TypeError: Object function (req, res, next) {
app.handle(req, res, next);
} has no method 'configure'
at Object. (/home/me/node/app.js:17:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
"

Move to using changefeeds

This example should be updated to take advantage of changefeeds (as well as use Express v4, as noted in #9).

npm install failing...?

~/g/rethinkdb-example-nodejs-chat (master) $ sw_vers -productVersion 
10.10.3
~/g/rethinkdb-example-nodejs-chat (master) $ node --version
v0.12.4
~/g/rethinkdb-example-nodejs-chat (master) $ npm install
-
> [email protected] install /Users/tony/git/rethinkdb-example-nodejs-chat/node_modules/bcrypt
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
../src/bcrypt_node.cc:118:18: error: no member named 'Dispose' in 'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >'
        callback.Dispose();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.