ShareBandit automatically tests Facebook sharing Title-Description-Image possibilities, and then promotes the most successful one as a winner becomes clear.
It is a system that runs separately from your regular website, but with some integration will handle share requests for your website. When you do this, you can create multiple options of Title-Description-Image and then ShareBandit will automatically run tests and choose the winner of the best option you created.
- See /docs/WORKFLOW.md for typical workflow using ShareBandit.
- See /docs/INTEGRATION.md for instructions to integrate ShareBandit with a site.
- See /docs/MODULES.md for instructions to add modules to ShareBandit.
-
git clone https://github.com/MoveOnOrg/sharebandit.git
-
Install node, on Linux:
sudo apt-get install node
and on MacOSbrew install node
(or use nvm, whatever you prefer) -
In the root of the app run
npm install
to get and install all packages -
Config base template
cp config/config.json.template config/config.json
- change "baseUrl" to e.g. "http://localhost:3000"
- change "port" to e.g. 3000
- add a secret string for "sessionSecret" key
-
Setup the database with the "db" key in config.json:
- Install sqlite3 and/or postgres libs and module installed on your computer (apt, brew, etc)
- Do not use sqlite for production.
- If you use sqlite, you need to run
(NOT necessary for postgres)
npm install --dev npm install -g sequelize-cli - If you use postgres, before you can run migrations, you'll need to: create database sharebandit;
-
Run database migrations
- sequelize db:migrate
- NODE_ENV=db sequelize db:migrate --config config/config.json # or this, depending on how you manage your envs
-
Setup Auth
-
If you are doing development on domain localhost, you can skip auth by adding
"develMode": true,
to your config.json -
If you want to use google auth for the admin:
- start here: https://console.developers.google.com/home/dashboard a. create a project, and then within the project, under credentials, add a new oauth client id b. enable your project to have the Google+ (plus) API (to get the email address) c. In config.json i. set "oauth" creds to the credentials from the google project ii. Set the origin to whatever domain you're connecting to locally (i do http://sharebandit.dev or localhost:3000) d. Set the redirect URI in the Google dashboard for the app to + /auth/google/callback (e.g. http://localhost:3000/auth/google/callback)
- In config.json
- set "oauthAllowedUsers": { "domain": "yourdomain.com"} to allow all domain users to have access
- You can also add "users": ["[email protected]", "[email protected]"]
- and/or "ip_addresses": ["127.0.0.1", ""]
- set "oauthAllowedUsers": { "domain": "yourdomain.com"} to allow all domain users to have access
-
node index.js
and then navigate to http://localhost:3000/
npm test
You can do this all ways that run nodejs apps in production. Included in the codebase is the nginx/ directory that could help facilitate that on Ubuntu systems.
- Run (or run the commands yourself) nginx/install.sh as root
- Copy the sharebandit.conf file to /etc/nginx/sites-enabled/
- Install your SSL certificates at /etc/nginx/cert.* (or modify sharebandit.conf to map your server layout)