Flossy way to build a user registration app/component with Express, Redis and Stylus. It's also a decent starting point for any Express app.
Pull request Compare This branch is 18 commits behind joemccann:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
node_modules
public
utils
views
.gitignore
README.md
app.js
app.json

README.md

Juke

Flossy way to build a user registration app/component with Express, Redis and Stylus. It's also a decent starting point for any Express app.

Requirements

  • Redis
  • Node.js 0.4.11+
    • Express
    • EJS
    • Redis
    • Stylus
    • Smoosh
    • Colors
    • Nodemailer
    • Node-Password-Hash
  • Google Apps Account/SMTP Access (or your own SMTP server)

How-To

Make sure Redis is installed and running on the server.

wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz
tar xzf redis-2.2.12.tar.gz
cd redis-2.2.12
make
sudo make install

To start the redis-server type:

redis-server

This will use default config. In order to specify a config file use redis-server /path/to/redis.conf'

To enter the redis CLI type:

redis-cli

Now you can GET and SET keys and values. To remove all keys type FLUSHALL.


Grab the necessary modules (this is a shitty hack, but works for now):

npm install express stylus ejs redis password-hash colors nodemailer && sudo npm install smoosh -g

To fire up your Juke joint, type:

node app.js

By default, the app.json file has configuration options set for debugging, on localhost at port 5050. This can all be configured by simply changing the values.

If you want to change to localhost but on a production port like 80, change

"DEBUG"

to

false

Before you restart the app, you'll need to compress/concat the files with smoosh:

smoosh -c app.json

This will create you minified and concatenated CSS and JS files.


Now, restart the app, node app.js, and navigate to http://localhost/.

If you want to actually run this on a production server there are two things you should do. First, compress/concat with smoosh:

smoosh -c app.json

Next, change the "LOCALHOST" value to false and update your CDN values and the verification link to your live site URLs.

For email configuration, open the email.js file in the utils directory.

There is a configuration hash there. Update it with your credentials.

Redis Keys

Key | Value | Comment


joe | hashedPassw0rdHere!11 | username and hashed password

joe@RAD.com | joe | email address and associated username

joe:isVerified | (un)verified | account verification check

adfs8922dfsa2300 | joe | random, one-time key for account verification

LICENSE

MIT

TODO

  • Create package.json
  • Validate incoming inputs.
  • Lots moar (see the inline code comments)

CREDITS

Background pattern for the <body> tag: dinpattern.com