💬 A simple setup micro-forum built in Node.js with Express and MongoDB.
Switch branches/tags
feature/locale-pt-br feature/notifications greenkeeper/backbone.marionette-3.4.3 greenkeeper/backbone.marionette-3.4.4 greenkeeper/backbone.marionette-3.5.0 greenkeeper/backbone.marionette-3.5.1 greenkeeper/backbone.marionette-4.0.0 greenkeeper/body-parser-1.18.0 greenkeeper/body-parser-1.18.1 greenkeeper/body-parser-1.18.2 greenkeeper/body-parser-1.18.3 greenkeeper/cache-manager-2.5.0 greenkeeper/cache-manager-2.6.0 greenkeeper/cache-manager-2.7.0 greenkeeper/cache-manager-2.8.0 greenkeeper/cache-manager-2.9.0 greenkeeper/eslint-5.0.0 greenkeeper/eslint-5.0.1 greenkeeper/express-5.0.0-alpha.6 greenkeeper/express-hbs-2.0.0 greenkeeper/express-session-1.15.6 greenkeeper/handlebars-4.0.11 greenkeeper/jquery-3.3.1 greenkeeper/latest-version-4.0.0 greenkeeper/le_node-1.8.0 greenkeeper/lusca-1.5.2 greenkeeper/lusca-1.6.0 greenkeeper/lusca-1.6.1 greenkeeper/markdown-it-8.4.1 greenkeeper/markdown-it-8.4.2 greenkeeper/mocha-4.0.0 greenkeeper/mocha-4.0.1 greenkeeper/mocha-4.1.0 greenkeeper/mocha-5.0.0 greenkeeper/mocha-5.0.1 greenkeeper/mocha-5.0.2 greenkeeper/mocha-5.0.3 greenkeeper/mocha-5.0.4 greenkeeper/mocha-5.0.5 greenkeeper/mocha-5.1.0 greenkeeper/mocha-5.1.1 greenkeeper/mocha-5.2.0 greenkeeper/moment-2.19.0 greenkeeper/moment-2.19.1 greenkeeper/moment-2.19.2 greenkeeper/moment-2.19.3 greenkeeper/moment-2.19.4 greenkeeper/moment-2.20.0 greenkeeper/moment-2.20.1 greenkeeper/moment-2.21.0 greenkeeper/moment-2.22.0 greenkeeper/moment-2.22.1 greenkeeper/moment-2.22.2 greenkeeper/mongoose-4.11.9 greenkeeper/mongoose-4.11.10 greenkeeper/mongoose-4.11.11 greenkeeper/mongoose-4.11.12 greenkeeper/mongoose-4.11.13 greenkeeper/mongoose-4.11.14 greenkeeper/mongoose-4.12.0 greenkeeper/mongoose-4.12.1 greenkeeper/mongoose-4.12.2 greenkeeper/mongoose-4.12.3 greenkeeper/mongoose-4.12.4 greenkeeper/mongoose-4.12.5 greenkeeper/mongoose-4.12.6 greenkeeper/mongoose-4.13.0 greenkeeper/mongoose-4.13.1 greenkeeper/mongoose-4.13.2 greenkeeper/mongoose-4.13.3 greenkeeper/mongoose-4.13.4 greenkeeper/mongoose-4.13.5 greenkeeper/mongoose-4.13.6 greenkeeper/mongoose-4.13.7 greenkeeper/mongoose-4.13.8 greenkeeper/mongoose-5.0.0-rc0 greenkeeper/mongoose-5.0.0-rc1 greenkeeper/mongoose-5.0.0-rc2 greenkeeper/mongoose-5.0.0 greenkeeper/mongoose-5.0.1 greenkeeper/mongoose-5.0.2 greenkeeper/mongoose-5.0.3 greenkeeper/mongoose-5.0.4 greenkeeper/mongoose-5.0.5 greenkeeper/mongoose-5.0.6 greenkeeper/mongoose-5.0.7 greenkeeper/mongoose-5.0.8 greenkeeper/mongoose-5.0.9 greenkeeper/mongoose-5.0.10 greenkeeper/mongoose-5.0.11 greenkeeper/mongoose-5.0.12 greenkeeper/mongoose-5.0.13 greenkeeper/mongoose-5.0.14 greenkeeper/mongoose-5.0.15 greenkeeper/mongoose-5.0.16 greenkeeper/mongoose-5.0.17 greenkeeper/mongoose-5.0.18 greenkeeper/mongoose-5.1.0 greenkeeper/mongoose-5.1.1 greenkeeper/mongoose-5.1.2 greenkeeper/mongoose-5.1.3 greenkeeper/mongoose-5.1.4 greenkeeper/mongoose-5.1.5 greenkeeper/mongoose-5.1.6 greenkeeper/mongoose-5.1.7 greenkeeper/mongoose-5.1.8 greenkeeper/mongoose-5.2.0 greenkeeper/mongoose-5.2.1 greenkeeper/mongoose-5.2.2 greenkeeper/mongoose-5.2.3 greenkeeper/mongoose-5.2.4 greenkeeper/mongoose-5.2.5 greenkeeper/mongoose-5.2.6 greenkeeper/mongoose-5.2.7 greenkeeper/mongoose-5.2.8 greenkeeper/mongoose-5.2.9 greenkeeper/mongoose-5.2.10 greenkeeper/mongoose-5.2.11 greenkeeper/mongoose-5.2.12 greenkeeper/mongoose-5.2.13 greenkeeper/mongoose-5.2.14 greenkeeper/mongoose-5.2.15 greenkeeper/mongoose-5.2.16 greenkeeper/mongoose-5.2.17 greenkeeper/mongoose-5.2.18 greenkeeper/mongoose-5.3.0 greenkeeper/mongoose-5.3.1 greenkeeper/mongoose-5.3.2 greenkeeper/mongoose-5.3.3 greenkeeper/mongoose-5.3.4 greenkeeper/mongoose-5.3.5 greenkeeper/mongoose-5.3.6 greenkeeper/mongoose-5.3.7 greenkeeper/mongoose-5.3.8 greenkeeper/mongoose-5.3.9 greenkeeper/mongoose-5.3.10 greenkeeper/mongoose-5.3.11 greenkeeper/mongoose-5.3.12 greenkeeper/mongoose-5.3.13 greenkeeper/mongoose-5.3.14 greenkeeper/mongoose-5.3.15 greenkeeper/mongoose-5.3.16 greenkeeper/mongoose-5.4.0 greenkeeper/mongoose-findorcreate-3.0.0 greenkeeper/@neogeek/eslint-config-standards-3.0.0 greenkeeper/@neogeek/eslint-config-standards-4.0.0 greenkeeper/@neogeek/eslint-config-standards-4.1.0 greenkeeper/node-sass-4.6.0 greenkeeper/node-sass-4.6.1 greenkeeper/node-sass-4.7.1 greenkeeper/node-sass-4.7.2 greenkeeper/node-sass-4.8.0 greenkeeper/node-sass-4.8.1 greenkeeper/node-sass-4.8.3 greenkeeper/node-sass-4.9.0 greenkeeper/node-sass-4.9.1 greenkeeper/node-sass-4.9.2 greenkeeper/node-sass-4.9.3 greenkeeper/node-sass-4.9.4 greenkeeper/node-sass-4.10.0 greenkeeper/node-sass-4.11.0 greenkeeper/sanitize-html-1.14.2 greenkeeper/sanitize-html-1.14.3 greenkeeper/sanitize-html-1.15.0 greenkeeper/sanitize-html-1.16.0 greenkeeper/sanitize-html-1.16.1 greenkeeper/sanitize-html-1.16.2 greenkeeper/sanitize-html-1.16.3 greenkeeper/sanitize-html-1.17.0 greenkeeper/sanitize-html-1.18.0 greenkeeper/sanitize-html-1.18.1 greenkeeper/sanitize-html-1.18.2 greenkeeper/sanitize-html-1.18.3 greenkeeper/sanitize-html-1.18.4 greenkeeper/sanitize-html-1.18.5 greenkeeper/sanitize-html-1.19.0 greenkeeper/sanitize-html-1.19.1 greenkeeper/sanitize-html-1.19.2 greenkeeper/sanitize-html-1.19.3 greenkeeper/spire-of-babel-1.4.0 greenkeeper/update-to-node-10 master snyk-fix-4e511473 snyk-fix-5luzjm snyk-fix-425f1464 snyk-fix-dskxxb snyk-fix-e3085185 snyk-fix-je5jkw snyk-fix-n7d2ho
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
locales
src
static
test
.eslintignore
.eslintrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
Makefile
README.md
config.json
main.js
package-lock.json
package.json

