Redwood Studio [Experimental]

Thanks @Josh-Walker-GM . Any quick workaround you think I can apply in the meantime ?

Hmm Iā€™m not totally sure. My immediate thought is editing the node_modules at ./node_modules/@redwoodjs/studio/dist-backend/index.js.

There should be a HOST and PORT variable near the top of that file which might help you out if you need studio to use different settings. There is also a line:

apiHost: `http://${webConfig.host}:${webConfig.port}`,

You might need to replace the webConfig values here as well.

Just need to be careful of these changes getting reset if the node_modules get reset.

Overriding the host works, thanks @Josh-Walker-GM.
Could you add it as an overridable variable in the studio config in the future ?

1 Like

Yeah Iā€™m working on some fundamental studio updates/refactoring so Iā€™ll note this down as a requirement.

I mostly got excited about impersonation, before realizing, that itā€™s only for the graphql endpoint used via studio.

Are there bits in here, that would allow implementing impersonation into our apps easier (or is it easy and I just never looked at it)

@razzeee Impersonation is very provider specific. The only one of our provider that I know supports impersonation is Clerk User Impersonation | Clerk

Feared that would be the case, I have my own provider implemented, so unsure how to tackle that.

Hi,
Is there a possibility of adding an admin site to the studio? I used to work with the Django web framework in python and really miss that capability, especially when starting a new project.

Essentially it would provide CRUD capability similar to scaffolding but with customizable forms/components that is applicable to the bootstrapping and administration of the main app. The custom forms and components would be able to run server-side scripts or any code that is reserved for users with admin roles. Perhaps the customized components can be defined in an ā€œadminā€ workspace in redwood projects.

1 Like

Hey @tvo! I donā€™t think we have any immediate plans for an admin panel like this but the interest in a solution to this problem is noted! We have thought about trying to introduce an inspect/browser for the database - something similar to prisma studio which you can already run easily with the redwood CLI - but we have not made any decisions on that yet.

Itā€™d be great to see a solution to this for sure. Perhaps a forum post on itā€™s own about admin panels might help out with some community insight or help spark off this work?

Hi @tvo

I just posted about this: RedwoodJS Admin Would that be kind of what youā€™re looking for?

Hi @Tobbe ,
It looks like a pretty sweet tool. Iā€™d be glad to play with it for a few days and provide feedback if youā€™d like. Iā€™m game for getting on a call too if needed. At first glance, Iā€™m particularly interested in the ā€œcustom actionā€ feature but donā€™t fully understand its capability.

As for my immediate need, I was able to make do with a few reusable scripts for the current project Iā€™m on.

We just released 11.4.0 which contains some important bug fixes and a few interesting preview features for SSR/OG image.

1 Like

I am getting an error with the update here to v11.4.0:

{"level":30,"time":1713558557727,"pid":9731,"hostname":"Ryans-Mac-mini.local","msg":"Running any seeding of the Prisma database"}
{"level":50,"time":1713558557789,"pid":9855,"hostname":"Ryans-Mac-mini.local","prisma":{"clientVersion":"5.8.1"},"message":"\nInvalid `import_db.db.oTelTraceSpanType.findUnique()` invocation in\n/Users/ryanquinn/Documents/projects/SwankyCloud/Redwood-Swanky/node_modules/@redwoodjs/studio/api/dist/lib/seed.js:26:65\n\n  23   colour: \"00B33C\"\n  24 }];\n  25 for (const spanType of defaultOTelTraceSpanTypes) {\nā†’ 26   const spanTypeExists = await import_db.db.oTelTraceSpanType.findUnique(\nError validating datasource `db`: the URL must start with the protocol `prisma://`","target":"oTelTraceSpanType.findUnique","timestamp":"2024-04-19T20:29:17.789Z","msg":"\nInvalid `import_db.db.oTelTraceSpanType.findUnique()` invocation in\n/Users/ryanquinn/Documents/projects/SwankyCloud/Redwood-Swanky/node_modules/@redwoodjs/studio/api/dist/lib/seed.js:26:65\n\n  23   colour: \"00B33C\"\n  24 }];\n  25 for (const spanType of defaultOTelTraceSpanTypes) {\nā†’ 26   const spanTypeExists = await import_db.db.oTelTraceSpanType.findUnique(\nError validating datasource `db`: the URL must start with the protocol `prisma://`"}

Not sure if this is a me problem with using Prisma accelerate in prod.
I bypass it locally so my prob db does start with prisma://, but I have my local setup bypassing accelerate so the local db starts with postgresql:// which is where the error is hitting.

It didnā€™t hit this error before the update.

Iā€™m not sure if Iā€™m missing something, but I am on RW 7.4.3 and upgraded RW Studio to 11.4. Whenever I run yarn rw studio, I see the sidebar come up, but I canā€™t access any of the various sections; I just see a blank screen. I checked the console and network tab, and I did see anything strange.

I also reverted my redwood.toml file to the default api url and Iā€™m still not seeing anything come through. Any ideas?

Nevermind it was an issue with my AD Blocker