stellar / stellar-docs

Documentation for Stellar
https://developers.stellar.org
Apache License 2.0
45 stars 101 forks source link

Create a comprehensive frontend guide for building functional user interfaces for dapps using a terminal user interface (TUI) #655

Open briwylde08 opened 3 weeks ago

briwylde08 commented 3 weeks ago

Get awarded: up to $1,000 worth of XLM Section: How-To Guides - Dapp Development: https://github.com/stellar/stellar-docs/tree/main/docs/smart-contracts/guides/dapps

pius commented 3 weeks ago

@briwylde08 thanks for opening this! I'd like to take this on as per the discussion at #612 😀

@ElliotFriend thanks for the vote of approval! you asked:

I'm curious what [“just meant to be served over ssh instead of http”] means "mechanically." Is there some "backend" service that the TUI would interact with (assuming via SSH)? Or, is the TUI interacting directly with contract that's deployed on-chain (like if the TUI is itself building/simulating/submitting transactions, querying rpc, etc.; or maybe kinda like if someone made a "wrapper" around the Soroban-CLI to interact with a specific contract, if that makes sense)?

just to level set for anyone reading, it's good to remember that SSH is the "Secure SHell protocol" — so when we "SSH" into a computer, we're just asking the SSH server to securely present a shell program so that we can interact with the computer. typically that shell program is something like Bash, but it can be any program we want! so at the most basic mechanical level, if one wanted to serve this over SSH, they would just have their SSH server present our custom TUI as the shell.

how precisely the TUI interacts with the contract is really just a design choice. of course, one can certainly just build the transactions from scratch, but the approach I'm going highlight is how to go with the grain of the UNIX philosophy and the Soroban ecosystem.

so I'm going to orient my guide around an architecture leveraging the power of that combination =)

ElliotFriend commented 3 weeks ago

This sounds awesome! I'm really excited to see how it shapes up!!

silence48 commented 3 weeks ago

@briwylde08 I have created a guide for making a Terminal interface for the comet liquidity pool contracts; using typescript and the node library 'inquirer' I also created a repository with the example project so it's easier to follow along at https://github.com/silence48/Comet-TUI The pull request is #665 Hoping we see some more examples, would love to see a simple bash script that uses soroban-cli and maybe a python and a ruby implementation! Powershell would be cool too! I also am hoping people who build on top of the typescript one i published will merge back any good updates to my repo :)

Thanks That was fun.

briwylde08 commented 3 weeks ago

This is great @silence48! Excited to take a look. @pius please feel free to continue your own work on this prompt!