Repository navigation
Conversation
|
@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. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThis change adds Nest.js as a supported backend. It updates stack selection and validation, generates Nest.js server and Todo templates, connects web and native clients, and adds Nest.js support to EVLog setup. ChangesNest.js backend support
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Nest.js support is consistent with the existing Todo example behavior. Vercel function configuration now targets the Nest entrypoint, and no blocking issues remain. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The generated Nest Todo example permits public access to shared Todo data, including writes, even when authentication is selected. This follows the existing examples’ public-data design rather than introducing a demonstrated authorization regression. Exposure is conditional on generating and deploying the example, but authentication and validation behavior still require runtime confirmation. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 3.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 30 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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. Comment |
There was a problem hiding this comment.
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 winGenerate 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 onapi !== "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 theuseAuthandClerkApiAuthBridgeguards.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 winWrap the Clerk + Nest Todo app in
QueryClientProvider.With
auth="clerk",backend="nest",examplescontaining"todo", andapi="none", Lines 165-213 take the plain fallback instead of the Nest Todo query branch. Todo query hooks then run without aQueryClientProvider. 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
⛔ Files ignored due to path filters (1)
packages/template-generator/src/templates.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (63)
apps/cli/src/helpers/addons/evlog-setup.tsapps/cli/src/prompts/api.tsapps/cli/src/prompts/auth.tsapps/cli/src/prompts/backend.tsapps/cli/src/prompts/orm.tsapps/cli/src/prompts/package-manager.tsapps/cli/src/prompts/payments.tsapps/cli/src/prompts/server-deploy.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/src/utils/config-validation.tsapps/cli/test/addons.test.tsapps/cli/test/backend-runtime.test.tsapps/cli/test/database-orm.test.tsapps/cli/test/deployment.test.tsapps/cli/test/generated-builds.test.tsapps/cli/test/nest.test.tsapps/web/src/app/(home)/new/_components/utils.tsapps/web/src/app/layout.tsxapps/web/src/lib/constant.tsapps/web/test/stack-builder-compatibility.test.tspackages/template-generator/src/post-process/vercel-config.tspackages/template-generator/src/processors/backend-deps.tspackages/template-generator/src/processors/examples-deps.tspackages/template-generator/src/processors/readme-generator.tspackages/template-generator/src/processors/runtime-deps.tspackages/template-generator/src/template-handlers/examples.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/src/utils/generated-ignore-patterns.tspackages/template-generator/templates/backend/server/base/package.json.hbspackages/template-generator/templates/backend/server/base/tsconfig.json.hbspackages/template-generator/templates/backend/server/base/tsdown.config.ts.hbspackages/template-generator/templates/backend/server/nest/src/app.controller.ts.hbspackages/template-generator/templates/backend/server/nest/src/app.module.ts.hbspackages/template-generator/templates/backend/server/nest/src/app.service.ts.hbspackages/template-generator/templates/backend/server/nest/src/main.ts.hbspackages/template-generator/templates/db/prisma/mongodb/src/index.ts.hbspackages/template-generator/templates/db/prisma/mysql/src/index.ts.hbspackages/template-generator/templates/db/prisma/postgres/src/index.ts.hbspackages/template-generator/templates/db/prisma/sqlite/src/index.ts.hbspackages/template-generator/templates/deploy/docker/server/Dockerfile.hbspackages/template-generator/templates/examples/todo/nest/native/utils/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/dto/create-todo.dto.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/dto/update-todo.dto.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/entities/todo.entity.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/todos.controller.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/todos.module.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/todos.service.ts.hbspackages/template-generator/templates/examples/todo/nest/web/astro/src/lib/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/nuxt/app/plugins/vue-query.ts.hbspackages/template-generator/templates/examples/todo/nest/web/react/src/utils/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/solid/src/utils/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/svelte/src/lib/orpc.ts.hbspackages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbspackages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbspackages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbspackages/template-generator/templates/frontend/react/next/src/components/providers.tsx.hbspackages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbspackages/template-generator/templates/frontend/react/tanstack-router/src/main.tsx.hbspackages/template-generator/templates/frontend/react/tanstack-start/src/router.tsx.hbspackages/template-generator/templates/frontend/solid/src/main.tsx.hbspackages/template-generator/templates/frontend/svelte/src/routes/+layout.svelte.hbspackages/types/src/schemas.ts
cce3a57 to
899d6e4
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e57d7958-6b9f-4f5a-831e-c85e9a3f14c9
⛔ Files ignored due to path filters (1)
packages/template-generator/src/templates.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (49)
apps/cli/src/helpers/addons/evlog-setup.tsapps/cli/src/prompts/auth.tsapps/cli/src/prompts/backend.tsapps/cli/src/prompts/orm.tsapps/cli/src/prompts/server-deploy.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/src/utils/config-validation.tsapps/cli/test/addons.test.tsapps/cli/test/backend-runtime.test.tsapps/cli/test/database-orm.test.tsapps/cli/test/deployment.test.tsapps/cli/test/generated-builds.test.tsapps/cli/test/nest.test.tsapps/web/src/app/layout.tsxapps/web/src/lib/constant.tsapps/web/src/lib/stack-validation.tsapps/web/test/stack-builder-compatibility.test.tspackages/template-generator/src/post-process/vercel-config.tspackages/template-generator/src/processors/examples-deps.tspackages/template-generator/src/processors/readme-generator.tspackages/template-generator/src/processors/runtime-deps.tspackages/template-generator/src/processors/varlock.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/src/utils/generated-ignore-patterns.tspackages/template-generator/templates/backend/server/base/package.json.hbspackages/template-generator/templates/backend/server/base/tsconfig.json.hbspackages/template-generator/templates/backend/server/base/tsdown.config.ts.hbspackages/template-generator/templates/backend/server/nest/src/main.ts.hbspackages/template-generator/templates/db/prisma/mongodb/src/index.ts.hbspackages/template-generator/templates/db/prisma/mysql/src/index.ts.hbspackages/template-generator/templates/db/prisma/postgres/src/index.ts.hbspackages/template-generator/templates/db/prisma/sqlite/src/index.ts.hbspackages/template-generator/templates/deploy/docker/server/Dockerfile.hbspackages/template-generator/templates/examples/todo/nest/native/utils/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/server/src/todos/todos.service.ts.hbspackages/template-generator/templates/examples/todo/nest/web/astro/src/lib/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/react/src/utils/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/solid/src/utils/orpc.ts.hbspackages/template-generator/templates/examples/todo/nest/web/svelte/src/lib/orpc.ts.hbspackages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbspackages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbspackages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbspackages/template-generator/templates/frontend/react/next/src/components/providers.tsx.hbspackages/template-generator/templates/frontend/react/react-router/src/root.tsx.hbspackages/template-generator/templates/frontend/react/tanstack-router/src/main.tsx.hbspackages/template-generator/templates/frontend/react/tanstack-start/src/router.tsx.hbspackages/template-generator/templates/frontend/solid/src/App.tsx.hbspackages/types/src/compatibility.tspackages/types/src/schemas.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/web/src/app/layout.tsx
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
| framework: backend === "nest" ? "nestjs" : backend, | ||
| entrypoint: backend === "nest" ? "src/main.ts" : "src/index.ts", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Align Nest Todo routes with the Vercel /api rewrite.
When web and Nest services deploy together, this configuration sets the web server URL to /api and forwards /api/* to Nest. Vercel preserves that request path. The supplied Nest bootstrap sets no global prefix, while the Todo controller uses @Controller("todos"). A client request to /api/todos therefore reaches Nest as /api/todos, not /todos, and misses the Todo route. Add the prefix in Nest or rewrite the path before forwarding it. (vercel.com)
| framework: backend, | ||
| entrypoint: "src/index.ts", | ||
| framework: backend === "nest" ? "nestjs" : backend, | ||
| entrypoint: backend === "nest" ? "src/main.ts" : "src/index.ts", |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
git diff --unified=12 773516e3260fcada2affab2089687bed6834dacc 8f10d91480ccb0a6230ce5a0ced270416bc03064 -- packages/template-generator/src/post-process/vercel-config.ts
printf '\n--- current source ---\n'
cat -n packages/template-generator/src/post-process/vercel-config.ts | sed -n '1,125p'Repository: AmanVarshney01/create-better-t-stack
Length of output: 7638
🌐 Web query:
site:vercel.com/docs/project-configuration/vercel-json functions function-matching patterns includeFiles matching function configuration unmatched pattern behavior
💡 Result:
- **Function-config keys** are glob patterns matching function source paths. For example, `api/*.js` matches one level; `api/**/*.ts` matches nested levels. ([vercel.com](https://vercel.com/docs/project-configuration/vercel-json?utm_source=openai))
- **`includeFiles`** is a glob for extra files to bundle with that function; runtime behavior can vary for Community Runtimes. Next.js projects should use `outputFileTracingIncludes` instead. ([vercel.com](https://vercel.com/docs/project-configuration/vercel-json?utm_source=openai))
- **Unmatched function pattern:** Vercel documents this as an error condition—the key’s pattern must match a function source file in the relevant functions directory (with framework-specific paths for Next.js). ([vercel.com](https://vercel.com/docs/errors/error-list))
- **Unresolved:** The docs don’t specify what happens when an `includeFiles` glob itself matches no files. They establish its purpose and pattern type, but not whether an empty match warns, errors, or is silently ignored. ([vercel.com](https://vercel.com/docs/project-configuration/vercel-json?utm_source=openai))
Citations:
- 1: https://vercel.com/docs/project-configuration/vercel-json?utm_source=openai
- 2: https://vercel.com/docs/project-configuration/vercel-json?utm_source=openai
- 3: https://vercel.com/docs/errors/error-list
- 4: https://vercel.com/docs/project-configuration/vercel-json?utm_source=openai
Use the selected entrypoint as the functions key.
For Nest, entrypoint is src/main.ts, but includeFiles is configured under src/index.ts. Vercel requires a function pattern to match a function source file and reports unmatched patterns as errors, so Nest deployments can fail. Keep the key aligned with the selected entrypoint.
🐛 Suggested fix
- "src/index.ts": {
+ [backend === "nest" ? "src/main.ts" : "src/index.ts"]: {8f10d91 to
b4b6bee
Compare
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
Move Nest.js rules into the shared compatibility module and stack builder validation, read server and client env from the per-app env modules, and use the services module for the database and auth instances. Wire the evlog dev file system drain for Nest and keep Axiom unsupported. Refs AmanVarshney01#428
Prefix Nest health and Todo routes with /api when web and server deploy together on Vercel, matching the rewrite that forwards /api/* to the server. Key the Vercel function config by the selected server entrypoint. Refs AmanVarshney01#428
b4b6bee to
a6607ad
Compare
|
Hi @AmanVarshney01. Sorry to ping you mate. I've updated the PR for the Nest.js integration, in case you can take a look at it. I'm pretty sure that people waiting for this would be very much pleased. |
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