Skip to content

cwru-pat/coffee_voting_system

Repository files navigation

Coffee Voting System Build Status

Frontend Libraries & Extensions

Server Dependencies

  • Install LAMP
    • Install Apache (sudo apt-get install apache2)
    • Install mysql (sudo apt-get install mysql-server mysql-client)
    • Install PHP (sudo apt-get install php5)
    • Link php/mysql: (sudo apt-get install php5-mysql)
  • Create a database/user. Log in to mysql (mysql -u root -p), and do something like:
    • CREATE DATABASE coffee;
    • CREATE USER 'coffee'@'localhost' IDENTIFIED BY 'coffee';
    • GRANT ALL ON coffee.* TO coffee
  • Download and unzip phpCAS
    • phpCAS requires php5-curl (sudo apt-get install php5-curl)
  • Download and unzip htmlpurifier
  • Set up PHPCodeSniffer, easiest via pear sudo apt-get install php-pear and sudo pear install PHP_CodeSniffer.
    • This can be run using a command like phpcs --standard=PSR2 -n **/*.php (Which travis-ci will check.)
  • Set up eslint: sudo apt-get install npm, then install using sudo npm install -g eslint to get eslint. To get the definitions sudo npm install -g eslint-config-google
    • This can be run using a command like eslint js.

Setting up the script

  • Clone! cd to the web directory (probably something like cd /var/www)
    • git clone https://github.com/cwru-pat/coffee_stuff.git
    • Change to this directory, cd coffee_stuff
  • Copy the settings file, cp private/.default-config.php private/.config.php. The file private/.config.php is ignored in .gitignore, so you can edit it without worrying about passwords being committed.
    • Edit the $config['database'][...] to reflect the mysql credentials created above.
    • Edit $config['web']['path'] to point to the URL where you can view the system.
    • Edit $config['phpCAS']['location'] to point to system path where the CAS.php file inside the phpCAS directory is (it should probably not be a subdirectory of this repo).
    • Edit $config['htmlpurifier']['location'] to point to system path where the HTMLPurifier.auto.php file is inside the htmlpurifier library directory is (it should probably not be a subdirectory of this repo).
  • A pre-commit hook to run tests exists. Run cp pre-commit .git/hooks/pre-commmit to enable it.

Notes

  • For database changes, tables that do not exist are created, but changes to existing tables need to be done by hand (for now).
  • To run tests by hand, try ./ci/ci-tests.sh.

About

Journal club voting/discussion website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published