Skip to content

mmit-brad/SlackRewards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

MSP Hero Reward System – Climbing the Ladder Edition

Welcome to the MSP Hero Reward System! This project is designed to gamify task completion for our MSP team by awarding coins for various tasks, tracking progress on a "climbing wall" (reward levels), and fostering a collaborative environment through peer-to-peer coin donations.

Table of Contents

Overview

The MSP Hero Reward System is built using Node.js and Express. It uses Google OAuth for onboarding, ensuring that only authenticated users can access the system. The reward system itself is defined via a YAML configuration file (reward-system-config.yaml), which is version-controlled in GitHub and easily customizable.

Features

  • Google OAuth Integration: Secure onboarding using your Google account.
  • Express Server: A lightweight server to handle authentication and render onboarding pages.
  • YAML-Based Configuration: Define reward system settings, coin mappings, eligible channels, reward levels, and community coin pot details.
  • Reward Levels & Climbing Wall: Users earn coins for tasks and climb levels (e.g., Script Kiddie, Junior SysAdmin, Senior SysAdmin, IT Overlord, Elite Level).
  • Community Coin Pot: A weekly pool that resets every Monday, enabling peer-to-peer coin donations via Slack slash commands or reactions.
  • Version Control & CI/CD Ready: Configuration stored in GitHub for collaboration and easy updates.

Project Structure

msp-reward-system/
├── app.js                         # Main Express server
├── reward-system-config.yaml      # YAML configuration file for the reward system
├── views/
│   └── index.ejs                  # EJS template for onboarding
├── package.json                   # Project metadata and dependencies
└── README.md                      # This file

Installation and Setup

Prerequisites

  • Node.js (v14 or later recommended)
  • npm
  • A Google account for OAuth
  • Git for version control

Clone the Repository

git clone https://github.com/yourusername/msp-reward-system.git
cd msp-reward-system
npm install

Google OAuth Setup

  1. Go to the Google Developer Console.
  2. Create a new project and set up OAuth 2.0 credentials.
  3. Add http://localhost:3000/auth/google/callback to the list of authorized redirect URIs.
  4. Replace the placeholders in app.js with your actual GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET:
passport.use(new GoogleStrategy({
    clientID: 'YOUR_GOOGLE_CLIENT_ID',
    clientSecret: 'YOUR_GOOGLE_CLIENT_SECRET',
    callbackURL: 'http://localhost:3000/auth/google/callback'
  },
  // ...
));

Alternatively, you can use environment variables for these credentials.

Configuration

The reward system settings are defined in the YAML file: reward-system-config.yaml.

Key sections include:

  • coin_mapping: Defines the coin values for each Slack emoji (e.g., computer = 1 coin, trophy = 3 coins).
  • channels: Specifies eligible and ineligible channels (e.g., tasks in gaming channels are excluded).
  • reward_levels: Defines the progression levels based on cumulative coins.
  • community_coin_pot: Sets the weekly total and reset day for the community coin pot.
  • task_logging: Provides guidelines for logging tasks, such as including the Ticket/Event ID.

Running the Server

To run the server locally:

node app.js

Then open your browser and navigate to http://localhost:3000. You will be prompted to sign in with your Google account.

Deployment

Once you're ready to deploy, you can use cloud platforms like Heroku, AWS, or Google Cloud. Remember to:

  • Set the appropriate environment variables (e.g., GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and any session secret keys).
  • Adjust the callback URL in your OAuth settings to match your production domain.

Usage

Onboarding

Users authenticate via Google OAuth, and their details are displayed on the onboarding page along with the current reward system configuration.

Reward Logging

Tasks are logged through Slack using designated emojis and include a Ticket/Event ID. The system then awards coins based on the emoji reaction.

Community Coins

Use the /donatecoin slash command (or designated reaction) in Slack to donate coins to peers. The community coin pot resets every Monday.

Contributing

We welcome contributions! Please fork this repository and create a pull request with your changes. For major changes, open an issue first to discuss your ideas.

License

This project is licensed under the MIT License.

Happy coding, and let's climb the ladder one coin at a time!

About

MSP Hero Reward System for gamifying task completion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published