OED has many scripts to support its use for development and sometimes in production settings. These can be run by
npm run [SCRIPT] in the
web docker compose service (e.g.
docker compose run --rm web npm run [SCRIPT] [args]) or by entering the OED web container as a
Note these are not standard ways for developers to run parts of OED but can be used at times or in scripts.
startstarts the NodeJS webserver.
start:devstarts the NodeJS webserver with Nodemon, so it restarts automatically.
webpack:devruns Webpack in development mode and dynamically rebuilding the client-side application when files change.
webpack:buildruns Webpack once in production mode.
webpackruns Webpack once in development mode.
checkruns all the below non-test checks (that is, all static checks)
check:headerensures that there are no source files without MPL headers.
check:typesruns the TypeScript compiler without emitting code (i.e. just checks for type errors).
check:lintruns TSLint against the project to ensure style conformity.
testruns the automated test suite on the server.
testsome <path to desired test file where can have multiple times>runs the automated test on the provided test file(s).
Note many of these are described in more detail on the installation page.
createdbcreates the database schema in an uninitialized database. It will not update the schema for some parts of OED on major changes.
migratedbshould upgrade the database after upgrading the software to a new version.
addMamacMetersadds meters from a CSV file.
updateMamacMetersfetches new data from previously imported Mamac meters.
updateEgaugeMetersfetches new data from previously setup eGauge meters.
refreshReadingViewsaggregates readings data in the database for daily graphing has the latest data.
refreshDailyReadingViewssame as refreshReadingViews but using newer names.
refreshHourlyReadingViewsaggregates readings data in the database for hourly graphing has the latest data.
refreshAllReadingViewsdoes both the refreshDailyReadingViews and refreshHourlyReadingViews.
createUsercreates a new user. If given no arguments, it is interactive; you can also pass the username and password as command line arguments. This is not normally used any more since the admin web page allows adding/modifying users except on initial site setup .
editUseredits the password of an existing user. This is not normally used any more since the admin web page allows adding/modifying users except or reset a password.
sendLogEmailsends an email with the latest errors/warnings to the specified email.
developerdbcreates DB functions for developers to shift meter data for compare testing.
updateCikAndViewscauses a running OED to redo the cik in the DB and to update the daily and hourly views due to this change.
obvius:showConfigfilesshows the Obvius config files stored in the DB; usually for debugging.
obvius:purgeConfigfilesdeletes the Obvius config files stored in the DB; usually for debugging and is destructive.
Developers interested in how to create the test data and related script should consult the testing page.