stellar / soroban-example-dapp

End-to-End Example Soroban Dapp
Apache License 2.0
1.03k stars 830 forks source link

Make this behave more like a `--frontend-template` #151

Open chadoh opened 1 month ago

chadoh commented 1 month ago

pre-req: #150

What problem does your feature solve?

The Getting Started tutorial has you create a frontend app using

soroban contract init --frontend-template https://github.com/stellar/soroban-astro-template

That frontend template is nice, because it expects that it was used with soroban contract init, and that it thus has a contracts folder with an unknown set of contracts in it. It's made in a generic way to allow you to quickly get started with any of those contracts.

This repository, on the other hand, has a hard-coded list of contracts. It also has a fairly built-out UI that interacts with them, using an opinionated atoms/molecules/organisms component organization approach.

What would you like to see?

This repository should function a bit more like a template. Maybe it can still have a hard-coded example contract, because it does have some interesting custom behavior around event subscriptions (see the useSubscription hook) that's hard to figure out on one's own.

The idea of these templates is that anyone can create them, and then perhaps SDF can create a community program for template maintainers to receive funding for creating and keeping up these templates. We could also list these somewhere in our docs, or encourage a naming strategy that makes them easy to find on GitHub. Perhaps at that point, this repo could be transferred to a community maintainer, rather than being part of the official stellar org.

Given that the "official" template uses vanilla JS, via Astro's templating system, and this one uses Next.js and React, it probably makes sense to continue to have both on offer, since which one chooses is a matter of preference.