Giter Site home page Giter Site logo

hiattp / express3-mongodb-bootstrap-demo Goto Github PK

View Code? Open in Web Editor NEW
83.0 11.0 54.0 2.09 MB

This is a simple boiler-plate MVC Node.js app with authentication and user account management to be used as a starting point for new apps.

JavaScript 99.79% CSS 0.21%

express3-mongodb-bootstrap-demo's Introduction

Node.js (Express3 MongoDB Passport Bootstrap) Demo

This is a simple boiler-plate MVC Node.js app with authentication and user account management to be used as a starting point for new apps.

Install and Run

NOTE: You need to have Node.js and MongoDB installed and running.

git clone https://github.com/hiattp/express3-mongodb-bootstrap-demo.git
cd express3-mongodb-bootstrap-demo/
npm install
mv config.example.js config.js
node app.js*

If you receive an error about bcrypt_lib, then run npm install bcrypt.

Then visit http://localhost:3000/.

Features

  1. Node.js Framework (Express 3)
  2. MongoDB (using the Mongoose API)
  3. Authentication (using Passport)
  4. Frontend Templating (Twitter Bootstrap)
  5. jQuery
  6. Mailer (using Mandrill)
  7. Simple MVC Design
  8. User CRUD & Password Recovery
  9. Basic Error Handling
  10. Form Validation

License

(The MIT License)

Copyright (c) 2013 Paul Hiatt <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

express3-mongodb-bootstrap-demo's People

Contributors

askhogan avatar hiattp 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express3-mongodb-bootstrap-demo's Issues

Can't install bcrypt

when installing bcrypt I receive the error messages below.

$ npm install bcrypt

> [email protected] install /home/hscho/codes/web/express3-mongodb-bootstrap-demo/node_modules/bcrypt
> node-gyp rebuild

make: Entering directory '/home/hscho/codes/web/express3-mongodb-bootstrap-demo/node_modules/bcrypt/build'
  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: In destructor ‘virtual {anonymous}::baton_base::~baton_base()’:
../src/bcrypt_node.cc:54:18: error: ‘class v8::Persistent<v8::Function>’ has no member named ‘Dispose’
         callback.Dispose();
                  ^
