Skip to content

OhmGeek/Wastetopia

Repository files navigation

Build Status Code Climate

Wastetopia

Deploy

Wastetopia is an agile, software defined start-up, providing responsive, user generated content cloud services and is a key disruptor in the free vegetables sector.

Requirements:

  • PHP v5.4+
  • Composer
  • Klein.php v2.1
  • Twig v1.27
  • Apache 2

Installation Instructions

To install, first clone the repository, and then run:

composer install

As this project requires a MySQL Database, set this up. You can find an example Database in the repository. Then, create a custom configuration, or use one already specified (the production configuration is designed to work with ClearDB on Heroku, with a URL specified in the Config Vars).

The index.php file manages all the routing, and so ModRewrite must be enabled in order for this to work properly on your Apache server. An example Htaccess file can be found in the public/ folder. When setting up Apache, ensure it sets the BASE url as the public folder, so that all the precious code can be hidden away from your end users.

Tests

While tests are somewhat lacking at the moment, first ensure you have the PHP interpreter installed, and then you can run the syntax check using the command:

bash check_syntax.sh

Unit tests can be executed by installing phpunit globally, and then running:

phpunit tests/

Integration tests, are also available using the Nightwatch.js testing framework, using Selenium Web Driver. These currently aren't added to TravisCI (but they will be soon). These are found in the IntegrationTests subfolder of the tests/ directory. You need to have npm installed, along with the selenium web driver. You can install the web driver using the command:

npm install selenium-standalone -g
selenium-standalone install

Then, you can run these tests by starting the Selenium server, and then running the test runner script. First navigate into the IntegrationTests folder.

Start the server using:

selenium-standalone start

and then run tests using:

./tests.sh

Heroku Deployment

When deploying to Heroku, setup ClearDB as a MySQL database, and use the demo database provided in the repo to start you off.

You will need to provide a Production Configuration (which can read from environment variables), to allow the system to run. Also, in the environment variables, put the AWS_BUCKET name along with the mode, so that the correct config will be loaded.

Documentation

Documentation can be found in the master branch, in the docs/ folder. phpDocumentor 2, along with phpdocmd has been used to produce documentation in a nice markdown format.

License

Wastetopia is developed under GPL-3.0. Feel free to use any part of this project in your own, but make sure you share it! :D