Skip to content

Feat: add Nestjs backend integration - #1119

Open
modejota wants to merge 6 commits into
AmanVarshney01:mainfrom
modejota:feat/nestjs-backend-integration
Open

Feat: add Nestjs backend integration#1119
modejota wants to merge 6 commits into
AmanVarshney01:mainfrom
modejota:feat/nestjs-backend-integration

Conversation

@modejota

@modejota modejota commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Given the community requesting to add Nest.js as a backend framework in #428 I decided to do it on my own. Hope this helps.

Summary by CodeRabbit

  • New Features
    • Added Nest.js as a supported backend across project generation and stack compatibility.
    • Included Nest server setup with /health, Better Auth support, and Todo CRUD templates (Prisma/Mongoose, REST/ORPC client wiring where applicable).
    • Updated generated Docker and Vercel outputs plus server entrypoints for Nest.
    • Expanded EVLog addon setup and support for Nest projects.
  • Bug Fixes
    • Improved Nest-specific constraint/compatibility validation and corrected “unsupported” messaging and selection behavior.
  • Tests
    • Expanded generator, compatibility, ORM/deployment/runtime, and EVLog patching test coverage for Nest.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

@modejota is attempting to deploy a commit to the Better T Stack Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e0a0840-ca24-4d97-b09e-37e940e690db

📥 Commits

Reviewing files that changed from the base of the PR and between cce3a57 and 899d6e4.

⛔ Files ignored due to path filters (1)
  • packages/template-generator/src/templates.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (63)
  • apps/cli/src/helpers/addons/evlog-setup.ts
  • apps/cli/src/prompts/api.ts
  • apps/cli/src/prompts/auth.ts
  • apps/cli/src/prompts/backend.ts
  • apps/cli/src/prompts/orm.ts
  • apps/cli/src/prompts/package-manager.ts
  • apps/cli/src/prompts/payments.ts
  • apps/cli/src/prompts/server-deploy.ts
  • apps/cli/src/utils/compatibility-rules.ts
  • apps/cli/src/utils/config-validation.ts
  • apps/cli/test/addons.test.ts
  • apps/cli/test/backend-runtime.test.ts
  • apps/cli/test/database-orm.test.ts
  • apps/cli/test/deployment.test.ts
  • apps/cli/test/generated-builds.test.ts
  • apps/cli/test/nest.test.ts
  • apps/web/src/app/(home)/new/_components/utils.ts
  • apps/web/src/app/layout.tsx
  • apps/web/src/lib/constant.ts
  • apps/web/test/stack-builder-compatibility.test.ts
  • packages/template-generator/src/post-process/vercel-config.ts
  • packages/template-generator/src/processors/backend-deps.ts
  • packages/template-generator/src/processors/examples-deps.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/processors/runtime-deps.ts
  • packages/template-generator/src/template-handlers/examples.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/src/utils/generated-ignore-patterns.ts
  • packages/template-generator/templates/backend/server/base/package.json.hbs
  • packages/template-generator/templates/backend/server/base/tsconfig.json.hbs
  • packages/template-generator/templates/backend/server/base/tsdown.config.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.controller.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.module.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.service.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/main.ts.hbs
  • packages/template-generator/templates/db/prisma/mongodb/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/mysql/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/postgres/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/sqlite/src/index.ts.hbs
  • packages/template-generator/templates/deploy/docker/server/Dockerfile.hbs
  • packages/template-generator/templates/examples/todo/nest/native/utils/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/dto/create-todo.dto.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/dto/update-todo.dto.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/entities/todo.entity.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.controller.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.module.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.service.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/astro/src/lib/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/vue-query.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/react/src/utils/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/solid/src/utils/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/svelte/src/lib/orpc.ts.hbs
  • packages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbs
  • packages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbs
  • packages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbs
  • packages/template-generator/templates/frontend/react/next/src/components/providers.tsx.hbs
  • packages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbs
  • packages/template-generator/templates/frontend/react/tanstack-router/src/main.tsx.hbs
  • packages/template-generator/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • packages/template-generator/templates/frontend/solid/src/main.tsx.hbs
  • packages/template-generator/templates/frontend/svelte/src/routes/+layout.svelte.hbs
  • packages/types/src/schemas.ts
