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

Project template scaffold CLI #501

Open
flossypurse opened this issue Dec 18, 2024 · 20 comments
Open

Project template scaffold CLI #501

flossypurse opened this issue Dec 18, 2024 · 20 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@flossypurse
Copy link
Contributor

We need something like resonate create to scaffold a new project in the language of the developer's choice.

Some initial requirements:

  • Needs to support multiple SDKs (prioritize Python, but build it so we can add others)
  • Let the developer choose their dependency & environment manager
  • Offer 3 different templates:
    • simple script
    • http gateway app node
    • remotely invoked app node (Event().wait() )
@flossypurse flossypurse added enhancement New feature or request good first issue Good for newcomers labels Dec 18, 2024
@muhammad-asghar-ali
Copy link

muhammad-asghar-ali commented Jan 10, 2025

Hey, I think the idea is very unique and solve the basic problem in distributed systems and add to the fundamental to the distributing systems. I want to understand more about the idea and contribute to it.

I think this issue will help me to learn more about the idea and also needed some help and abstract overview about project, so that will take up this issue and start contributing.

So I think we implement like this Add callback cli command. If I'm wrong please correct me.

About me: I'm a basic to intermediate golang programmer and want to learn more.

@dfarr
Copy link
Member

dfarr commented Jan 10, 2025

Hi @muhammad-asghar-ali thanks for you interest in our project!

Your intuition is exactly right, we need an additional cobra command called create that will generate the sdk code for a new resonate app. I imagine we could start this feature from either side:

  1. start with the golang cli command
  2. start with the sample python applications

For (1) there is little requisite knowledge, we can just get started right away. For (2) we would need sample sdk apps, which would require working with the python sdk.

Let me know which side you prefer to start with and we can go from there.

I do have one opinion on how we should implement this feature. When we create a sample app I think we should clone a known repo from the resonatehq org containing the app code. This way we will end up maintaining a library of sample app repos which can be updated independently of this repo.

@muhammad-asghar-ali
Copy link

Thanks @dfarr, so my understanding is like we need a cli command which creates a project based on the language. So for example, a JS or TS app creation via resonate cli command with automatic setup of resonate's sdk and same goes for Python. here are some questions about the implementation.

  1. I want to understand from which option gives the best result and will extend for more language stack like JS.
  2. So now we are adding the sdk code manually to the application and what are the components will generate by the cli command.
  3. What do you mean by cloning the known repo from the resonatehq org containing the app code.

Here is a idea about the design

image

@dfarr
Copy link
Member

dfarr commented Jan 13, 2025

Nice, I like the design of your cli a lot!

clone a known repo from the resonatehq org containing the app code

I think we should maintain a collection of repos containing the scaffolding code, for example:

  • scaffold-py-hello-world
  • scaffold-js-hello-world

When a user specifies that they want to create a new project we can simply clone this repo to a local directory. We could go one step further and use a project like cookiecutter to permit templating, but I would prefer to get started with a simple clone as-is.

@muhammad-asghar-ali
Copy link

Yes I understand you point and refine the design more and also working of a cli command side. And understand the template repo structure. But we need to decide what kind of templates and also define the code structure based on sdk.

In simple words resonate command accept some param and based on that params it clone the template project for user on local.

image

@dfarr
Copy link
Member

dfarr commented Jan 14, 2025

This looks great! If you like I could create a simple repo with an empty README that we could use as a template for now to get started? If you can work on the cli side we could get started on the sample code side in parallel.

@muhammad-asghar-ali
Copy link

Yes, sure please create the the repo and I'm working on cli side as well. So we can work in parallel.

@dfarr
Copy link
Member

dfarr commented Jan 15, 2025

Done! https://github.com/resonatehq/scaffold-py

@muhammad-asghar-ali
Copy link

Thanks, will look into it asap.

@muhammad-asghar-ali
Copy link

Done! https://github.com/resonatehq/scaffold-py

Hey @dfarr, is this the private repo?

@dfarr
Copy link
Member

dfarr commented Jan 16, 2025

Whoops, I guess the default is private, it's public now!

@muhammad-asghar-ali
Copy link

Hey @dfarr, a quick question about the scaffold-py. Can I fork this or direct clone it?

@flossypurse
Copy link
Contributor Author

flossypurse commented Jan 17, 2025

@muhammad-asghar-ali - do you have Discord?
If so, feel free to join the #resonate-engineering channel in the Resonate Discord Server - https://resonatehq.io/discord
That is a great way to have real-time communication with the team.

@dfarr
Copy link
Member

dfarr commented Jan 17, 2025

Hey @dfarr, a quick question about the scaffold-py. Can I fork this or direct clone it?

I added you to the repo :)

@muhammad-asghar-ali
Copy link

muhammad-asghar-ali commented Jan 17, 2025

@muhammad-asghar-ali - do you have Discord? If so, feel free to join the #resonate-engineering channel in the Resonate Discord Server - https://resonatehq.io/discord That is a great way to have real-time communication with the team.

Hey @flossypurse, sure I can join

@muhammad-asghar-ali
Copy link

muhammad-asghar-ali commented Jan 20, 2025

Hey @dfarr I have a question, for scaffold-py are we planning to use the Flask framework (with rye), or is there another approach we should follow?

@dfarr
Copy link
Member

dfarr commented Jan 20, 2025

I would prefer to have a super basic app with have zero dependencies, we could do something as simple as an add function.

@resonate.register
def add(ctx, a, b):
  return a + b

@flossypurse what are you thinking for the default scaffolding?

@muhammad-asghar-ali
Copy link

muhammad-asghar-ali commented Jan 21, 2025

I would prefer to have a super basic app with have zero dependencies, we could do something as simple as an add function.

@resonate.register
def add(ctx, a, b):
  return a + b

@flossypurse what are you thinking for the default scaffolding?

Hi @dfarr, Thanks for clarifying. Working on it. But I think we should have the resonate dependency like via pip or other options?

@muhammad-asghar-ali
Copy link

Hey @dfarr unable to push change in scaffold-py getting the permission error says

ERROR: Permission to resonatehq/scaffold-py.git denied to muhammad-asghar-ali.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

To Note:

Tested on both type of clone simple https and ssh

Need your guidance related to this. Thank you

@dfarr
Copy link
Member

dfarr commented Jan 21, 2025

Just changed your permissions to write, please try again. We will probably change the code in that repo before we go live with this feature so even if there is only a README in there that is okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: In progress
Development

No branches or pull requests

3 participants