Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

mixer

a tool to initiate meetings by randomly pairing individuals

Subscribe to updates I use mixer


Statistics on mixer

Number of watchers on Github 89
Number of open issues 4
Average time to close an issue about 6 hours
Main language Go
Average time to merge a PR about 5 hours
Open pull requests 0+
Closed pull requests 1+
Last commit almost 3 years ago
Repo Created about 4 years ago
Repo Last Updated over 1 year ago
Size 478 KB
Organization / Authoretsy
Contributors2
Page Updated
Do you use mixer? Leave a review!
View open issues (4)
View mixer activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating mixer for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Mixer

Intro

Mixer is a tool to initiate meetings by randomly pairing individuals. Read more about it here.

Development Setup

  1. Setup your golang environment

  2. Grab the repo and put it in the right place:

    go get github.com/etsy/mixer
    cd $GOPATH/src/github.com/etsy/mixer
    
  3. Create the 'mixer' database:

    mysql -u root
    create database mixer;
    \u mixer
    source db/mixer.sql
    source db/mixer_data.sql
    grant all privileges on mixer.* to 'mixeruser'@'127.0.0.1' identified by '<somepassword>';
    
  4. Configure the mixer app:

  • cp config.cfg.sample config.cfg and edit the values to match your environment
  • cp config-secrets.cfg.sample config-secrets.cfg and put the password you created for mixeruser above in config-secrets.cfg
  1. Assuming you're running apache, create a virtual host config for mixer in /etc/httpd/conf.d/mixer.conf:

    <Virtualhost *:80>
      ServerName mixer.<hostname>
      ProxyPass / http://localhost:3001/ retry=0
      ProxyPassReverse / http://localhost:3001/
    
      RequestHeader set X-Username <username>
    </VirtualHost>
    

Note: This is a development setup. In production, your authentication system needs to pass the username as an http header after the user has logged in. The header name can be defined in the config. This app was not written to assume any implementation of your authentication system.

  1. Fire it up:

    go run mixer.go
    
  2. Open it in your browser at http://mixer.<hostname>

Architecture

The server is written in Go, while the client-side javascript is backbone + jquery. There is a local staff table, which is intended to be an updated copy of data from your company-wide staff database. It is assumed in the example import script that your company provides an api to the staff database in JSON format which is defined below. If this is not the case you are welcome to write your own import implementation to populate the staff table.

Additionally, as mentioned in the setup, this assumes that the application is fronted by an authentication system that passes headers into the app that define the username of the logged-in user. This allows the application to see if the user has an account, or if they have to be presented with a registration form.

It is easy to add new mixers by inserting into the groups table. There is currently no user interface for this admin functionality.

Running the Mixer

Each mixer must be run via separate cronjobs. This gives some flexibility to the frequency each mixer is run. An example of what this cron entry would like like is below:

# run as 12:00 on Mondays
0 12 * * 1 cd /usr/local/mixer && /usr/local/mixer/bin/match --group=Engineering >> /var/log/mixer/engineeringcron.log 2>&1

Importing the Staff Data

The local staff table is assumed to be populated and updated. There are some helper scripts written that make some assumptions. They assume that you are providing a URL returning JSON data of a specific format defined below. This is taken and inserted into the local staff table.

An example cron of running the import of staff data:

 # run script to sync staff data
 0 */4 * * * cd /usr/local/mixer && /usr/local/mixer/bin/staff >> /var/log/mixer/staffcron.log 2>&1

JSON Format of Staff Datafeed

{
  id: 5000,
  auth_username: "flastname",
  first_name: "Test",
  last_name: "User",
  title: "Engineer",
  avatar: "https://someurl/img.jpg",
  enabled: 1,
  is_manager: false,
}

Cleaning up Alumni

Since it doesn't make sense to pair people with others that have left the company, some cleanup work is involved with the groups people have joined. There is a script to help here. The assumption is that you populate your staff table with both enabled and non-enabled users. The cleanup script will then remove any users that have the enabled flag set to 0 from the people_groups table so that they are no longer matched but still retain their account and history.

An example cron to run the cleanup script is:

    # run script to cleanup alumni users
    0 12 * * 1 cd /usr/local/mixer && /usr/local/mixer/bin/cleanup >> /var/log/mixer/cleanupcron.log 2>&1

Notes

the is_manager field

There is one specific mixer group called Managers that is limited to managers by some fairly specific code that should be abstracted at some point. This value is set by the is_manager field from your staff database.

running alternating mixers

It is possible with some bash-fu to short circuit it to run every other week. Here is an example:

# run engineering mixer every other monday starting from Jan 5 2015
0 14 * * 1 bash -c '((($(date +\%s) + 259200) / 86400 \% 14))' && cd /usr/local/mixer && /usr/local/mixer/bin/match --group=Engineering >> /var/log/mixer/engineeringcron.log 2>&1
# run manager mixer every other monday starting from Jan 12 2015
0 14 * * 1 bash -c '((($(date +\%s) + 864000) / 86400 \% 14))' && cd /usr/local/mixer && /usr/local/mixer/bin/match --group=Managers >> /var/log/mixer/managerscron.log 2>&1

TODO

See Issues for bugs and ideas. We'd love to see your pull requests!

Help

Stop by the #codeascraft IRC channel on Freenode if you need any help.

mixer open issues Ask a question     (View All Issues)
  • over 3 years JSON Unmarshalling error
  • about 4 years CRUD for groups
mixer questions on Stackoverflow (View All Questions)
  • Pygame Mixer BPM
  • Pygame mixer clicking sound
  • Java record from audio output or mixer
  • Any simple sample of EVR custom mixer?
  • Jquery Color Mixer Plugin
  • Can you change your program name listed in volume mixer/sndvol in windows without using Core Audio APIs?
  • Multiple Mixer outputs in Java
  • collada loader does not work with stemkosi HTML Mixer viewer example
  • alsa-lib mixer interface, changing values of faders
  • OPEN the volume mixer in Visual Basic
  • NewTimePitch with Mixer
  • VU Meter like Windows Volume Mixer
  • Error while using pygame keyDown event with pygame mixer
  • Pygame mixer on Raspberry Pi
  • How can i control the volume of a specific software in the windows Volume Mixer?
  • How can I control playback rate (bpm) of single bus of a multi-channel mixer in iOS?
  • How to create Provider Mixer e Django
  • Apple Audio Mixer not producing volume
  • Is it possible to create youtube mixer with javascript api?
  • Volume Mixer Control and Listing Applications
  • Same audio mixer for multiple AudioSource in Unity 5
  • How to free resource in PyGame mixer?
  • Where is sound output on openjdk gervill software mixer
  • Hide Program From Volume Mixer
  • How to make my application disappear from Windows Volume Mixer
  • How to choose mixer and line to get/set volume output?
  • Volume mixer don't show my program
  • Multichannel Mixer + Voice-Processing IO Unit
  • How to control master mixer volume in windows 7 using mixer api?
  • SDL_Mixer error "Mixer not built with ... support"
mixer list of languages used
Other projects in Go