Git Product home page Git Product logo

express-passport-app's Introduction

Express 4.x application with Passport authentication

Build Status Coverage Status Dependency Status devDependency Status

Introduction:

This project will give you a complete scaffolding/boilerplate of the node/express stack along with social logins through passport and email verification through mandrill. It uses mongodb for database models and redis for session storage. Fork at will! :)

express passport application

Built with:

Testing:

Dependencies:

Social logins supported:

Install dependencies (some might need to use sudo for various reasons):

  • brew/apt-get install nodejs
  • brew/apt-get install redis
  • brew/apt-get install mongodb
  • npm install -g mocha
  • npm install -g gulp
  • npm install

Create an application on both Facebook, Google+ and Instagram and point the callbacks to (respectively):

  • http://localhost:3000/auth/facebook/callback
  • http://localhost:3000/auth/google/callback
  • http://localhost:3000/auth/instagram/callback

Email verification via Mandrill:

Environment variables:

  • PORT - Port exposed by this component.
  • example: 3000
  • SERVICE_NAME - The name of your fantastic service/platform!
  • example: Express Passport Application
  • DEBUG - Debug output (* for all) (optional)
  • example: *
  • NODE_ENV - Environment ('development', 'staging', 'production')
  • example: development
  • CLIENT_API_PATH - Path to the client REST api (relative)
  • example: /api
  • CLIENT_DOMAIN - Server domain
  • example: localhost or someapp.herokuapp.com
  • MONGO_URL - MongoDB url (including authentication)
  • example: mongodb://user:pass@localhost:27017/mydatabase
  • REDIS_URL - Redis url (including authentication)
  • example: redis://user:pass@localhost:6379
  • REDIS_DB - Redis database number (0-15)
  • example: 1 - defaults to 0
  • REDIS_SESSION_PREFIX - Prefix for redis session entries (optional)
  • example: sess:
  • APPSECRET - Application session secret
  • example: sOmeCrAzYhAsH894372
  • SESSION_KEY - Application session secret (optional)
  • example: express.sid (defaults to connect.sid)
  • FACEBOOK_CLIENT_ID - Facebook application client id
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • FACEBOOK_CLIENT_SECRET - Facebook application client secret
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • FACEBOOK_CALLBACK_URL - Facebook application callback url
  • example: http://yourdomain.com/auth/facebook/callback
  • GOOGLE_CLIENT_ID - Google application client id
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • GOOGLE_CLIENT_SECRET - Google application client secret
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • GOOGLE_CALLBACK_URL - Google application callback url
  • example: http://yourdomain.com/auth/google/callback
  • INSTAGRAM_CLIENT_ID - Instagram application client id
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • INSTAGRAM_CLIENT_SECRET - Instagram application client secret
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • INSTAGRAM_CALLBACK_URL - Instagram application callback url
  • example: http://yourdomain.com/auth/instagram/callback
  • MANDRILL_API_KEY - Mandrill API key
  • example: abcdefghijklmnopqrstuvxyz1234567890
  • MANDRILL_SENDER - Mandrill email sender address
  • example: John Doe <[email protected]>
  • EMAIL_VERIFICATION_ROUTE - Email verification route
  • example: http://yourdomain.com/auth/local/verify

Run tests:

  • npm test

Run the application:

  • set environment variables
  • gulp
  • alternatively create a shellscript for the above (for development)
  • navigate your browser to http://localhost:PORT

Development shellscript example:

#!/bin/sh
export PORT=3000 \
export SERVICE_NAME="Express Passport Application" \
export DEBUG="*,-engine:polling" \
export NODE_ENV="development" \
export CLIENT_DOMAIN="localhost" \
export CLIENT_API_PATH="/api" \
export MONGO_URL="mongodb://localhost/express-passport-app" \
export REDIS_URL="redis://localhost:6379" \
export REDIS_DB=0 \
export REDIS_SESSION_PREFIX="sess:" \
export APPSECRET="somecrazyhash" \
export SESSION_KEY="express.sid" \
export FACEBOOK_CLIENT_ID="000000000000000" \
export FACEBOOK_CLIENT_SECRET="000000000000000000000000000000000000000000000" \
export FACEBOOK_CALLBACK_URL="http://localhost:3000/auth/facebook/callback" \
export GOOGLE_CLIENT_ID="000000000000000000000000000000.apps.googleusercontent.com" \
export GOOGLE_CLIENT_SECRET="000000000000000000000000000000" \
export GOOGLE_CALLBACK_URL="http://localhost:3000/auth/google/callback" \
export INSTAGRAM_CLIENT_ID="000000000000000000000000000000" \
export INSTAGRAM_CLIENT_SECRET="000000000000000000000000000000" \
export INSTAGRAM_CALLBACK_URL="http://localhost:3000/auth/instagram/callback" \
export MANDRILL_API_KEY="000000000000000000000000000000" \
export MANDRILL_SENDER="Express Passport Application <[email protected]>" \
export EMAIL_VERIFICATION_ROUTE="http://localhost:3000/auth/local/verify" \

gulp develop

TODO

  • upgrade to socket.io 1.x
  • continuous integration with travis
  • add test coverage with coveralls.io
  • add unit test framework
  • look into using jest for testing
  • add complete test suite
  • replace jquery with react or mithril
  • build simple client side example with the selected framework
  • use material ui instead of bootstrap

express-passport-app's People

Contributors

eiriklv 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

express-passport-app's Issues

Error on npm install

npm ERR! [email protected] install: node ./build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node ./build.js'.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.

Duplicate flash messages

The repeating flash messages sometimes duplicates or hangs when using the is-verified middleware.

Unable to sign up / login

When trying to login or signup i get the error:

Error: Cannot find module 'fibers'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.renderComponentToStringWithAsyncState (/Users/freeslugs/Desktop/express-passport-app/node_modules/react-async/index.js:73:17)
    at module.exports (/Users/freeslugs/Desktop/express-passport-app/helpers/react/render-markup-to-string.js:19:16)
    at Stream._generator (/Users/freeslugs/Desktop/express-passport-app/node_modules/highland/lib/index.js:3671:15)
    at Stream._runGenerator (/Users/freeslugs/Desktop/express-passport-app/node_modules/highland/lib/index.js:870:10)
    at Stream.resume (/Users/freeslugs/Desktop/express-passport-app/node_modules/highland/lib/index.js:735:22)
    at Stream._checkBackPressure (/Users/freeslugs/Desktop/express-passport-app/node_modules/highland/lib/index.js:637:17)

I tried installing fibers, npm install fibers but that gives an error
and npm install -g fibers succeeds, but I still get the fibers error.

Refresh design

Create a new design with either bootstrap or foundation

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.