🚧 Files skipped from review as they are similar to previous changes (52)
  • packages/template-generator/templates/backend/server/nest/src/app.service.ts.hbs
  • apps/cli/src/prompts/payments.ts
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.module.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/dto/create-todo.dto.ts.hbs
  • packages/template-generator/templates/backend/server/base/tsconfig.json.hbs
  • packages/template-generator/templates/db/prisma/sqlite/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/postgres/src/index.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/entities/todo.entity.ts.hbs
  • apps/cli/src/prompts/orm.ts
  • packages/template-generator/templates/backend/server/base/package.json.hbs
  • packages/template-generator/templates/frontend/svelte/src/routes/+layout.svelte.hbs
  • packages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/vue-query.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.controller.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/astro/src/lib/orpc.ts.hbs
  • apps/web/test/stack-builder-compatibility.test.ts
  • packages/template-generator/templates/db/prisma/mongodb/src/index.ts.hbs
  • packages/template-generator/templates/frontend/solid/src/main.tsx.hbs
  • packages/template-generator/src/processors/backend-deps.ts
  • apps/cli/src/prompts/backend.ts
  • packages/template-generator/templates/db/prisma/mysql/src/index.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.module.ts.hbs
  • apps/cli/src/prompts/api.ts
  • packages/template-generator/src/processors/runtime-deps.ts
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/dto/update-todo.dto.ts.hbs
  • apps/cli/test/backend-runtime.test.ts
  • packages/template-generator/templates/deploy/docker/server/Dockerfile.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.controller.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/solid/src/utils/orpc.ts.hbs
  • apps/cli/test/generated-builds.test.ts
  • packages/template-generator/templates/examples/todo/nest/native/utils/orpc.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/main.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/orpc.ts.hbs
  • apps/cli/src/prompts/package-manager.ts
  • apps/web/src/lib/constant.ts
  • packages/template-generator/src/template-handlers/examples.ts
  • packages/types/src/schemas.ts
  • apps/cli/test/deployment.test.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/src/processors/examples-deps.ts
  • packages/template-generator/templates/frontend/react/next/src/components/providers.tsx.hbs
  • packages/template-generator/templates/frontend/react/tanstack-router/src/main.tsx.hbs
  • packages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbs
  • packages/template-generator/templates/examples/todo/nest/web/react/src/utils/orpc.ts.hbs
  • packages/template-generator/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • apps/cli/src/utils/config-validation.ts
  • packages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbs
  • apps/cli/test/addons.test.ts
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.service.ts.hbs
  • packages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbs
  • apps/cli/src/utils/compatibility-rules.ts
  • apps/web/src/app/(home)/new/_components/utils.ts
  • packages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbs

Walkthrough

Changes

Nest.js is added as a supported backend across CLI prompts, validation, stack-builder compatibility, project generation, server templates, deployments, frontend Todo clients, EVLog setup, and automated tests.

Nest.js backend support

