# tbDEX and Web5 Application Creator
A premium Getting Started experience for developers of new tbDEX and Web5 Applications.
* Bootstraps functional greenfield and example applications, complete with testsuites
* Delivers a quick win for developers within minutes
* Opens the whiteglove experience that TBD provides for strategic partners for self-service by a global audience
* Invites content contribution from the community
* Designed for extensibility
**Value Props**
_Consumer Community_ - A guided, simple and powerful way to get started with various application types in TBD's ecosystem of projects, principally tbDEX and Web5.
_Contributor Community_ - A templated mechanism to share bootstrap or example applications with the broader community. Lends visibility to their work and places the source upstream for future maintenance and upgrades.
_Developer Relations_ - A new delivery vehicle for content. Supplements the documentation publishing toolsets on `developer.tbd.website`. Delivers runnable content, tested and maintained, to the community. Creates a repository for new content and offers all the benefits of the contributor community to TBD engineers.
_Core Engineering Teams_ - Proves out features and real world use cases for TBD ecosystem projects. Drives contribution to projects through lowering barriers to entry for new contributors. Places prototype and examples from our teams into maintained, long-term assets.
**Proposed Architecture**

## Proposed Phases
### Milestone 0️⃣
ALR to type up soon based on meeting 1/9/24.
Summary of call and discussion is [here].
Revive tutorials repo which is archived [here](https://github.com/TBD54566975/tbd-tutorials).
(https://discord.com/channels/937858703112155166/1184979120409559131/1194387518792138863).
Notes from call:
* Explore two avenues:
* Awesome-style page to show community-stewarded examples
* With guidelines for inclusion in this list, to be determined
* Structured template delivery mechanism through App Creator, bootstrapping the Getting Started experience through a guided list of questions for the developer to choose their desired template and impl languages/frameworks/default values
* Set up examples repo with structure and metadata that can be read by an eventual creator system
* Accommodate:
* Choice of template (inferred from repo structure)
* Choice of language (inferred from repo structure)
* Choice of framework (inferred from repo structure)
* App-specific questions (from metadata in the template)
* Freeform input
* Validated input (Set of options, URL, freeform Regex, number, etc)
* None of this work is to interrupt tbDEX 1.0
* It does, however, give a look-ahead to consumption and contribution goals following tbDEX 1.0 release, so keeping momentum is important

### Milestone 1️⃣
* Create Application Creator and run as a service
* Create `git` repository to house application examples
* Select initial bootstrap applications or examples
* Getting Started with Web5 Applications (Kirah's starter example?)
* And from various frameworks from `bundler-bonanza`
* Maybe: deliver applications as PWAs (per Daniel recommendation.)
* Define application with DevRel and Web5 team
* Create CLI
* Does not need to be written in the same language as the example apps that the creator system delivers - this gives us language independence between the creator system and the example apps delivered. To the CLI it's all just writing text files as they're retrieved from the examples repo (AppStore).
* `npx create-tbdex-app`
* Or: Rust CLI? Does this need to be in the `npm` ecosystem? We're targeting more langs than this. IMO (ALR) better as a standalone app?
* For instance [jBang installs](https://www.jbang.dev/download/) via `curl`, `sdkman`, `brew`, others
#### User Experience
* User selects Getting Started application type (may only be one option to start, for Web5 applications)
* User selects desired language / framework
* Creator service, from AppStore/catalog, creates and customizes application for the user
* Application folder is created in the `pwd`
* User is given in `README` instructions to run
* Runnable commands include:
* To run in a server
* To run full testsuite validating the application
* When running in a server, developer is presented with home page welcoming them to the application. The console there contains controls to prove the application is running fully, or mocked where appropriate.
* All applications of a particular type, no matter which backing language or framework is used for implementation, are functionally and visually equivalent.
### Milestone 2️⃣
* Add web application interface for the Creator. Use the same UX identified above, for instance at an address like `creator.tbd.website`
* Through OAuth, user may directly save in their GitHub personal namespace or an organization they control
* Add same support to UX for CLI
* Introduce new application type to the AppStore/catalog
* Web5 Examples
* Chat?
* ...to be determined
### Milestone 3️⃣
* Add support for further languages
* Kotlin
* Swift
* Dart
* Add support for emerging tbDEX use cases
When ready, apply the same format of create-web5-app for tbDEX in its various output languages (JS/TS, Kotlin, Swift).
### Milestone 4️⃣
* Add support for "Describe your application"
* AI-powered application creation
* Previewing live in web page before generating to download/put into GitHub repo
## Catalog Applications
_Rough ideas now_; team flesh out use cases and application ideas here.
### Web5
* The Web5 QuickStart
* A very minimal application, designed to be easily readable and without lots of scaffolding
* Getting Started with Web5 - The Comprehensive Application
* A Welcome application demonstrating Web5 features (clickable, live), and how to use them
* CRUD for DWNs
* Creating (and publishing?) a DID in various methods
* `did:key`
* `did:web`?
* `did:dht`?
* Sending a DWN message
* Subscribing to receive messages
* Showing connected DWNs and connecting to DWNs
* Running your own
* The TBD hosted instance
* The embedded instance on a web page
* Existing examples from the DevRel suite?
* Dinger?
* ...and others from Web5 team prototyping labs?
### tbDEX
_Address core audiences_:
* Wallet
* PFI
* Issuer
## Implementation Considerations
* Interactive CLI - [Clack](https://github.com/natemoo-re/clack)
* CLI and docs that support multiple JS sdks, programming languages, and community supported languages - [Sentr](https://docs.sentry.io/platforms/?original_referrer=https%3A%2F%2Fwww.google.com%2F)
## Open Questions
* Is `bundler-bonanza` still a valid base for this work? Does the existing suite shift into the initial application store (in the Web5 case)?
* Leo - please review for application of AI efforts and how they may be implemented to create applications by the user's description
## Non-Exhaustive List of Examples
* https://github.com/TBD54566975/developer.tbd.website/tree/main/examples
* https://github.com/kirahsapong/create-web5
* https://github.com/TBD54566975/create-web5-app
* https://github.com/TBD54566975/tbdex-pfi-exemplar
* https://github.com/TBD54566975/kcc-prototype-exemplar
* https://github.com/TBD54566975/tbdex-example-ios
* https://github.com/TBD54566975/tbdex-example-android
* https://github.com/TBD54566975/example-pfi-aud-usd-tbdex
* https://github.com/TBD54566975/pfi-guide-example
* https://github.com/TBD54566975/dinger
## Meeting Notes
https://hackmd.io/u7udCtUMRwiWHliu4QEJQQ