Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.
/ badger Public archive

Gamification platform to motivate your team with badges, adventures & other cool stuff!

License

Notifications You must be signed in to change notification settings

the-badger/badger

Repository files navigation

Gruik Logo

Badger

Travis CI Scrutinizer Code Quality

Badger is a gamification platform initially developed as an internal project by Akeneo. Badger is still under development, but is working! If you want to try the project, please install the last release.

Prerequisite

  • PHP 7.1+
  • MySQL
  • Composer
  • NodeJS & NPM (only used to grab front JS dependencies)
  • Elasticsearch 1.7.x (not compatible with 2.x)

Installation

Badger is based on the great Symfony framework. If you encounter some installation errors, please have a look on the Symfony installation documentation. If you still have some troubles, feel free to open a GitHub issue.

1) Install Composer dependencies

composer install

2) Setup your database

mysql -u root -p

    CREATE DATABASE badger;
    GRANT ALL PRIVILEGES ON badger.* TO badger_user@localhost IDENTIFIED BY 'badger_password';
    EXIT

php bin/console doctrine:schema:update --force

3) Install frontend assets

npm install # Install frontend dependencies, like Bootstrap
php bin/console assets:install # Move bundle assets to web/ directory
nodejs node_modules/gulp/bin/gulp.js less # Compile bundle .less files to .css
nodejs node_modules/gulp/bin/gulp.js install # Move downloaded assets to web/ directory

Configuration

Once Badger has been installed, you'll have some small things to configure in order to use the application.

Setup GitHub oAuth login

  1. Create a GitHub application with your GitHub account by following this link: https://github.com/settings/developers
  2. Fill in needed informations. Homepage URL & Authorization callback URL should have the same URL, which is your Badger index page (eg. https://badger.example.com/)
  3. Once the application created, put your Client ID & Client Secret tokens in the parameters file of your Badger app:
# ./app/config/parameters.yml
parameters:
    github_client_id: 123456789
    github_client_secret: abcdef123456789

Setup Google oAuth login

  1. Create a Google application with your Google account by following this link: https://console.developers.google.com/
  2. Fill in needed informations. Put your Badger Google Login page (eg. https://badger.example.com/login/check-google) as a valid redirect domain
  3. Once the application created, put your Client ID & Client Secret tokens in the parameters file of your Badger app:
# ./app/config/parameters.yml
parameters:
    google_client_id: abcdefg123456789.apps.googleusercontent.com
    google_client_secret: 123456789abcd

Setup Elasticsearch

Bagder is working with Elasticsearch in order to ease the search in the application.

  1. Instructions for installing and deploying Elasticsearch may be found here.
  2. Set the correct elastic host and port in you parameters.yml file.
  3. (Optional) Populate Elasticsearch with existing users using the following command:
php bin/console fos:elastica:populate

Note that every new users will be automatically indexed by Elasticsearch, you won't need to re-run this command again.

Create an admin user

To manage Badger, you'll need one or several administrators. To promote a user, use this command:

php bin/console fos:user:promote <username> ROLE_ADMIN

Note that the promoted user will need to logout then login again to have full power 🤘

Running Tests

./bin/simple-phpunit -c app
./bin/simple-phpunit -c app --coverage-html=web/phpunit-coverage

License

Badger is licensed under the Open Software License v. 3.0 (OSL-3.0)