-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3276 from energywebfoundation/master
- Loading branch information
Showing
232 changed files
with
6,795 additions
and
3,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
"private": true, | ||
"dependencies": { | ||
"prettier": "2.5.1", | ||
"pretty-quick": "3.1.2" | ||
"pretty-quick": "3.1.3" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
# Architecture | ||
# Energy Web Origin Architecture | ||
Energy Web Origin is comprised of a user interface, a backend, and multiple SDKs that can be used individually, or in conjunction with each other. Each SDK is composed of one or several NPM packages. | ||
|
||
 | ||
|
||
## SDK API Packages | ||
Each SDK has an API package: | ||
|
||
- [Device Registry API](./device-registry/device-registry-api.md) (@energyweb/origin-device-registry-api) | ||
- [Issuer API](./traceability/packages/issuer-api.md) (@energyweb/issuer-api) | ||
- [Exchange API](./trade/exchange.md) (@energyweb/exchange) | ||
|
||
The API package has one or several NestJS modules in the /pods directory. Each module contains code relevant for a specific feature. In general, each NestJS module has: | ||
|
||
+ A [controller](https://docs.nestjs.com/controllers) that manages requests and responses to the client | ||
+ A .entity file that maps an entity to the database repository | ||
+ A .service file that provides methods to fetch and transform data | ||
+ [Data Transfer Object (DTO) file(s)](https://docs.nestjs.com/controllers#request-payloads) that provide Data Transfer Objects, which are representations of the data that are exposed to the endpoint consumer | ||
+ A [module](https://docs.nestjs.com/modules) class that is used by NestJS to structure the application | ||
|
||
### Data Persistence | ||
API services fetch, update and persist data. Data is persisted using [PostgreSQL](https://www.postgresql.org/), and [TypeORM](https://typeorm.io/#/) is used to integrate the database into the NestJS application. You can view the SDK's database connection configuration in each SDK's typmeorm.ts file. | ||
|
||
### Events and Commands | ||
In addition to services, the NestJS modules use [Commands](https://docs.nestjs.com/recipes/cqrs#commands) and [Events](https://docs.nestjs.com/recipes/cqrs#events) to encapsulate logic and, in the case of an event, respond asynchronously to something that has occured in the application. Events and commands are emitted and responded to within and between an SDK's packages using the [NestJS CQRS module](https://docs.nestjs.com/recipes/cqrs). | ||
|
||
|
||
## Smart Contracts | ||
The Issuer (@energyweb/issuer) and Exchange Token Account (@energyweb/exchange-token-account) packages contain their respective SKD's smart contracts. | ||
|
||
- See documentation for Issuer smart contracts [here](./traceability/contracts/Issuer.md#smart-contracts) | ||
- See documentation for the Exchange Token Account smart contract [here](./trade/exchange-token-account.md) | ||
|
||
### Deployment | ||
The Issuer and Exchange Token Account packages use [Truffle to compile](https://trufflesuite.com/docs/truffle/getting-started/compiling-contracts.html) and migrate smart contracts. | ||
|
||
### Blockchain Libraries | ||
- Packages use [ethers](https://docs.ethers.io/v5/) to interact with smart contracts on the blockchain. | ||
|
||
- The Issuer and Exchange Token Account packages use [typechain](https://github.com/dethcrypto/TypeChain#readme) to generate TypeScript classes for smart contracts. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.