A typesafe REST API ensures data consistency, reduces errors, and enhances developer productivity by enforcing strict data type checks at compile time. It provides clear documentation, improves code maintainability, and facilitates seamless integration and scalability of services.
Using TS-Rest, we declare contracts to be the basis of the interaction between the client and the server.Everything is defined and typed using Zod Schema in the contracts.For example:
One of the biggest differences between tRPC and ts-rest is that tRPC defines your API implementation as the contract, for some use cases it is beneficial to have a separate contract to represent the API.TS-Rest offers a plethora of frontend wrappers like react-query or solid-query but what if you want to consume the API on a micro-controller?Well, do not worry, you can just consume it like a normal Rest API.
You will not get the typed definition this way but atleast you can consume it.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Rapid","colors":{"primary":"#50F","light":"#9966ff","dark":"#220066"},"favicon":"/favicon.svg","logo":{"light":"https://mintcdn.com/rapid/RiDGmZn_AA7WdGax/logo/logo_new_symbol.png?fit=max\u0026auto=format\u0026n=RiDGmZn_AA7WdGax\u0026q=85\u0026s=f3a8b1f4d701dd3276f01ce292c0778c","dark":"https://mintcdn.com/rapid/RiDGmZn_AA7WdGax/logo/logo_new_symbol.png?fit=max\u0026auto=format\u0026n=RiDGmZn_AA7WdGax\u0026q=85\u0026s=f3a8b1f4d701dd3276f01ce292c0778c"},"navbar":{"links":[{"label":"Support","href":"mailto:hello@prakharshukla.dev"}],"primary":{"type":"button","label":"GitHub","href":"https://github.com/imprakharshukla/rapid"}},"seo":{"metatags":{"og:image":"https://mintlify.s3-us-west-1.amazonaws.com/rapid/logo/rapid_og_image.png","og:title":"Rapid- A typestrong starter","og:description":"Rapid a starter kit to jumpstart your typeful apps. It is a monorepo that is built on top of Next.js, ExpressJS, Prisma, TS-Rest.","twitter:image":"https://mintlify.s3-us-west-1.amazonaws.com/rapid/logo/rapid_og_image.png","twitter:title":"Rapid- A typestrong starter","twitter:description":"Rapid a starter kit to jumpstart your typeful apps. It is a monorepo that is built on top of Next.js, ExpressJS, Prisma, TS-Rest.","twitter:card":"summary_large_image","twitter:site":"@imprakharshukla","twitter:creator":"@imprakharshukla","og:type":"website","og:url":"https://rapid.prakhar.codes","og:site_name":"Rapid","og:locale":"en_US"},"indexing":"navigable"},"footer":{"socials":{"x":"https://x.com/imprakharshukla","github":"https://github.com/imprakharshukla","website":"https://prakhar.codes"}},"navigation":{"global":{"anchors":[{"anchor":"Creator","href":"https://prakhar.codes","icon":"user"},{"anchor":"Demo","href":"https://rapid.prakhar.codes","icon":"laptop"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rapid","hasAudioNarration":false,"actualSubdomain":"rapid","customDomains":["rapiddocs.prakhar.codes"],"gitSource":{"type":"github","owner":"imprakharshukla","repo":"rapid-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae91fc4804c2f07efa92c06:success","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Documentation","count":14},{"language":"default","tag":"API","count":4},{"language":"default","tag":"Auth","count":3},{"language":"default","tag":"Packages","count":3},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"UI","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api/introduction","slug":"/api/introduction","pageMetadata":{"title":null,"description":null,"href":"/api/introduction"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`One of the main benefits of the Rapid starter is the typesafe Rest API powered by TS-Rest and Express.`}),`\n`,_jsx(Heading,{level:`3`,id:`why-do-we-need-a-typesafe-rest-api`,children:`Why do we need a typesafe REST API?`}),`\n`,_jsx(_components.p,{children:`A typesafe REST API ensures data consistency, reduces errors, and enhances developer productivity by enforcing strict data type checks at compile time. It provides clear documentation, improves code maintainability, and facilitates seamless integration and scalability of services.`}),`\n`,_jsx(Heading,{level:`2`,id:`express`,children:`Express`}),`\n`,_jsxs(_components.p,{children:[`Our ExpressJS implementation is inspire from the `,_jsx(_components.a,{href:`https://github.com/santiq/bulletproof-nodejs`,children:`Bullet-Proof NodeJS Guide`}),`.`]}),`\n`,_jsx(_components.p,{children:`It supports:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Logging`}),`\n`,_jsx(_components.li,{children:`Dependency Injection`}),`\n`,_jsx(_components.li,{children:`Seperation using routes, services and interfaces.`}),`\n`,_jsx(_components.li,{children:`Out-of-the-box Open-API spec.`}),`\n`,_jsxs(_components.li,{children:[`Beautiful Reference page using `,_jsx(_components.a,{href:`https://github.com/scalar/scalar`,children:`Scaler`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`ts-rest`,children:`TS-Rest`}),`\n`,_jsx(_components.p,{children:`Using TS-Rest, we declare contracts to be the basis of the interaction between the client and the server.`}),`\n`,_jsx(_components.p,{children:`Everything is defined and typed using Zod Schema in the contracts.`}),`\n`,_jsx(_components.p,{children:`For example:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`initContract`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@ts-rest/core\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`z`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"zod\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` initContract`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` helloContract`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`router`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` getHello:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"GET\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` path:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` responses:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` z`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`object`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` z`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 500`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` z`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`object`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` z`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` summary:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Echo Hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`why-not-something-like-trpc`,children:`Why not something like TRPC?`}),`\n`,_jsx(_components.p,{children:`One of the biggest differences between tRPC and ts-rest is that tRPC defines your API implementation as the contract, for some use cases it is beneficial to have a separate contract to represent the API.`}),`\n`,_jsxs(_components.p,{children:[`TS-Rest offers a plethora of frontend wrappers like `,_jsx(_components.code,{children:`react-query`}),` or `,_jsx(_components.code,{children:`solid-query`}),` but what if you want to consume the API on a micro-controller?`]}),`\n`,_jsx(_components.p,{children:`Well, do not worry, you can just consume it like a normal Rest API.`}),`\n`,_jsx(Warning,{children:`You will not get the typed definition this way but atleast you can consume it.`}),`\n`,_jsxs(_components.p,{children:[`Read the `,_jsx(_components.a,{href:`https://ts-rest.com/docs/comparisons/rpc-comparison`,children:`TS-Rest vs TRPC comparsion`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":null,"description":null,"href":"/api/introduction"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Why do we need a typesafe REST API?","slug":"why-do-we-need-a-typesafe-rest-api","depth":3,"children":[]},{"title":"Express","slug":"express","depth":2,"children":[]},{"title":"TS-Rest","slug":"ts-rest","depth":2,"children":[{"title":"Why not something like TRPC?","slug":"why-not-something-like-trpc","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"rapid","siteName":"Rapid","title":"Rapid- A typestrong starter","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T01:49:20.792Z","originalFileLocation":"api/introduction.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Rapid\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Rapid- A typestrong starter\">\u003cmeta data-mint-head property=\"og:description\" content=\"Rapid a starter kit to jumpstart your typeful apps. It is a monorepo that is built on top of Next.js, ExpressJS, Prisma, TS-Rest.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rapid\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://rapiddocs.prakhar.codes/api/introduction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mintlify.s3-us-west-1.amazonaws.com/rapid/logo/rapid_og_image.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Rapid- A typestrong starter\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Rapid a starter kit to jumpstart your typeful apps. It is a monorepo that is built on top of Next.js, ExpressJS, Prisma, TS-Rest.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mintlify.s3-us-west-1.amazonaws.com/rapid/logo/rapid_og_image.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/rapid/yjBqhQyYuDg_CKFW/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rapid\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#50F\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"twitter:creator\" content=\"@imprakharshukla\">\u003clink data-mint-head rel=\"canonical\" href=\"https://rapiddocs.prakhar.codes/api/introduction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/introduction.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://rapiddocs.prakhar.codes/#organization\",\"name\":\"Rapid\",\"url\":\"https://rapiddocs.prakhar.codes\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rapid/RiDGmZn_AA7WdGax/logo/logo_new_symbol.png?fit=max\u0026auto=format\u0026n=RiDGmZn_AA7WdGax\u0026q=85\u0026s=f3a8b1f4d701dd3276f01ce292c0778c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://rapiddocs.prakhar.codes#website\",\"name\":\"Rapid\",\"url\":\"https://rapiddocs.prakhar.codes\",\"publisher\":{\"@id\":\"https://rapiddocs.prakhar.codes/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://rapiddocs.prakhar.codes/api/introduction#webpage\",\"url\":\"https://rapiddocs.prakhar.codes/api/introduction\",\"name\":\"Introduction\",\"dateModified\":\"2026-01-07T01:49:20.792Z\",\"isPartOf\":{\"@id\":\"https://rapiddocs.prakhar.codes#website\"},\"breadcrumb\":{\"@id\":\"https://rapiddocs.prakhar.codes/api/introduction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://rapiddocs.prakhar.codes/api/introduction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Rapid\",\"item\":\"https://rapiddocs.prakhar.codes\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction\",\"item\":\"https://rapiddocs.prakhar.codes/api/introduction\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://rapiddocs.prakhar.codes/api/introduction#article\",\"headline\":\"Introduction\",\"name\":\"Introduction\",\"url\":\"https://rapiddocs.prakhar.codes/api/introduction\",\"mainEntityOfPage\":{\"@id\":\"https://rapiddocs.prakhar.codes/api/introduction#webpage\"},\"image\":\"https://mintlify.s3-us-west-1.amazonaws.com/rapid/logo/rapid_og_image.png\",\"dateModified\":\"2026-01-07T01:49:20.792Z\",\"publisher\":{\"@id\":\"https://rapiddocs.prakhar.codes/#organization\"},\"isPartOf\":{\"@id\":\"https://rapiddocs.prakhar.codes#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Rapid\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Rapid\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/introduction.md","siteName":"Rapid","nav":{"global":{"anchors":[{"anchor":"Creator","href":"https://prakhar.codes","icon":"user"},{"anchor":"Demo","href":"https://rapid.prakhar.codes","icon":"laptop"}]},"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Packages","pages":[{"title":null,"href":"/packages/introduction"},{"title":null,"href":"/packages/adding-packages"},{"title":null,"description":null,"href":"/packages/deleting-packages"}]},{"group":"API","pages":[{"title":null,"href":"/api/introduction"},{"title":null,"description":null,"href":"/api/contracts"},{"title":null,"href":"/api/auth"},{"title":null,"href":"/api/react-query"}]},{"group":"Auth","pages":[{"title":null,"href":"/auth/introduction"},{"title":null,"href":"/auth/auth-options"},{"title":null,"href":"/auth/auth-hook"}]},{"group":"UI","pages":[{"title":null,"href":"/ui/introduction"},{"title":null,"href":"/ui/ui-folder"}]}]}]},"basePath":"","title":"Rapid- A typestrong starter","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":[],"chunks":[]}