Layer / File(s) Summary
Selection and compatibility rules
apps/cli/src/prompts/*, apps/cli/src/utils/*, apps/web/src/app/(home)/new/..., apps/web/src/lib/constant.ts, packages/types/src/schemas.ts
Nest.js is selectable and constrained to supported runtimes, ORMs, APIs, authentication, payments, examples, and deployments.
Generator wiring and runtime outputs
packages/template-generator/src/*, packages/template-generator/templates/backend/server/base/*, packages/template-generator/templates/deploy/*, packages/template-generator/templates/db/*
Generation adds Nest dependencies, main.ts entrypoints, compiler settings, deployment commands, README metadata, and database exports.
Nest.js server and Todo templates
packages/template-generator/templates/backend/server/nest/*, packages/template-generator/templates/examples/todo/nest/server/*
Generated Nest applications include health handling, optional Better Auth, validation, and Prisma/Mongoose Todo CRUD endpoints.
Frontend Todo clients
packages/template-generator/templates/examples/todo/nest/{web,native}/*, packages/template-generator/templates/frontend/*
Generated frontend and native applications receive REST clients, query clients, and provider wiring for Nest Todo examples.
EVLog Nest.js integration
apps/cli/src/helpers/addons/evlog-setup.ts
EVLog patches Nest bootstrap and module files with logger initialization and EvlogModule.forRoot().
Validation and generation tests
apps/cli/test/*, apps/web/test/*
Tests cover Nest runtime and ORM constraints, deployments, generated builds, frontend wiring, invalid configurations, and EVLog setup.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding NestJS backend integration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbs (1)

139-164: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Generate the Clerk bridge for Nest Todo projects with no API selected.

The widened Nest Todo branches render <ClerkApiAuthBridge />, but its declaration—and, in native/TanStack Router templates, the required Clerk hook imports—remain gated on api !== "none". A Clerk + Nest + Todo + api="none" project therefore fails type-checking.

  • packages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbs#L139-L164: include Nest Todo in the Clerk hook/bridge guards.
  • packages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbs#L155-L200: include Nest Todo in the Clerk hook/bridge guards.
  • packages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbs#L134-L157: include Nest Todo in the Clerk hook/bridge guards.
  • packages/template-generator/templates/frontend/react/next/src/components/providers.tsx.hbs#L94-L109: include Nest Todo in the useAuth and ClerkApiAuthBridge guards.
  • packages/template-generator/templates/frontend/react/tanstack-router/src/main.tsx.hbs#L58-L75: include Nest Todo in the Clerk hook/bridge guards.
packages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbs (1)

161-217: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Wrap the Clerk + Nest Todo app in QueryClientProvider.

With auth="clerk", backend="nest", examples containing "todo", and api="none", Lines 165-213 take the plain fallback instead of the Nest Todo query branch. Todo query hooks then run without a QueryClientProvider. Apply the Nest Todo predicate to the Clerk auth bridge and ORPC provider branch as well.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5bcbff79-8803-44a3-95a5-2fc2fd369eb1

📥 Commits

Reviewing files that changed from the base of the PR and between 4473a3e and 9584301.

⛔ Files ignored due to path filters (1)
  • packages/template-generator/src/templates.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (63)
  • apps/cli/src/helpers/addons/evlog-setup.ts
  • apps/cli/src/prompts/api.ts
  • apps/cli/src/prompts/auth.ts
  • apps/cli/src/prompts/backend.ts
  • apps/cli/src/prompts/orm.ts
  • apps/cli/src/prompts/package-manager.ts
  • apps/cli/src/prompts/payments.ts
  • apps/cli/src/prompts/server-deploy.ts
  • apps/cli/src/utils/compatibility-rules.ts
  • apps/cli/src/utils/config-validation.ts
  • apps/cli/test/addons.test.ts
  • apps/cli/test/backend-runtime.test.ts
  • apps/cli/test/database-orm.test.ts
  • apps/cli/test/deployment.test.ts
  • apps/cli/test/generated-builds.test.ts
  • apps/cli/test/nest.test.ts
  • apps/web/src/app/(home)/new/_components/utils.ts
  • apps/web/src/app/layout.tsx
  • apps/web/src/lib/constant.ts
  • apps/web/test/stack-builder-compatibility.test.ts
  • packages/template-generator/src/post-process/vercel-config.ts
  • packages/template-generator/src/processors/backend-deps.ts
  • packages/template-generator/src/processors/examples-deps.ts
  • packages/template-generator/src/processors/readme-generator.ts
  • packages/template-generator/src/processors/runtime-deps.ts
  • packages/template-generator/src/template-handlers/examples.ts
  • packages/template-generator/src/utils/add-deps.ts
  • packages/template-generator/src/utils/generated-ignore-patterns.ts
  • packages/template-generator/templates/backend/server/base/package.json.hbs
  • packages/template-generator/templates/backend/server/base/tsconfig.json.hbs
  • packages/template-generator/templates/backend/server/base/tsdown.config.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.controller.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.module.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/app.service.ts.hbs
  • packages/template-generator/templates/backend/server/nest/src/main.ts.hbs
  • packages/template-generator/templates/db/prisma/mongodb/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/mysql/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/postgres/src/index.ts.hbs
  • packages/template-generator/templates/db/prisma/sqlite/src/index.ts.hbs
  • packages/template-generator/templates/deploy/docker/server/Dockerfile.hbs
  • packages/template-generator/templates/examples/todo/nest/native/utils/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/dto/create-todo.dto.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/dto/update-todo.dto.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/entities/todo.entity.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.controller.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.module.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/server/src/todos/todos.service.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/astro/src/lib/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/vue-query.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/react/src/utils/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/solid/src/utils/orpc.ts.hbs
  • packages/template-generator/templates/examples/todo/nest/web/svelte/src/lib/orpc.ts.hbs
  • packages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbs
  • packages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbs
  • packages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbs
  • packages/template-generator/templates/frontend/react/next/src/components/providers.tsx.hbs
  • packages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbs
  • packages/template-generator/templates/frontend/react/tanstack-router/src/main.tsx.hbs
  • packages/template-generator/templates/frontend/react/tanstack-start/src/router.tsx.hbs
  • packages/template-generator/templates/frontend/solid/src/main.tsx.hbs
  • packages/template-generator/templates/frontend/svelte/src/routes/+layout.svelte.hbs
  • packages/types/src/schemas.ts

Comment thread apps/cli/src/prompts/package-manager.ts Outdated
modejota added 6 commits July 26, 2026 23:34
Expose Nest.js in CLI and web stack selection, with runtime, ORM, auth, deployment, and addon compatibility rules.

Refs AmanVarshney01#428
Generate conventional Nest modules, controllers, services, DTOs, entities, and main entrypoints for Node and Bun projects.

Add Prisma and Mongoose TODO support plus Docker and Vercel entrypoint handling.

Refs AmanVarshney01#428
Register EvlogModule and initialize request logging for generated and existing Nest servers.

Closes AmanVarshney01#428
Enable the generated oRPC query providers for Nest TODO projects without an API selection.

Refs AmanVarshney01#428
@modejota
modejota force-pushed the feat/nestjs-backend-integration branch from cce3a57 to 899d6e4 Compare July 26, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant