GithubHelp home page GithubHelp logo

kaarinadev / carbon-transparency Goto Github PK

View Code? Open in Web Editor NEW

This project forked from undp/climate-transparency

0.0 0.0 0.0 66.91 MB

National NDC Transparency Tool by Digital For Climate (D4C) collaboration. Code coordinated by ExO/CDO & BPPS/Climate.

Home Page: https://transparency-demo.carbreg.org/

License: GNU Affero General Public License v3.0

Shell 0.31% JavaScript 0.21% TypeScript 44.16% HTML 46.04% Dockerfile 0.22% Less 0.01% SCSS 9.05%

carbon-transparency's Introduction

National NDC Transparency Tool

GitHub last commit SparkBlue Chat

The National NDC Transparency Tool is your gateway to environmental accountability and compliance.

In an era where climate action is not just a responsibility but a mandate, our National NDC Transparency tool stands as a beacon of uncompromising commitment towards environmental stewardship. This tool is an integral part of our open-source software ecosystem designed around the Paris Agreement. It provides a robust platform for nations to meticulously track, report, and manage their Nationally Determined Contributions (NDCs) towards global climate goals. The intuitive interface coupled with a powerful backend ensures that managing complex climate data becomes a seamless experience, fostering a culture of transparency and accountability.

By employing the National NDC Transparency tool, countries can effortlessly align their climate actions with international standards, ensuring a harmonized approach towards a sustainable future. The tool is engineered to provide a clear lens into the progress and impact of NDC actions, making compliance with international commitments and national institutional arrangements a streamlined process. Our tool encapsulates the essence of effective climate action management, offering a clear roadmap towards achieving and exceeding NDC targets.

The system has 3 key features:

  • NDC Actions: Effortlessly track and report NDC mitigation / adaptation actions. The system supports monitoring, co-benefits reporting, & methodology synchronization, facilitating compliance with international commitments and national institutional arrangements.
  • GHG Inventory: [Coming Soon] Maintains a comprehensive inventory of greenhouse gas (GHG) emissions with ease. The system allows for accurate data collection (with Excel integration), automated calculations, and reporting, supporting informed decision-making.
  • Support Tracking: Gain full visibility into financial flows and support mechanisms related to NDC actions. The system provides a clear picture of investments, capacity building, and technology transfer, ensuring both accountability & effective management.

**This is part of an ecosystem of code and tightly integrates with the D4C National Carbon Registry DPG **

Index

Standards

This codebase aims to fulfill the Digital Public Goods standard, adheres to the UNDP Data Principles, and it is built according to the Principles for Digital Development.

System Architecture

Coming soon...

Deployment

System services can deploy in 2 ways.

External Service Providers

All the external services access through a generic interface. It will decouple the system implementation from the external services and enable extendability to multiple services.

Geo Location Service

Currently implemented for 2 options.

  1. File based approach. User has to manually add the regions with the geo coordinates. Sample File. To apply new file changes, replicator service needs to restart.
  2. Mapbox. Dynamically query geo coordinates from the Mapbox API.

Can add more options by implementing location interface

Change by environment variable LOCATION_SERVICE. Supported types are FILE (default) and MAPBOX.

File Service

Implemented 2 options for static file hosting.

  1. NestJS static file hosting using the local storage and container volumes.
  2. AWS S3 file storage.

Can add more options by implementing file handler interface

Change by environment variable FILE_SERVICE. Supported types are LOCAL (default) and S3.

Project Structure

.
├── .github                         # CI/CD [Github Actions files]
├── deployment                      # Declarative configuration files for initial resource creation and setup [AWS Cloudformation]
├── backend                         # System service implementation
    ├── services                    # Services implementation [NestJS application]
        ├── src
            ├── national-api        # National API [NestJS module]      
            ├── stats-api           # Statistics API [NestJS module]
            ├── shared              # Shared resources [NestJS module]     
        ├── serverless.yml          # Service deployment scripts [Serverless + AWS Lambda]
├── libs
    ├── carbon-credit-calculator    # Implementation for the Carbon credit calculation library [Node module + Typescript]
├── web                             # System web frontend implementation [ReactJS]
├── .gitignore
├── docker-compose.yml              # Docker container definitions
└── README.md

Run Services As Containers

  • Update docker compose file env variables as required.
    • Currently all the emails are disabled using env variable IS_EMAIL_DISABLED. When the emails are disabled email payload will be printed on the console. User account passwords needs to extract from this console log. Including root user account, search for a log line starting with Password (temporary) on national container (docker logs -f undp-carbon-registry-national-1).
    • Add / update following environment variables to enable email functionality.
      • IS_EMAIL_DISABLED=false
      • SOURCE_EMAIL (Sender email address)
      • SMTP_ENDPOINT
      • SMTP_USERNAME
      • SMTP_PASSWORD
    • Use DB_PASSWORD env variable to change PostgreSQL database password
    • Configure system root account email by updating environment variable ROOT EMAIL. If the email service is enabled, on the first docker start, this email address will receive a new email with the root user password.
    • By default frontend does not show map images on dashboard and programme view. To enable them please update REACT_APP_MAP_TYPE env variable to Mapbox and add new env variable REACT_APP_MAPBOXGL_ACCESS_TOKEN with MapBox public access token in web container.
  • Add user data
    • Update organisations.csv file to add organisations.
    • Update users.csv file to add users.
    • When updating files keep the header and replace existing dummy data with your data.
    • These users and companies add to the system each docker restart.
  • Run docker-compose up -d --build. This will build and start containers for following services:
    • PostgresDB container
    • National service
    • Analytics service
    • Replicator service
    • React web server with Nginx.
  • Web frontend on http://localhost:3030/
  • API Endpoints,

