Giter Site home page Giter Site logo

nomanleftbehind / methane-emissions-management Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.57 MB

Open-source web application used for managing, quantifying, and reporting methane emissions in upstream oil & gas industry.

Rust 97.26% Shell 0.46% HTML 0.09% CSS 2.02% PowerShell 0.02% Dockerfile 0.14%
aer directive-060 epa manual-015 methane-emissions-reduction-program

methane-emissions-management's Introduction

Methane Emissions Reduction Program

Open-source web application used for managing, quantifying, and reporting methane emissions in upstream oil and gas sector.

Methane is a potent greenhouse gas with at least 25 times the warming potential of carbon dioxide (CO2) over a 100-year period and scientists estimate that it is responsible for 30% of observed global warming to date. Therefore, cutting methane emissions is the most cost-effective way to reduce greenhouse gas emissions. Oil and gas sector is the largest source of methane emissions in US and Canada, accounting for 30% and 41% respectively in 2021.

Methane emission reduction efforts from petroleum and natural gas sector are underway in both countries. In US, EPA has introduced Methane Emissions Reduction Program, while in Canada's biggest oil and gas producing province Alberta, local energy regulator AER amended Directive 060: Upstream Petroleum Industry Flaring, Incinerating, and Venting and Manual 015: Estimating Methane Emissions to backstop methane emissions target.

This project was primarily started as a side hustle to learn Rust programming language in practice. Over time, as it grew in practical usefulness and, most importantly, became more compatible with specifications set out in AER's Directive 060 and Manual 015, it became a serious endeavour to develop an open-source tool to be used by those tasked with managing, quantifying, and reporting methane emissions.

Technology

Server

Database

Client

  • Yew a Rust framework for creating multi-threaded front-end web apps with WebAssembly

This documentation is written in a way to guide complete beginners through technology stack integration and towards successful compilation of the program.

Big shout-out to open-msupply, and Matt Wilkinson without whom this process would have taken a lot longer.

Setup

Backend

  • Install Rust and Cargo

    Follow the instructions on official Rust website to install the language.

  • Install WASM and Trunk

    rustup target add wasm32-unknown-unknown

    cargo install --locked trunk

  • Install PostgreSQL

    Download and install PostgreSQL. You will be asked to set up a password for superuser called "postgres" and port number at the end of the installation.

  • Install SQLx CLI

    cargo install sqlx-cli --no-default-features --features native-tls,postgres

  • Setup SQLx

    We need to tell SQLx where to find our database. We do this by setting the DATABASE_URL environment variable.

    Rename .env.example file to .env. Inside, replace the word 'password' of DATABASE_URL with earlier defined superuser password.

    The general form for a PostgreSQL connection URI is postgresql://[user[:password]@][host][:port][/dbname]

    Run sqlx database create

    Create database tables by running sqlx migrate run.

  • Build binary and run locally

    Client is rendered on server side so no need to serve with Trunk.

    Following command will produce index.html, along with the compiled css, WASM & the JS loader for the WASM, and it will run server in debug mode.

    On Mac run: ./build-debug.sh

    On Windows run: PowerShell.exe -File build-debug.ps1 -ExecutionPolicy Bypass

    Open http://localhost:8081/ in your browser to view the app.

    You can also test your queries and mutations in GraphQL Playground by opening http://localhost:8081/graphiql in you browser.

    Screenshots

    screenshot

Application Model

ย  Pneumatic Devices Compressor Seals Defined Vent Gas
Root Users
Reporting Level Facilities
Surface Lease Level Sites
Emitter Level Pneumatic Instruments Level Controllers Pneumatic Pumps Compressor Seals Storage Tanks
Calculation Level Emission Rates Controlled Characterizations Control Device Inactivity Month Hours Overrides Emission Rates Actuation Frequencies Controlled Characterizations Control Device Inactivity Month Hours Overrides Emission Rates Controlled Characterizations Control Device Inactivity Month Hours Overrides Tests Controlled Characterizations Control Device Inactivity Emission Surveys Month Hours Overrides Changes GIS Factors Liquid Hydrocarbon Entering Controlled Characterizations Control Device Inactivity Emission Surveys Overrides
Quantification Level Month Methane Emissions

methane-emissions-management's People

Contributors

nomanleftbehind avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.