The Climate Digital Asset Status Hub, also known as "ClimateDASH," plays a crucial role in ensuring the integrity of carbon credit activities, ultimately working towards the reduction of greenhouse gas emissions.
ClimateDASH is an integral component of the World Bank's comprehensive Climate Warehouse digital framework, designed to expedite climate actions. It seamlessly integrates with the Climate Action Data Trust and its software stack. The primary objective of ClimateDASH is to enhance and expand upon the fundamental elements of the digital climate ecosystem. It does this by diligently tracking compliance with jurisdictional regulations and providing support for the implementation of registry rules, thus fostering a more efficient marketplace.
This repository holds the source code for the ClimateDASH in the Climate Token Driver. Related codebases are:
The ClimateDASH interface offers four user-facing modules:
- Credentials module
- Asset rule module
- Account wallet module
- DASHboard explorer module
- Frontend (this repo): The Electron application serves as the user interface, providing a seamless and interactive experience for users. It communicates with the backend services through HTTP protocols.
- Backend Services:
CADT
: This service handles climate-related data and provides functionalities related to climate information and analysis.
- Blockchain Integration:
- The backend services CADT interact with a shared blockchain component.
- The blockchain serves as a decentralized and secure ledger that ensures data integrity, transparency, and reliability.
- Chia RPC enable the backend services to communicate with and make transactions on the blockchain.
electron
: Contains the Electron start code.src
:assets
: Houses fonts and images used in the project.components
: Contains React components.constants
: Includes project-specific constants.pages
: Contains React pages.services
: Provides RTK Query services for API communication.store
: Holds the Redux store configuration.layout
: Provides the global user interface layout.types
: Includes TypeScript types used throughout the project.router
: Handles page routing.utils
: Contains project-specific utilities.
The ClimateDASH connects with the official Chia Wallet installed on localhost. The Climate Wallet also needs to connect to a CAD Trust node, which could be a publicly available observer node.
Before using this application, make sure you have the following prerequisites installed:
- Node.js version 18.0.0 or higher.
This step is required for secure authentication when accessing GitHub Packages for npm. Here's a quick guide:
-
Copy
.npmrc.example
to.npmrc
:- In the root directory of your project, copy the
.npmrc.example
file and rename it to.npmrc
.
- In the root directory of your project, copy the
-
Go to GitHub:
- Open your web browser and navigate to GitHub.
-
Log In:
- If you're not already logged in, sign in to your GitHub account.
-
Access Personal Access Tokens:
- In the top-right corner, click on your profile picture, and then click on "Settings."
-
Navigate to Developer settings:
- In the left sidebar, click on "Developer settings."
-
Generate a New Token:
- On the Developer settings page, click on "Personal access tokens."
-
Generate Token:
- Click on the "Generate token" button.
-
Fill in Token Information:
- Enter a name for your token, and select the required scopes. For the use case you provided, you might need the "read:packages" scope.
-
Generate Token:
- Scroll down and click the "Generate token" button.
-
Copy Token:
- Once generated, GitHub will display the generated token. Copy this token and make sure to save it in a secure place. This token is only shown once.
-
Update
.npmrc
File:-
Open your project's root directory and locate the
.npmrc
file. -
Replace
<Your auth token>
with the token you generated. Your.npmrc
file should look like this://npm.pkg.github.com/:_authToken=YOUR_GENERATED_TOKEN @codegreen-labs:registry=https://npm.pkg.github.com shamefully-hoist=true
-
-
Save Changes:
- Save the changes to the
.npmrc
file.
- Save the changes to the
Now, your project is configured to use the GitHub token for authentication when accessing GitHub Packages. Make sure to keep this token secure and do not share it publicly.
Follow these steps to install and configure the application:
- Clone the repository from GitHub:
$ git clone https://github.com/CodeGreen-Labs/climate-dash.git
- Install the dependencies:
$ npm install
- Download the related service:
$ npm run prepare
The application requires the following configurations:
- Copy
.env.example
file to.env
file in the root directory of the project. - Add the following configuration to the
.env
file like:
VITE_DATA_LAYER_END_POINT=https://cadt.codegreen.org/v1/
VITE_CLIMATE_TOKEN_DRIVER_URL=http://localhost:31314/v1/
VITE_CLIMATE_EXPLORER_CHIA_URL=https://explorer-cadt.codegreen.org/v1/
VITE_NETWORK = 0x02
VITE_API_CALL_TIMEOUT = 60000
CLIMATE_TOKEN_DRIVER_PORT=31314
CLIMATE_EXPLORER_CHIA_PORT=31313
Please make sure to include the .env file in your project and provide the necessary configurations.
Run the Vite development server.
$ npm run dev
To package the Electron app for distribution, you can use the following commands:
- Run the build command to build the project using TypeScript and Vite.
$ npm run build
This command packages the Electron app for the default platform.
- Package the Electron app for all platforms:
$ npm run package-all
These command packages the Electron app for Windows and macOS.
- Package the Electron app for Windows:
$ npm run package-win
- Package the Electron app for macOS:
$ npm run package-mac
Below is a list of available scripts you can use in this project with npm run
:
dev
: Run the Vite development server.build
: Build the project using TypeScript and Vite.test
: Run tests using Vitest.package
: Package the Electron app.package-all
: Package the Electron app for all platforms.package-mac
: Package the Electron app for macOS.package-win
: Package the Electron app for Windows.prerelease
: Create a pre-release version and push tags.release
: Create a patch release and push tags.eslint
: Run ESLint for code linting.prepare
: Run Vite Node to prepare the project.
Signed commits are required.
This repo uses a commit convention. A typical commit message might read:
fix: correct home screen layout
The first part of this is the commit "type". The most common types are "feat" for new features, and "fix" for bugfixes. Using these commit types helps us correctly manage our version numbers and changelogs. Since our release process calculates new version numbers from our commits it is very important to get this right.
feat
is for introducing a new featurefix
is for bug fixesdocs
for documentation only changesstyle
is for code formatting onlyrefactor
is for changes to code which should not be detectable by users or testersperf
is for a code change that improves performancetest
is for changes which only touch test files or related toolingbuild
is for changes which only touch our develop/release toolsci
is for changes to the continuous integration files and scriptschore
is for changes that don't modify code, like a version bumprevert
is for reverting a previous commit