Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive Playground #348

Merged
merged 20 commits into from
Jan 14, 2025
Merged

Interactive Playground #348

merged 20 commits into from
Jan 14, 2025

Conversation

ulrikandersen
Copy link
Collaborator

@ulrikandersen ulrikandersen commented Jan 10, 2025

What if we gave everyone the opportunity to try Fabrikt with minimal investment? Could it motivate people to invest the time and effort needed to integrate Fabrikt into their projects and thereby drive adoption? What would it take to build such a thing?

This idea sparked the creation of an initial version of an interactive playground.

While it brings absolutely zero improvements to the code generation aspects of Fabrikt, I had fun making it, and perhaps it will be useful for people.

It is currently structured as a Gradle module and part of the main repository. It could also be split out into a separate repository (which would align with how the Gradle plugin is maintained).

It uses a blend of Ktor, Kotlin HTML DSL, a dash of HTMX, and some excellent libraries for YAML editing and Kotlin syntax highlighting.

The current initial version is deployed to Fly.io and costs very little to run (so far $0, as the machine suspends when idle and usage below $5 is not billed). It is available at [...], but if we choose to make an official tool, it should probably be something like try.fabrikt.dev.
Update: It is now on fabrikt.fly.dev.

Update: The playground supports deeplinking to generation settings which could become useful when debugging an issue. The actual spec is not included in the deeplink, but that's a feature we could add later (would require storing the spec somewhere).
Deeplink example: Models & Micronaut Controllers

I’d love to hear your thoughts on this idea and get feedback on the current version.

I am also completely OK with ditching the idea if you don’t believe it brings value to the project.

What do you think?

@cjbooms
Copy link
Owner

cjbooms commented Jan 10, 2025

This is very cool. Nice work! 💯

@cjbooms
Copy link
Owner

cjbooms commented Jan 10, 2025

Happy to have this merged as-is if you are happy. We can look to move to a GH org later.
I guess we just need a link on the primary README to the deployed version

@cjbooms
Copy link
Owner

cjbooms commented Jan 10, 2025

👍

@@ -38,6 +38,10 @@ enum class ClientCodeGenTargetType(val description: String) {
OPEN_FEIGN("Generate OpenFeign client.");

override fun toString() = "`${super.toString()}` - $description"

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is just an unrelated refactor? I have no issue with it either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is only to allow referencing the default setting from both the CLI and the Playground.

@ulrikandersen
Copy link
Collaborator Author

Happy to have this merged as-is if you are happy. We can look to move to a GH org later. I guess we just need a link on the primary README to the deployed version

Great! Thanks for taking a look!

I would like to configure automatic deployment to Fly.io, and that requires configuring a repository secret FLY_API_TOKEN. Can you do that if I provide you with the secret via a secure channel?

@ulrikandersen
Copy link
Collaborator Author

ulrikandersen commented Jan 10, 2025

I guess we just need a link on the primary README to the deployed version

Too prominent? 🙈 https://github.com/cjbooms/fabrikt/blob/5c7161cc9bee23bc4c97a70ea8bde0d8525b4a42/README.md#try-fabrikt-online

@ulrikandersen
Copy link
Collaborator Author

I guess we just need a link on the primary README to the deployed version

Too prominent? 🙈 https://github.com/cjbooms/fabrikt/blob/5c7161cc9bee23bc4c97a70ea8bde0d8525b4a42/README.md#try-fabrikt-online

Or even as a tip? https://github.com/ulrikandersen/fabrikt/blob/5397e9d9ef981fef64c473b354b3b9179908cc7c/README.md

Depends on how much you believe in the idea.

@cjbooms
Copy link
Owner

cjbooms commented Jan 10, 2025

I guess we just need a link on the primary README to the deployed version

Too prominent? 🙈 https://github.com/cjbooms/fabrikt/blob/5c7161cc9bee23bc4c97a70ea8bde0d8525b4a42/README.md#try-fabrikt-online

Or even as a tip? https://github.com/ulrikandersen/fabrikt/blob/5397e9d9ef981fef64c473b354b3b9179908cc7c/README.md

Depends on how much you believe in the idea.

What about reducing the intro and placing it immediately after?
https://github.com/cjbooms/fabrikt/blob/cjbooms-patch-1/README.md

@cjbooms
Copy link
Owner

cjbooms commented Jan 10, 2025

Happy to have this merged as-is if you are happy. We can look to move to a GH org later. I guess we just need a link on the primary README to the deployed version

Great! Thanks for taking a look!

I would like to configure automatic deployment to Fly.io, and that requires configuring a repository secret FLY_API_TOKEN. Can you do that if I provide you with the secret via a secure channel?

Are you sure you can't already configure ENV variables? If not, sure I can add them. Ping me on gchat: cjbooms at gmail, or let me know your preferred comms.

@ulrikandersen
Copy link
Collaborator Author

What about reducing the intro and placing it immediately after? https://github.com/cjbooms/fabrikt/blob/cjbooms-patch-1/README.md

I like that! I've updated the PR.

Are you sure you can't already configure ENV variables? If not, sure I can add them. Ping me on gchat: cjbooms at gmail, or let me know your preferred comms.

I cannot access the Settings tab at all. I'll reach out via gchat 👍

@ulrikandersen
Copy link
Collaborator Author

I added the possibility to deeplink to a set of settings. Perhaps that's useful when debugging an issue. Spec will still have to be input manually as we would otherwise need to store it somewhere (could be implemented at a later stage).

@ulrikandersen
Copy link
Collaborator Author

@cjbooms I believe this is good to go, but please feel free to take a final look and perhaps also test the deeplinking!

README.md Outdated Show resolved Hide resolved
@cjbooms cjbooms merged commit 76a088d into cjbooms:master Jan 14, 2025
1 check passed
@cjbooms
Copy link
Owner

cjbooms commented Jan 14, 2025

I am blown away by this feature. It is so cool! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants