Code Monkey home page Code Monkey logo

bof's Introduction

BOF

Birds of a feather flock together: this is a software that can be used for proposing BOF topics and for voting on them

You can try a demo at https://bof.demo.solidcharity.com, with user admin and password secret. It is being reset each night automatically.

For more details about the Slim framework and other technical details, see the wiki: https://github.com/ICCM-EU/BOF/wiki

Please report issues at https://github.com/ICCM-EU/BOF/issues.

Pull requests are very much welcome!

Installation

Via Vagrant… (with Ansible in the background)

Install Vagrant, Virtual Box and Ansible.

vagrant up

Everything should be accessible at [http://192.168.33.153] (or [http://bof.local] if you add it to your hosts file*.

Or setup directly on any Ubuntu machine via Ansible…

Setup an Ubuntu 18.04 machine:

apt-get install git ansible
git clone https://github.com/ICCM-EU/BOF.git
cd BOF/ansible
# perhaps update group_vars/all.yml with the actual timezone
ansible-playbook playbook.yml -i localhost
# for dev environment, i.e. for running the tests
ansible-playbook playbook.yml -i localhost --extra-vars "dev=1"
cd /root
rm -Rf BOF
ln -s /var/www/bof

The initial password for the user admin is: secret

You can change the password on the admin page.

The website lives in /var/www/bof

The configuration for the database is in /var/www/bof/cfg/settings.php

Deployment and build

To bundle frontend items properly run:

node_modules/.bin/gulp deploy

Resetting the database for real use or for testing

There is now a button on the admin page, that will reset the database. It will keep the admin user, and the prep workshop.

Set dates for testing the nomination or voting in the UI.

Running the tests with Cypress

cd /var/www/bof
npm install cypress
apt-get install xvfb gconf2 libgtk2.0-0 libxtst6 libxss1 libnss3 libasound2
LANG=en CYPRESS_baseUrl=http://localhost ./node_modules/.bin/cypress run --config video=false --spec 'cypress/integration/nomination.js'
LANG=en CYPRESS_baseUrl=http://localhost ./node_modules/.bin/cypress run --config video=false --spec 'cypress/integration/voting.js'

Running the PHPUnit Tests

cd /var/www/bof/src
# need to run composer install again, because ansible does not include the dev dependancies by default when calling composer install
composer install --dev
apt-get install php-xdebug php-pdo-sqlite
./vendor/bin/phpunit -c phpunit.xml
# Please note you should not install PHPUnit on anything but your development system.  See https://thephp.cc/news/2020/02/phpunit-a-security-risk for further explanation. 

bof's People

Contributors

dependabot[bot] avatar franc6 avatar jamesdoc avatar jcommelin avatar pvanstam avatar refactoredmarc avatar saemideluxe avatar samsamsamsamsamsamsam avatar seymourt avatar tpokorra avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bof's Issues

Nomination of topics

  • create topics
  • view already existing nominations
  • edit or delete your own topic

Prepare unit tests

This obviously depends on the programming language we use.

When that decision has been made, we can start using the spec (https://github.com/ICCM-EU/BOF/wiki/Specs-of-the-BOF-application) to define unit tests for various issues:

  • calculating the order of voted sessions, calculating the rooms and slots
  • creating a new user account
  • etc

We could prepare the code classes beforehand, with methods that don't have any functionality, but can be called from the test code. This way we have test driven development during the hackathon!

We could even prepare Selenium (http://www.seleniumhq.org/) tests for the UI beforehand, although that would not be very acurate, and the tests would need to be modified during development of the actual screens.

Select a programming language and framework

I am proposing PHP. Just because you can install it on any server easily.
I am wondering about https://symfony.com/ as a framework. Or is it too heavy? What about https://www.slimframework.com/? But Symfony is quite a standard.

Another option would be Python, with using Django as a framework.

We had C# in the pre conference workshop day in 2016, so I think we should be using something different than C#.

Any thoughts?

facilitator issues

It seems that the ability to volunteer as a leader/facilitator has disappeared from the app.

It is important that each BOF is assigned a leader/facilitator. People should be able to indicate that they can do this during the suggesting phase and the voting phase

The old BOF system would choose from suggested with facilitator first then the rest. And the BOF organizer would track down and assign people to lead those that don’t have a facilitator to make sure each has a facilitator

Switch the stages

the admin must define when the voting stage starts, and when the results can be displayed

Prepare the data model

I think the database structure of the old BOF is quite obvious, and not under license restrictions. We could reuse that.

Depending on the decision for programming language and framework, we need to decide how we access the database.

special treatment for voting on ICCM prep BOF

if you vote on the EuroPrep Workshop, you don't lose a vote.

That should help with creating the schedule, because we know who wants to go there.

But still keep it fair for those who want to attend the EuroPrep workshop, they have as many votes as everyone else.

Export to Excel file

otherwise there are pasting issues with cells covering multiple lines

at least a download of the csv file already would help

security issue in dependencies: hoek

Github says:

We found a potential security vulnerability in one of your dependencies.

A dependency defined in ./package-lock.json has known security vulnerabilities and should be updated. 

package-lock.json update suggested: hoek ~> 5.0.3 

this is drawn in by node-sass 4.9.0, and will only be fixed in 5.x: sass/node-sass#2170

How to fix this in general:

 npm outdated
 fix the required version in package.json
 npm install

Bootstrap styling and CSS

need to insert Bootstrap into the layout.html

perhaps start with the Login dialog.

then continue with what the other developers are putting in the templates directory.

Vote on topics

  • give full vote or quarter vote to topic
  • volunteer to be the facilitator

Select a license

I propose the GPL v3 or later. With this license, anyone selling software based on this code is obliged to also publish the source code under GPL v3 to their customers.

Any other suggestions?

Display which people have not voted yet

To encourage voting.
Put people on the big display, that have not voted yet.
This would of course only include people that registered into the system in the first place.

Moderate and Merge nominations

the admin must be able to edit the nominations before the voting stage. he must be able to merge similar nominations.

Display current state on the projector

this does not require a login.

depending on the current stage, different information is required for the page on the projector

  • nominations
  • votes
  • PRIO 2: results: which time slot, which room

when voting, stay on the topic

at the moment, the page is reloaded, and you are back at the top of the list
it would be great to either scroll to the topic, or use AJAX for the voting which does not need to reload the page

Export the Result to CSV for Sched

the format is:

<#room#>,<#workshop#>,<#facilitators#>,<#clean_desc#>,<#votes#>,<#available#>

where clean_desc is without any html tags

votes is the sum of full votes and quarter votes

available is the number of people actually available, that are not booked on another bof already with more votes

calculate votes with an algorithm

this is the algorithm we have used in the past:

definition:

  • rounds = number of rounds

  • locations = number of locations

  • slots available: make sure we have one slot free for the ICCM Prep BOF

  • in each workshop, calculate the number of votes of participants, and reset the field round_id, location_id and available

    UPDATE workshop
               SET votes = (SELECT SUM(participant)
                              FROM workshop_participant 
                             WHERE workshop.id=workshop_participant.workshop_id),
                   round_id = NULL,
                   location_id = NULL,
                   available = NULL
    
  • for each round, calculate the top votes:

       SELECT id,name, votes
              FROM workshop
             WHERE published=1
             ORDER BY votes desc
             LIMIT 0, $rounds;
    
  • and book them:

      UPDATE workshop
      	          SET round_id = {$count},
      	              location_id=1,
      	              available=(SELECT COUNT(ID)
                                     FROM workshop_participant 
                                    WHERE workshop.id=workshop_participant.workshop_id
                                      AND participant=1)
      	        WHERE id={$db->escape_string($row['id'])}
    
  • loop through remaining possible slots

      for ($i=$rounds+1 ; $i <= $rounds * $locations ; $i++) {
    
  • inside the loop:

    • get highest # votes for unscheduled bof

        $sql="SELECT max(votes)
                FROM workshop 
               WHERE round_id IS NULL 
                 AND published=1";
      
    • if no workshops are left, we are done

    • find next bof to book: which bof with the same max(votes) can happen with participants available

        $sql = "SELECT s.id id,s.name,
                       roundsTable.round_id round, 
                       roundsTable.last_location last_location,
                       available,  
                       (SELECT count(*) 
        	              FROM workshop_participant
        	             WHERE workshop_id = s.id
        	               AND participant=1
        	               AND participant_id NOT IN
        	                           (SELECT participant_id
        	                              FROM workshop_participant
        	                              JOIN workshop ON workshop.id=workshop_participant.workshop_id
        	                             WHERE workshop.round_id=roundsTable.round_id
        	                               AND workshop_participant.participant=1)
        	           ) AS available,
        		       (SELECT count(*) 
                          FROM workshop_participant
                         WHERE workshop_id = s.id
                           AND leader=1
                           AND participant_id NOT IN
                               (SELECT participant_id
                                  FROM workshop_participant
                                  JOIN workshop ON workshop.id=workshop_participant.workshop_id
                                 WHERE workshop.round_id=roundsTable.round_id
                                   AND workshop_participant.leader=1)
                        ) AS facilitators
        		FROM workshop AS s
        		LEFT JOIN (SELECT round_id, max(location_id) last_location
        		           FROM workshop
        		           WHERE round_id IS NOT NULL
        		           GROUP BY round_id) AS roundsTable 
        		     ON roundsTable.last_location < ".$locations."
        		WHERE s.round_id is null
        		  AND published=1
        		  AND s.votes = ".$maxVote."
        		ORDER BY available DESC, facilitators DESC, round ASC
        		LIMIT 0,1";
      
      • For each of the results of the previous query:

          UPDATE workshop
                        SET round_id = {$db->escape_string($row['round'])},
                            location_id = ".($db->escape_string($row['last_location']) + 1) .",
                            available = ".($db->escape_string($row['available'])) ."
                      WHERE id={$db->escape_string($row['id'])}";
        

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.