onlook icon indicating copy to clipboard operation
onlook copied to clipboard

feat: daytona as an alternative provider

Open aditya162002 opened this issue 5 months ago • 4 comments

This PR adds support for both CodeSandbox and Daytona with a clean and flexible setup. It uses a simple adapter pattern so we can easily add more providers later without changing much code. All the important stuff, like API keys, stays safe on the server, and the client talks to it through a secure tRPC API. No matter which provider we use, the flow stays the same, making things easier to work with also test cases have been fixed too .Please review it, and let me know your feedback , i have refactored some code to do the same, thanks!!

Screenshot 2025-06-27 at 2 43 31 AM

[!IMPORTANT] Adds Daytona as an alternative provider to CodeSandbox using an adapter pattern, ensuring secure communication and consistent flow across providers.

  • Behavior:
    • Adds Daytona as an alternative provider to CodeSandbox using an adapter pattern.
    • Secure communication via tRPC API; consistent flow across providers.
    • Updates sandboxRouter in sandbox.ts to handle Daytona.
  • Adapters and Providers:
    • Introduces CodeSandboxAdapter and ServerSandboxAdapter in adapters.
    • Adds DaytonaProvider and CodeSandboxProvider in providers.
    • Implements SandboxAdapterFactory for adapter management.
  • Session and File Management:
    • Refactors SessionManager to support multiple providers.
    • Updates SandboxManager for file operations and session handling.
    • Adds getProviderType() in utils.ts for provider selection.
  • Testing and Configuration:
    • Updates tests in sandbox.test.ts for new provider logic.
    • Modifies next.config.ts for environment-specific configurations.
    • Adds dependencies in package.json and bun.lock.

This description was created by Ellipsis for fdf8ca4bae7e9f66ce5519d42ef3e2ab77549eee. You can customize this summary. It will automatically update as commits are pushed.

aditya162002 avatar Jun 26 '25 21:06 aditya162002

Someone is attempting to deploy a commit to the Onlook Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 26 '25 21:06 vercel[bot]

Fixes #2229

aditya162002 avatar Jun 26 '25 21:06 aditya162002

thanks @spartan-vutrannguyen for the feedback its really very helpful, i will try to reflect those changes asap!

aditya162002 avatar Jun 30 '25 12:06 aditya162002

Also looks like there's been a lot of conflicts popped up from some large changes in the codebase, could you also resolve the conflict by pulling from main?

Kitenite avatar Jun 30 '25 16:06 Kitenite

@Kitenite @spartan-vutrannguyen did we change anything, the project is not able to run locally??i was testing daytona

aditya162002 avatar Jul 21 '25 17:07 aditya162002