Lentolaskuri
Flight CO2 emission calculator.
Uses Grunt: The JavaScript Task Runner.
Installation
Prerequisites
- Webserver that runs PHP to poll the airport data
- MySQL server to hold the data
- npm, bower and grunt to fetch dependencies and to build the project
Lentolaskuri has been tested and build using tested on MAMP and LAMP stack.
Dependencies
See bower.json and package.json for complete list of packages.
To install required packages run in the project folder in your terminal of choise:
npm install && bower install
Building the project
grunt server # Start development server
grunt # Build minified and optimized version for release to /dist -folder
Configuration
- Configure database access in
app/api/config.sample.php
and save asapp/api/config.php
. Theconfig.php
file gets ignored in.gitignore
so no worries. - Build project using
grunt
, this generatesdist
folder - Push files and folders in
dist/*
to your server, for example as http://example.com/lentolaskuri - Set up MySQL database table to your server and import airport data to your database:
- Visit http://example.com/lentolaskuri/api/import.php to create mysql table automagically (or import
app/api/lentolaskuri.sql
by hand, but change table name to one you used inconfig.php
) - Change variable
$config['create_table']
tofalse
inapp/api/config.php
to prevent further table creation attempts - ProTip: You can make
cron
or similar visit this url weekly to update the latest airport data from openflights database
- Visit http://example.com/lentolaskuri/api/import.php to create mysql table automagically (or import
- Test your lentolaskuri application
- Donate money based on emissions to a good cause
Credits
- Build by Juho Teperi in 2013 while working for Ekokumppanit Oy
- Previous maintainers
- Ismo Vuorinen (April to November 2013)
- Juho Teperi (From before Github to April 2013)
Airport data comes from OpenFlights.org (airports.dat, AGPL)