README.md

linear

A simple setup micro-forum built in Node.js with Express and MongoDB.

Build Status codecov Dependency Status Known Vulnerabilities bitHound Overall Score NPM Version Greenkeeper badge

Install

$ npm install linear --save

Quick Start

const linear = require('linear');

linear.startWithConfig({
    'site_name': 'Sample Forum'
});

Config

site_name

Type: String
Default: 'Sample Forum'

Name used in both header and title tags throughout the site.

directories

Type: Object
Default: {'static': './static'}

Directories used to overwrite the assets included with linear.

  • static: All static files: CSS, Fonts, JavaScript
  • locales: Localization files.
  • views: Server-side templates.

Note: Replacing the locales directory is a destructive action. Changing static or views is a additive action as the server will look for static files and view templates in the config specified directories first.

ga

Type: String
Default: ''

Tracking code for Google Analytics. http://www.google.com/analytics/

Environment Setup

Place the following key/value pairs in an .env file locally and within the settings panel of your Heroku application.

Setting Up MongoDB

Read more at https://devcenter.heroku.com/articles/nodejs-mongoose#mongodb-connectors.

MONGOLAB_URI=mongodb://username:password@mongolab.com/linear

Setting Up Social Networks

Omitting either of these social networks will prevent it from showing up on the login screen.

Facebook

For more information on how to retrieve these keys see https://github.com/trylinear/linear/wiki/Social-Setup#facebook.

FACEBOOK_CLIENT_ID=<token>
FACEBOOK_CLIENT_SECRET=<token>
FACEBOOK_CALLBACK=http://localhost:5000/login/facebook/callback

Google

For more information on how to retrieve these keys see https://github.com/trylinear/linear/wiki/Social-Setup#google.

GOOGLE_CLIENT_ID=<token>
GOOGLE_CLIENT_SECRET=<token>
GOOGLE_CALLBACK=http://localhost:5000/login/google/callback

Twitter

For more information on how to retrieve these keys see https://github.com/trylinear/linear/wiki/Social-Setup#twitter.

TWITTER_CONSUMER_KEY=<token>
TWITTER_CONSUMER_SECRET=<token>
TWITTER_CALLBACK=http://localhost:5000/login/twitter/callback

The default template supports Twitter Cards. To get these to display you must first run a sample post through the Card Validator and then Request Approval to be whitelisted.

Setting Up Express Session Security

Read more at https://github.com/expressjs/session#sessionoptions.

SECRET=<token>