-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d2b2e4
commit 83fbb89
Showing
3 changed files
with
15 additions
and
10 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 |
---|---|---|
|
@@ -5,21 +5,25 @@ A guide on how to contribute to this project. | |
# Getting Started | ||
|
||
Clone the project | ||
|
||
```bash | ||
git clone [email protected]:algorandfoundation/hack-tui.git | ||
``` | ||
|
||
Change to the directory | ||
|
||
```bash | ||
cd hack-tui | ||
``` | ||
|
||
Build the project | ||
|
||
```bash | ||
make build | ||
``` | ||
|
||
Running a Participation Node | ||
|
||
```bash | ||
docker compose up | ||
``` | ||
|
@@ -47,7 +51,7 @@ Launch the TUI | |
``` | ||
|
||
There are three top level modules (**cmd**, **internal**, **ui**) which align with the GoLang/Charm ecosystem. | ||
There is an additional code-generated module called **api** which should not be edited by hand. | ||
There is an additional code-generated module called **api** which should not be edited by hand. | ||
See [generating rpc package](#generating-rpc-package) for more information | ||
|
||
All submodules and endpoints **SHOULD** align with the command/ui namespaces. | ||
|
@@ -59,6 +63,7 @@ hacktui status | |
``` | ||
|
||
Example Structure | ||
|
||
```bash | ||
├── cmd/status.go | ||
├── internal/status.go | ||
|
@@ -68,6 +73,7 @@ Example Structure | |
All submodules **SHOULD** abstract when appropriate to a submodule. | ||
|
||
Example Refactor | ||
|
||
```bash | ||
├── cmd/status/root.go | ||
├── internal/status/model.go | ||
|
@@ -92,8 +98,8 @@ Effectively this package is the "controller" in MVC | |
### 🪨 internal | ||
|
||
Common library code which includes the models and business logic | ||
of the application. | ||
It's main responsibility is constructing the state used in the TUI. | ||
of the application. | ||
Its main responsibility is constructing the state used in the TUI. | ||
This package is considered the "Model" in MVC | ||
|
||
- **SHOULD** be used to hold models. | ||
|
@@ -102,9 +108,9 @@ This package is considered the "Model" in MVC | |
|
||
### 💄 ui | ||
|
||
Elements to be presented to the user. | ||
Elements to be presented to the user. | ||
This is built on the `bubbletea` abstraction. | ||
This package is the ViewModel and View in MVC. | ||
This package is the ViewModel and View in MVC. | ||
|
||
- **SHOULD** be used to build bubbletea interfaces. | ||
- **SHOULD** be named by the component it represents. | ||
|
@@ -113,10 +119,9 @@ This package is the ViewModel and View in MVC. | |
- **SHOULD** contain ViewModel state like "IsVisible" | ||
- **SHOULD NOT** contain any model or CLI specific code (ViewModels/tea.Models should be composed of internal Models for testability). | ||
|
||
|
||
# Generating RPC package | ||
|
||
The `api` package is generated via [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen). | ||
The `api` package is generated via [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen). | ||
Its configuration is found under `generate.yaml` and can be run with the following make command: | ||
|
||
```bash | ||
|
@@ -127,4 +132,4 @@ The full command for reference | |
|
||
```bash | ||
oapi-codegen -config generate.yaml https://raw.githubusercontent.com/algorand/go-algorand/v3.26.0-stable/daemon/algod/api/algod.oas3.yml | ||
``` | ||
``` |
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