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.
- Overview
- Features
- Project Structure
- Installation and Setup
- Configuration
- Running the Server
- Deployment
- Usage
- Contributing
- License
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.
- 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.
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
git clone https://github.com/yourusername/msp-reward-system.git
cd msp-reward-system
npm install
- Go to the Google Developer Console.
- Create a new project and set up OAuth 2.0 credentials.
- Add http://localhost:3000/auth/google/callback to the list of authorized redirect URIs.
- 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.
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.
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.
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.
Users authenticate via Google OAuth, and their details are displayed on the onboarding page along with the current reward system configuration.
Tasks are logged through Slack using designated emojis and include a Ticket/Event ID. The system then awards coins based on the emoji reaction.
Use the /donatecoin slash command (or designated reaction) in Slack to donate coins to peers. The community coin pot resets every Monday.
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.
This project is licensed under the MIT License.
Happy coding, and let's climb the ladder one coin at a time!