Are there any TS frameworks that are good for writing REST APIs compatible with Refine?
Any packages/tools that add the guardrails. I realize it's just a convention, but having some type safety around response crafting and things like sorting would be helpful.
5 Replies
Hi @m0ltz. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information from the knowledge sources, one potential TypeScript framework that could be used for writing REST APIs compatible with Refine is NestJS. Refine has excellent support for NestJS, specifically with data providers for APIs implemented with Nest.js CRUD (https://refine.dev/docs/data/packages/nestjsx-crud) and Nest.js Query (https://refine.dev/docs/data/packages/nestjs-query/). These modules can help simplify creating CRUD RESTful APIs and provide type safety, which can be beneficial for ensuring consistency and reducing errors in API response crafting.
Additionally, the GitHub issue mentions ts-rest (https://www.npmjs.com/package/@ts-rest/core) as a tool that offers type safety without the need for code generation. It allows defining the API contract in TypeScript, which can be useful for maintaining consistency between the frontend and backend.
For more information on how to integrate these with Refine, you can explore the following resources:
- Nest.js CRUD Data Provider (https://refine.dev/docs/data/packages/nestjsx-crud)
- Nest.js Query Data Provider (https://refine.dev/docs/data/packages/nestjs-query/)
If you need further details, you might want to check out the Refine documentation (https://refine.dev/docs/#key-features) for a comprehensive list of supported backend services and integrations.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@164977990000705536> kapa.ai is still learning and improving, please let us know how it did by reacting below
xenial-blackOP•2mo ago
@kapa.ai link to gh issue talking about ts-rest?
Let me check the knowledge base for you. One moment! :books:
----------------------
Certainly! You can find the discussion about
ts-rest
in the GitHub issue titled "[FEAT] TS-Rest Data Provider" on the Refine GitHub repository. Here is the link to the issue:
- GitHub Issue: [FEAT] TS-Rest Data Provider (https://github.com/refinedev/refine/issues/6194)
This issue discusses the potential benefits of using ts-rest
for type safety in REST APIs and explores the idea of developing a data provider for it.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@164977990000705536> kapa.ai is still learning and improving, please let us know how it did by reacting below