Run Services Locally

  • Setup postgreSQL locally and create a new database.
  • Update following DB configurations in the .env.local file (If the file does not exist please create a new .env.local)
    • DB_HOST (default localhost)
    • DB_PORT (default 5432)
    • DB_USER (default root)
    • DB_PASSWORD
    • DB_NAME (default carbondbdev)
  • Move to folder cd backend/service
  • Run yarn run sls:install
  • Initial user data setup
serverless invoke local --stage=local --function setup --data '{"rootEmail": "<Root user email>","systemCountryCode": "<System country Alpha 2 code>", "name": "<System country name>", "logoBase64": "<System country logo base64>"}'
  • Start all the services by executing
sls offline --stage=local

Deploy System on the AWS Cloud

  • Execute to create all the required resources on the AWS.
aws cloudformation deploy --template-file ./deployment/aws-formation.yml --stack-name carbon-registry-basic --parameter-overrides EnvironmentName=<stage> DBPassword=<password> --capabilities CAPABILITY_NAMED_IAM
  • Setup following Github Secrets to enable CI/CD
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
  • Run it manually to deploy all the lambda services immediately. It will create 2 lambda layers and following lambda functions,
    • national-api: Handle all carbon registry user and program creation. Trigger by external http request.
    • replicator: Replicate Ledger database entries in to Postgres database for analytics. Trigger by new record on the Kinesis stream.
    • setup: Function to add initial system user data.
  • Create initial user data in the system by invoking setup lambda function by executing
aws lambda invoke \
    --function-name carbon-registry-services-dev-setup --cli-binary-format raw-in-base64-out\
    --payload '{"rootEmail": "<Root user email>","systemCountryCode": "<System country Alpha 2 code>", "name": "<System country name>", "logoBase64": "<System country logo base64>"}' \
    response.json

Modules

Carbon Credit Calculator

Carbon credit calculation is implemented in a separate node module. Please refer to this for more information.

UNDP Platform for Voluntary Bilateral Cooperation

UNDP Platform for Voluntary Bilateral Cooperation generation is implemented in a separate node module. Please refer this for more information.

Web Frontend

Web frontend implemented using ReactJS framework. Please refer getting started with react app for more information.

Localization

  • Languages (Current): English
  • Languages (In progress): French, Spanish

For updating translations or adding new ones, reference https://github.com/undp/carbon-registry/tree/main/web/public/Assets/i18n

API (Application Programming Interface)

For integration, reference RESTful Web API Documentation documentation via Swagger. To access

  • National API: api.APP_URL/national
  • Status API: api.APP_URL/stats

Our Data Dictionary is available for field analysis.

Resource Requirements

Resource Minimum Recommended
Memory 4 GB 8 GB
CPU 4 Cores 4 Cores
Storage 20 GB 50 GB
OS Linux
Windows Server 2016 and later versions.

Note: Above resource requirement mentioned for a single instance from each microservice.status.APP_URL

Status Page

Coming soon...

User Manual

Coming soon...

Demonstration Video

Coming soon...

Data Sovereignty

The code is designed with data sovereignty at its core, empowering nations and organizations to have greater control and governance over their environmental data. Here are the key points highlighting how this system promotes data sovereignty:

  • Local Control:
    • Allows nations and entities to store, manage, and process their data locally or in a preferred jurisdiction, adhering to local laws and regulations.
  • Open Source Architecture:
    • Facilitates transparency, customization, and control over the software, enabling adaptation to specific legal and regulatory requirements.
  • Decentralized Infrastructure:
    • Supports a decentralized data management approach, minimizing reliance on external or centralized systems.
  • Standardized yet Flexible Protocols:
    • Provides standardized protocols for data management while allowing for local customization, aligning with the diverse legal landscapes.
  • Secure Data Sharing and Access Control:
    • Implements robust access control and secure data sharing mechanisms, ensuring only authorized entities can access or alter the data.
  • Audit Trails:
    • Offers comprehensive audit trails for all data transactions, ensuring traceability and accountability in data handling and reporting.
  • Enhanced Privacy Compliance:
    • Helps in ensuring compliance with privacy laws and regulations by providing tools for secure data handling and consent management.

By integrating these features, the code significantly contributes to achieving data sovereignty, promoting a more localized and accountable management of environmental data in line with the goals of the Paris Agreement.

Governance and Support

Digital For Climate (D4C) is responsible for managing the application. D4C is a collaboration between the European Bank for Reconstruction and Development (EBRD), United Nations Development Program (UNDP), United Nations Framework Convention on Climate Change (UNFCCC), International Emissions Trading Association (IETA), European Space Agency (ESA), and World Bank Group that aims to coordinate respective workflows and create a modular and interoperable end-to-end digital ecosystem for the carbon market. The overarching goal is to support a transparent, high integrity global carbon market that can channel capital for impactful climate action and low-carbon development.

This code is managed by United Nations Development Programme as custodian, detailed in the press release. For any questions, contact us at [email protected].

carbon-transparency's People

Contributors

palindaa avatar dhanuxeptagon avatar yathurshant avatar lochanaoshadha avatar gayanath8 avatar tharindugayanga avatar leshanw avatar mbelinsky avatar uvinduxeptagon avatar dependabot[bot] 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.