mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-01-26 03:03:58 +00:00
b0258437cdf18d9754117c4d3b2bb8a56a59878a
- Made the application more configurable by the user - Made installation easier - API location is now dynamic based on window.location - Cleaned up some older code that was pointing to dev stuff - Now includes the SQL-table required to run the application - Application now exposes config to console for easier debugging - Search now supports user specified table name - Updated the OpenFlights airport data file source
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.phpand save asapp/api/config.php. Theconfig.phpfile gets ignored in.gitignoreso no worries. - Build project using
grunt, this generatesdistfolder - 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.sqlby hand, but change table name to one you used inconfig.php) - Change variable
$config['create_table']tofalseinapp/api/config.phpto prevent further table creation attempts - ProTip: You can make
cronor 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)
Description
Languages
JavaScript
62.9%
HTML
16.3%
PHP
10.6%
Handlebars
5.5%
Less
4.7%