Skip to content
AMEE edited this page Sep 14, 2010 · 6 revisions

AMEE Construction Calculator

This is a sample Ruby on Rails application that shows how to use the AMEE API in a real life application. The application was designed as a sample carbon calculator similar to one that would be used by a construction company. Whilst this is a sample application and is known to work at time of release, there is no guarantee that AMEE will fix any bugs found, or update this application if a substantial new version of the AMEE API is introduced.

You can create your own copy of this application at MyAMEE, or you can use this codebase to run your own copy on your own servers. You may also use it as a base from which to develop your own AMEE applications.

License

MIT (see the COPYING file)

Getting Started

Ensure you have Rails 2.3.5 installed. Then install the gem dependencies:

rake gems:install

Download the application, and customise config/amee.example.yml, config/database.example.yml and config/settings.example.yml with your own settings. Then run:

rake db:schema:load

to set up the database.

The project requires an initial client and super admin before it is usable. There is currently only one client supported but the application shows how to easily change this and turn the application into a SaaS model. To create these run the following on the command line:

rake “setup:data[,,,,]”

Your application is then ready to use by running script/server.

Further notes

This software was designed as an example UK calculator. The AMEE API assumes that any data submitted is for the UK unless a metadata profile item is created explicitly specifying the country. Any project using this codebase as a basis for their software should therefore set the country if it is not the UK. More details can be found in AMEE Explorer

As AMEE can update the algorithms that produce the carbon output as more accurate data becomes available, any application that caches the carbon output needs a way to updates its cache. This project includes a rake project for that purpose and can be run via:

rake cronjobs:update_carbon_cache

Clone this wiki locally