Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.97 KB

README.md

File metadata and controls

28 lines (16 loc) · 1.97 KB

EPA’s Avoided Emissions and Generation Tool (AVERT)

The AVERT app is composed of two apps working together: a client app, and server app.

The client app is a single page JavaScript app, which is ultimately built to static files that are served by the server app on Cloud.gov. In addition to serving the client app’s static files, the server app is responsible for performing calculations and returning the results of those calculations to the client app. This offloading of the calculations keeps the client app fast and always responsive to user input.

View each app’s README files for more info on the individual apps.

Local Development

Local development uses Node.js (v18 or higher).

If this is your first time running AVERT locally, download all dependencies by running:
npm run setup

Running the client app locally depends on a running local instance of the server app. Instead of starting both apps individually, running the following command will start both concurrently:
npm start

The server app will run on port 3001 and the client app will run on port 3000. Your browser will open the app at http://localhost:3000.

Embedded iframe Testing

The deployed Cloud.gov app is displayed in an iframe on a page in EPA’s AVERT web area. To test and replicate this locally, first run the app as described above, then navigate into the docs directory, and start a simple web server from that directory with following command:
npx serve --listen 8000

(NOTE: port 8000 used because the client app is running on port 3000).

Then open a web browser to: http://localhost:8000/epa-drupal-iframe-testing to view the AVERT web application, rendered in an iframe on an page that uses EPA’s Standard Template, which resembles EPA’s Drupal template.