GithubHelp home page GithubHelp logo

akcjademokracja / sharebandit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moveonorg/sharebandit

0.0 1.0 0.0 4.77 MB

System to track and optimize different share choices

License: MIT License

JavaScript 72.94% Shell 0.72% HTML 26.34%

sharebandit's Introduction

ShareBandit

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.

How to run locally:

  1. git clone https://github.com/MoveOnOrg/sharebandit.git

  2. Install node, on Linux: sudo apt-get install node and on MacOS brew install node (or use nvm, whatever you prefer)

  3. In the root of the app run npm install to get and install all packages

  4. 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
  5. 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;
  6. 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
  7. 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:

      1. 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)
      2. In config.json
        • set "oauthAllowedUsers": { "domain": "yourdomain.com"} to allow all domain users to have access

How to run (after installing node):

node index.js

and then navigate to http://localhost:3000/

How to run tests :

npm test

How to Install in Production:

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.

  1. Run (or run the commands yourself) nginx/install.sh as root
  2. Copy the sharebandit.conf file to /etc/nginx/sites-enabled/
  3. Install your SSL certificates at /etc/nginx/cert.* (or modify sharebandit.conf to map your server layout)

sharebandit's People

Contributors

schuyler1d avatar sandramchung avatar mathemagica avatar sreynen avatar tttp avatar jamesr2323 avatar rivkahstandig3636 avatar

Watchers

James Cloos avatar

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.