Using a CMS with the t3 stack?
Say I'm building an e-commerce site and I need to give the client the ability to add/delete/edit products, should I use a CMS or just write this on my own? I looked into Sanity, but it looks like everything defined there is fetched via a REST api so I basically lose all the meaning of an end-to-end typesafety and type completions
8 Replies
I'm in a similar situation and I have looked into Strapi a bit, its also via Rest but they give you all the types you define in the CMS, its not as easy as using trpc, but it works
So my conclusion is that it's better to write a solution on your own, you get these sweet type completions when writing the 'admin' panel
yeah
But that is a ton of work
what do you mean by the give you all the types?
you get the data as json right?
You can build types from your data schemas
Similar to how you generate the types with prisma
And then you can just import your types from a file and use them as normal
Its just not inferred
sounds like a good solution
thanks 🙂
Typescript - Strapi Developer Docs
Learn how you can use Typescript for your Strapi application.
Under generate typings from project schemas
I haven't actually used it much, but this is how it should work