../src/bcrypt_node.cc: At global scope:
../src/bcrypt_node.cc:128:19: error: variable or field ‘GenSaltAsync’ declared void
 void GenSaltAsync(uv_work_t* req) {
                   ^
../src/bcrypt_node.cc:128:19: error: ‘uv_work_t’ was not declared in this scope
../src/bcrypt_node.cc:128:30: error: ‘req’ was not declared in this scope
 void GenSaltAsync(uv_work_t* req) {
                              ^
../src/bcrypt_node.cc:137:24: error: variable or field ‘GenSaltAsyncAfter’ declared void
 void GenSaltAsyncAfter(uv_work_t* req) {
                        ^
../src/bcrypt_node.cc:137:24: error: ‘uv_work_t’ was not declared in this scope
../src/bcrypt_node.cc:137:35: error: ‘req’ was not declared in this scope
 void GenSaltAsyncAfter(uv_work_t* req) {
                                   ^
../src/bcrypt_node.cc:429:30: error: expected ‘}’ at end of input
 NODE_MODULE(bcrypt_lib, init);
                              ^
bcrypt_lib.target.mk:90: recipe for target 'Release/obj.target/bcrypt_lib/src/bcrypt_node.o' failed
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory '/home/hscho/codes/web/express3-mongodb-bootstrap-demo/node_modules/bcrypt/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/hscho/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:88:13)
gyp ERR! stack     at ChildProcess.emit (events.js:173:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Linux 4.2.0-16-generic
gyp ERR! command "/home/hscho/local/bin/node" "/home/hscho/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/hscho/codes/web/express3-mongodb-bootstrap-demo/node_modules/bcrypt
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
- [email protected] node_modules/bcrypt/node_modules/bindings
npm ERR! Linux 4.2.0-16-generic
npm ERR! argv "/home/hscho/local/bin/node" "/home/hscho/local/bin/npm" "install" "bcrypt"
npm ERR! node v5.2.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/hscho/codes/web/express3-mongodb-bootstrap-demo/npm-debug.log

compiling globally with "npm install -g bcrypt" works...

$

Initial Users

What is the best way to load a set of initial users if you didn't want to go through register for each one?

Because of crypt and salt I can't just insert them into the DB, I could pregenerate all the passwords but I was hoping to do password auditing and have a predetermined list of passwords isn't good for testing.

Failed at first run

After installing all files I run the application and got an error like this:

I'm am new to node.js and perhaps it is a simple problem but I can't cope with it. I use Win XP now.


C:\work2\express3-mongodb-bootstrap-demo-master>node app.js

C:\work2\express3-mongodb-bootstrap-demo-master\node_modules\bcrypt\node_modules
\bindings\bindings.js:79
        throw e
              ^
Error: no errorC:\work2\express3-mongodb-bootstrap-demo-master\node_modules\bcry
pt\build\Release\bcrypt_lib.node
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at bindings (C:\work2\express3-mongodb-bootstrap-demo-master\node_modules\bc
rypt\node_modules\bindings\bindings.js:74:15)
    at Object. (C:\work2\express3-mongodb-bootstrap-demo-master\node_
modules\bcrypt\bcrypt.js:1:97)
    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 Module.require (module.js:364:17)
    at require (module.js:380:17)


C:\work2\express3-mongodb-bootstrap-demo-master>npm ls
[email protected] C:\work2\express3-mongodb-bootstrap-demo-master
+¦T [email protected]
- L¦¦ [email protected]
+¦¦ [email protected]
+¦¦ [email protected]
+¦¦ [email protected]
+¦T [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- +¦T [email protected]
- - +¦¦ [email protected]
- - +¦¦ [email protected]
- - +¦¦ [email protected]
- - +¦¦ [email protected]
- - L¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- L¦T [email protected]
-   L¦¦ [email protected]
+¦T [email protected]
- L¦T [email protected]
-   +¦T [email protected]
-   - +¦¦ [email protected]
-   - L¦T [email protected]
-   -   +¦¦ [email protected]
-   -   L¦T [email protected]
-   -     L¦¦ [email protected]
-   +¦T [email protected]
-   - L¦¦ [email protected]
-   L¦T [email protected]
-     +¦¦ [email protected]
-     L¦¦ [email protected]
+¦T [email protected]
- L¦¦ [email protected]
+¦T [email protected]
- +¦¦ [email protected]
- +¦T [email protected]
- - L¦¦ [email protected]
- +¦¦ [email protected]
- +¦T [email protected]
- - L¦¦ [email protected]
- +¦¦ [email protected]
- +¦¦ [email protected]
- L¦¦ [email protected]
+¦T [email protected]
- L¦¦ [email protected]
L¦T [email protected]
  L¦¦ [email protected]

sudo npm install bcrypt gives error

npm http 304 https://registry.npmjs.org/bindings/1.0.0

[email protected] install /home/krishna/test/express3-mongodb-bootstrap-demo/node_modules/bcrypt
node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack at Object.self.commands.(anonymous function) as install
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:694:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:104:17)
gyp ERR! stack at maybeClose (child_process.js:808:16)
gyp ERR! stack at Socket. (child_process.js:1025:11)
gyp ERR! stack at Socket.EventEmitter.emit (events.js:101:17)
gyp ERR! stack at Pipe.close (net.js:459:12)
gyp ERR! System Linux 3.8.0-33-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/krishna/test/express3-mongodb-bootstrap-demo/node_modules/bcrypt
gyp ERR! node -v v0.11.10-pre
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.0-33-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! cwd /home/krishna/test/express3-mongodb-bootstrap-demo
npm ERR! node -v v0.11.10-pre
npm ERR! npm -v 1.4.6
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/krishna/test/express3-mongodb-bootstrap-demo/npm-debug.log
npm ERR! not ok code 0

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.