create-better-t-stack 2.49.1-canary.80158905 → 2.50.0-canary.08568a05

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +1 -1
  4. package/dist/{src-CyG8-I-3.js → src-DfbhNFZ9.js} +342 -208
  5. package/package.json +2 -1
  6. package/templates/api/orpc/fullstack/next/src/app/api/rpc/[[...rest]]/route.ts.hbs +21 -0
  7. package/templates/api/orpc/server/{rest/src → src}/context.ts.hbs +1 -1
  8. package/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs +3 -1
  9. package/templates/api/trpc/fullstack/next/src/app/api/trpc/[trpc]/route.ts.hbs +14 -0
  10. package/templates/api/trpc/server/{rest/src → src}/context.ts.hbs +1 -1
  11. package/templates/api/trpc/web/react/base/src/utils/trpc.ts.hbs +4 -2
  12. package/templates/auth/better-auth/{server/next/src/app/api/auth/[...all]/route.ts → fullstack/next/src/app/api/auth/[...all]/route.ts.hbs} +1 -1
  13. package/templates/auth/better-auth/server/base/src/index.ts.hbs +1 -1
  14. package/templates/auth/clerk/convex/web/react/tanstack-start/src/server.ts.hbs +1 -0
  15. package/templates/backend/server/elysia/src/index.ts.hbs +1 -1
  16. package/templates/backend/server/express/src/index.ts.hbs +1 -1
  17. package/templates/backend/server/fastify/src/index.ts.hbs +1 -1
  18. package/templates/backend/server/hono/src/index.ts.hbs +2 -2
  19. package/templates/db/drizzle/mysql/src/index.ts.hbs +1 -1
  20. package/templates/db/drizzle/postgres/src/index.ts.hbs +1 -1
  21. package/templates/db/drizzle/sqlite/src/index.ts.hbs +1 -1
  22. package/templates/deploy/wrangler/web/react/tanstack-start/wrangler.jsonc.hbs +1 -1
  23. package/templates/examples/ai/fullstack/next/src/app/api/ai/route.ts.hbs +15 -0
  24. package/templates/examples/todo/server/drizzle/base/src/routers/todo.ts.hbs +1 -1
  25. package/templates/frontend/react/next/package.json.hbs +1 -1
  26. package/templates/frontend/react/tanstack-start/package.json.hbs +7 -7
  27. package/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs +4 -4
  28. package/templates/frontend/react/tanstack-start/vite.config.ts.hbs +1 -1
  29. package/templates/api/orpc/server/next/src/app/rpc/[...all]/route.ts.hbs +0 -52
  30. package/templates/api/trpc/server/next/src/app/trpc/[trpc]/route.ts +0 -14
  31. package/templates/backend/server/next/next-env.d.ts +0 -5
  32. package/templates/backend/server/next/next.config.ts +0 -7
  33. package/templates/backend/server/next/package.json.hbs +0 -27
  34. package/templates/backend/server/next/src/app/route.ts +0 -5
  35. package/templates/backend/server/next/src/middleware.ts +0 -19
  36. package/templates/backend/server/next/tsconfig.json.hbs +0 -33
  37. package/templates/examples/ai/server/next/src/app/ai/route.ts.hbs +0 -15
  38. /package/templates/api/orpc/server/{base/_gitignore → _gitignore} +0 -0
  39. /package/templates/api/orpc/server/{base/package.json.hbs → package.json.hbs} +0 -0
  40. /package/templates/api/orpc/server/{rest/src → src}/index.ts.hbs +0 -0
  41. /package/templates/api/orpc/server/{base/src → src}/routers/index.ts.hbs +0 -0
  42. /package/templates/api/orpc/server/{base/tsconfig.json.hbs → tsconfig.json.hbs} +0 -0
  43. /package/templates/api/orpc/server/{base/tsdown.config.ts.hbs → tsdown.config.ts.hbs} +0 -0
  44. /package/templates/api/trpc/server/{base/_gitignore → _gitignore} +0 -0
  45. /package/templates/api/trpc/server/{base/package.json.hbs → package.json.hbs} +0 -0
  46. /package/templates/api/trpc/server/{rest/src → src}/index.ts.hbs +0 -0
  47. /package/templates/api/trpc/server/{base/src → src}/routers/index.ts.hbs +0 -0
  48. /package/templates/api/trpc/server/{base/tsconfig.json.hbs → tsconfig.json.hbs} +0 -0
  49. /package/templates/api/trpc/server/{base/tsdown.config.ts.hbs → tsdown.config.ts.hbs} +0 -0
  50. /package/templates/auth/better-auth/server/db/drizzle/mysql/src/schema/{auth.ts → auth.ts.hbs} +0 -0
  51. /package/templates/auth/better-auth/server/db/drizzle/postgres/src/schema/{auth.ts → auth.ts.hbs} +0 -0
  52. /package/templates/auth/better-auth/server/db/drizzle/sqlite/src/schema/{auth.ts → auth.ts.hbs} +0 -0
  53. /package/templates/auth/better-auth/server/db/mongoose/mongodb/src/models/{auth.model.ts → auth.model.ts.hbs} +0 -0
  54. /package/templates/auth/better-auth/server/db/prisma/mongodb/prisma/schema/{auth.prisma → auth.prisma.hbs} +0 -0
  55. /package/templates/auth/better-auth/server/db/prisma/mysql/prisma/schema/{auth.prisma → auth.prisma.hbs} +0 -0
  56. /package/templates/auth/better-auth/server/db/prisma/postgres/prisma/schema/{auth.prisma → auth.prisma.hbs} +0 -0
  57. /package/templates/auth/better-auth/server/db/prisma/sqlite/prisma/schema/{auth.prisma → auth.prisma.hbs} +0 -0
  58. /package/templates/auth/better-auth/web/nuxt/app/middleware/{auth.ts → auth.ts.hbs} +0 -0
  59. /package/templates/examples/todo/server/drizzle/mysql/src/{db/schema → schema}/todo.ts +0 -0
  60. /package/templates/examples/todo/server/drizzle/postgres/src/{db/schema → schema}/todo.ts +0 -0
  61. /package/templates/examples/todo/server/drizzle/sqlite/src/{db/schema → schema}/todo.ts +0 -0
  62. /package/templates/examples/todo/server/mongoose/mongodb/src/{db/models → models}/todo.model.ts.hbs +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.49.1-canary.80158905",
3
+ "version": "2.50.0-canary.08568a05",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,6 +77,7 @@
77
77
  "tinyglobby": "^0.2.15",
78
78
  "trpc-cli": "^0.11.0",
79
79
  "ts-morph": "^27.0.0",
80
+ "yaml": "^2.7.0",
80
81
  "zod": "^4.1.11"
81
82
  },
82
83
  "devDependencies": {
@@ -0,0 +1,21 @@
1
+ import { RPCHandler } from '@orpc/server/fetch'
2
+ import { createContext } from '@{{projectName}}/api/context'
3
+ import { appRouter } from '@{{projectName}}/api/routers/index'
4
+
5
+ const handler = new RPCHandler(appRouter)
6
+
7
+ async function handleRequest(request: Request) {
8
+ const { response } = await handler.handle(request, {
9
+ prefix: '/api/rpc',
10
+ context: createContext(request)
11
+ })
12
+
13
+ return response ?? new Response('Not found', { status: 404 })
14
+ }
15
+
16
+ export const HEAD = handleRequest
17
+ export const GET = handleRequest
18
+ export const POST = handleRequest
19
+ export const PUT = handleRequest
20
+ export const PATCH = handleRequest
21
+ export const DELETE = handleRequest
@@ -1,4 +1,4 @@
1
- {{#if (eq backend 'next')}}
1
+ {{#if (and (eq backend 'self') (includes frontend "next"))}}
2
2
  import type { NextRequest } from "next/server";
3
3
  {{#if (eq auth "better-auth")}}
4
4
  import { auth } from "@{{projectName}}/auth";
@@ -21,7 +21,9 @@ export const queryClient = new QueryClient({
21
21
  });
22
22
 
23
23
  export const link = new RPCLink({
24
- {{#if (includes frontend "next")}}
24
+ {{#if (and (eq backend "self") (includes frontend "next"))}}
25
+ url: "/api/rpc",
26
+ {{else if (includes frontend "next")}}
25
27
  url: `${process.env.NEXT_PUBLIC_SERVER_URL}/rpc`,
26
28
  {{else}}
27
29
  url: `${import.meta.env.VITE_SERVER_URL}/rpc`,
@@ -0,0 +1,14 @@
1
+ import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
2
+ import { appRouter } from "@{{projectName}}/api/routers/index";
3
+ import { createContext } from "@{{projectName}}/api/context";
4
+ import { NextRequest } from "next/server";
5
+
6
+ function handler(req: NextRequest) {
7
+ return fetchRequestHandler({
8
+ endpoint: "/api/trpc",
9
+ req,
10
+ router: appRouter,
11
+ createContext: () => createContext(req),
12
+ });
13
+ }
14
+ export { handler as GET, handler as POST };
@@ -1,4 +1,4 @@
1
- {{#if (eq backend 'next')}}
1
+ {{#if (and (eq backend 'self') (includes frontend "next"))}}
2
2
  import type { NextRequest } from "next/server";
3
3
  {{#if (eq auth "better-auth")}}
4
4
  import { auth } from "@{{projectName}}/auth";
@@ -2,7 +2,7 @@
2
2
  import { QueryCache, QueryClient } from '@tanstack/react-query';
3
3
  import { createTRPCClient, httpBatchLink } from '@trpc/client';
4
4
  import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
5
- import type { AppRouter } from '../../../server/src/routers';
5
+ import type { AppRouter } from "@{{projectName}}/api/routers/index";
6
6
  import { toast } from 'sonner';
7
7
 
8
8
  export const queryClient = new QueryClient({
@@ -23,7 +23,9 @@ export const queryClient = new QueryClient({
23
23
  const trpcClient = createTRPCClient<AppRouter>({
24
24
  links: [
25
25
  httpBatchLink({
26
- {{#if (includes frontend 'next')}}
26
+ {{#if (and (eq backend "self") (includes frontend 'next'))}}
27
+ url: "/api/trpc",
28
+ {{else if (includes frontend 'next')}}
27
29
  url: `${process.env.NEXT_PUBLIC_SERVER_URL}/trpc`,
28
30
  {{else}}
29
31
  url: `${import.meta.env.VITE_SERVER_URL}/trpc`,
@@ -1,4 +1,4 @@
1
- import { auth } from "@/lib/auth";
1
+ import { auth } from "@{{projectName}}/auth";
2
2
  import { toNextJsHandler } from "better-auth/next-js";
3
3
 
4
4
  export const { GET, POST } = toNextJsHandler(auth.handler);
@@ -66,7 +66,7 @@ export const auth = betterAuth<BetterAuthOptions>({
66
66
  {{/if}}
67
67
 
68
68
  {{#if (eq orm "drizzle")}}
69
- {{#if (or (eq runtime "bun") (eq runtime "node"))}}
69
+ {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
70
70
  import { betterAuth, type BetterAuthOptions } from "better-auth";
71
71
  import { drizzleAdapter } from "better-auth/adapters/drizzle";
72
72
  {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
@@ -6,6 +6,7 @@ import {
6
6
  } from "@tanstack/react-start/server";
7
7
  import { createRouter } from "./router";
8
8
 
9
+ // this is broken right now, waiting for a fix
9
10
  const handlerFactory = createClerkHandler(
10
11
  createStartHandler({
11
12
  createRouter,
@@ -104,7 +104,7 @@ const app = new Elysia()
104
104
  const body = await context.request.json();
105
105
  const uiMessages = body.messages || [];
106
106
  const result = streamText({
107
- model: google("gemini-2.0-flash"),
107
+ model: google("gemini-2.5-flash"),
108
108
  messages: convertToModelMessages(uiMessages)
109
109
  });
110
110
 
@@ -105,7 +105,7 @@ app.use(express.json());
105
105
  app.post("/ai", async (req, res) => {
106
106
  const { messages = [] } = (req.body || {}) as { messages: UIMessage[] };
107
107
  const result = streamText({
108
- model: google("gemini-1.5-flash"),
108
+ model: google("gemini-2.5-flash"),
109
109
  messages: convertToModelMessages(messages),
110
110
  });
111
111
  result.pipeUIMessageStreamToResponse(res);
@@ -161,7 +161,7 @@ interface AiRequestBody {
161
161
  fastify.post('/ai', async function (request) {
162
162
  const { messages } = request.body as AiRequestBody;
163
163
  const result = streamText({
164
- model: google('gemini-1.5-flash'),
164
+ model: google('gemini-2.5-flash'),
165
165
  messages: convertToModelMessages(messages),
166
166
  });
167
167
 
@@ -121,7 +121,7 @@ app.post("/ai", async (c) => {
121
121
  const body = await c.req.json();
122
122
  const uiMessages = body.messages || [];
123
123
  const result = streamText({
124
- model: google("gemini-1.5-flash"),
124
+ model: google("gemini-2.5-flash"),
125
125
  messages: convertToModelMessages(uiMessages),
126
126
  });
127
127
 
@@ -137,7 +137,7 @@ app.post("/ai", async (c) => {
137
137
  apiKey: env.GOOGLE_GENERATIVE_AI_API_KEY,
138
138
  });
139
139
  const result = streamText({
140
- model: google("gemini-1.5-flash"),
140
+ model: google("gemini-2.5-flash"),
141
141
  messages: convertToModelMessages(uiMessages),
142
142
  });
143
143
 
@@ -1,4 +1,4 @@
1
- {{#if (or (eq runtime "bun") (eq runtime "node"))}}
1
+ {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
2
2
  {{#if (eq dbSetup "planetscale")}}
3
3
  import { drizzle } from "drizzle-orm/planetscale-serverless";
4
4
 
@@ -1,4 +1,4 @@
1
- {{#if (or (eq runtime "bun") (eq runtime "node"))}}
1
+ {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
2
2
  {{#if (eq dbSetup "neon")}}
3
3
  import { neon, neonConfig } from '@neondatabase/serverless';
4
4
  import { drizzle } from 'drizzle-orm/neon-http';
@@ -1,4 +1,4 @@
1
- {{#if (or (eq runtime "bun") (eq runtime "node"))}}
1
+ {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
2
2
  import { drizzle } from "drizzle-orm/libsql";
3
3
  import { createClient } from "@libsql/client";
4
4
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./node_modules/wrangler/config-schema.json",
3
3
  "name": "{{projectName}}",
4
- "main": ".output/server/index.mjs",
4
+ "main": "@tanstack/react-start/server-entry",
5
5
  "compatibility_date": "2025-07-05",
6
6
  "compatibility_flags": ["nodejs_compat"],
7
7
  "assets": {
@@ -0,0 +1,15 @@
1
+ import { google } from "@ai-sdk/google";
2
+ import { streamText, type UIMessage, convertToModelMessages } from "ai";
3
+
4
+ export const maxDuration = 30;
5
+
6
+ export async function POST(req: Request) {
7
+ const { messages }: { messages: UIMessage[] } = await req.json();
8
+
9
+ const result = streamText({
10
+ model: google("gemini-2.5-flash"),
11
+ messages: convertToModelMessages(messages),
12
+ });
13
+
14
+ return result.toUIMessageStreamResponse();
15
+ }
@@ -40,7 +40,7 @@ export const todoRouter = {
40
40
  {{#if (eq api "trpc")}}
41
41
  import z from "zod";
42
42
  import { router, publicProcedure } from "../index";
43
- import { todo } from "../db/schema/todo";
43
+ import { todo } from "@{{projectName}}/db/schema/todo";
44
44
  import { eq } from "drizzle-orm";
45
45
  import { db } from "@{{projectName}}/db";
46
46
 
@@ -13,7 +13,7 @@
13
13
  "class-variance-authority": "^0.7.1",
14
14
  "clsx": "^2.1.1",
15
15
  "lucide-react": "^0.487.0",
16
- "next": "15.5.0",
16
+ "next": "15.5.4",
17
17
  "next-themes": "^0.4.6",
18
18
  "react": "19.1.0",
19
19
  "react-dom": "19.1.0",
@@ -9,13 +9,13 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "radix-ui": "^1.4.2",
12
- "@tanstack/react-form": "^1.0.5",
12
+ "@tanstack/react-form": "^1.23.5",
13
13
  "@tailwindcss/vite": "^4.1.8",
14
14
  "@tanstack/react-query": "^5.80.6",
15
- "@tanstack/react-router": "^1.121.0-alpha.27",
16
- "@tanstack/react-router-with-query": "^1.121.0",
17
- "@tanstack/react-start": "^1.121.0-alpha.27",
18
- "@tanstack/router-plugin": "^1.121.0",
15
+ "@tanstack/react-router": "^1.132.31",
16
+ "@tanstack/react-router-with-query": "^1.130.17",
17
+ "@tanstack/react-start": "^1.132.31",
18
+ "@tanstack/router-plugin": "^1.132.31",
19
19
  "class-variance-authority": "^0.7.1",
20
20
  "clsx": "^2.1.1",
21
21
  "lucide-react": "^0.525.0",
@@ -30,12 +30,12 @@
30
30
  "zod": "^4.0.2"
31
31
  },
32
32
  "devDependencies": {
33
- "@tanstack/react-router-devtools": "^1.121.0-alpha.27",
33
+ "@tanstack/react-router-devtools": "^1.132.31",
34
34
  "@testing-library/dom": "^10.4.0",
35
35
  "@testing-library/react": "^16.2.0",
36
36
  "@types/react": "~19.1.10",
37
37
  "@types/react-dom": "^19.0.4",
38
- "@vitejs/plugin-react": "^5.0.1",
38
+ "@vitejs/plugin-react": "^5.0.4",
39
39
  "jsdom": "^26.0.0",
40
40
  "typescript": "^5.7.2",
41
41
  "vite": "^7.0.2",
@@ -30,24 +30,24 @@ import Loader from "@/components/loader";
30
30
  import { ClerkProvider, useAuth } from "@clerk/tanstack-react-start";
31
31
  import { getAuth } from "@clerk/tanstack-react-start/server";
32
32
  import { createServerFn } from "@tanstack/react-start";
33
- import { getWebRequest } from "@tanstack/react-start/server";
33
+ import { getRequest } from "@tanstack/react-start/server";
34
34
  import { ConvexProviderWithClerk } from "convex/react-clerk";
35
35
 
36
36
  const fetchClerkAuth = createServerFn({ method: "GET" }).handler(async () => {
37
- const auth = await getAuth(getWebRequest());
37
+ const auth = await getAuth(getRequest());
38
38
  const token = await auth.getToken({ template: "convex" });
39
39
  return { userId: auth.userId, token };
40
40
  });
41
41
  {{else if (and (eq backend "convex") (eq auth "better-auth"))}}
42
42
  import { createServerFn } from "@tanstack/react-start";
43
- import { getWebRequest, getCookie } from "@tanstack/react-start/server";
43
+ import { getRequest, getCookie } from "@tanstack/react-start/server";
44
44
  import { ConvexBetterAuthProvider } from "@convex-dev/better-auth/react";
45
45
  import { fetchSession, getCookieName } from "@convex-dev/better-auth/react-start";
46
46
  import { authClient } from "@/lib/auth-client";
47
47
  import { createAuth } from "@{{projectName}}/backend/convex/auth";
48
48
 
49
49
  const fetchAuth = createServerFn({ method: "GET" }).handler(async () => {
50
- const { session } = await fetchSession(getWebRequest());
50
+ const { session } = await fetchSession(getRequest());
51
51
  const sessionCookieName = getCookieName(createAuth);
52
52
  const token = getCookie(sessionCookieName);
53
53
  return {
@@ -8,7 +8,7 @@ export default defineConfig({
8
8
  plugins: [
9
9
  tsconfigPaths(),
10
10
  tailwindcss(),
11
- tanstackStart({ customViteReactPlugin: true }),
11
+ tanstackStart(),
12
12
  viteReact(),
13
13
  ],
14
14
  });
@@ -1,52 +0,0 @@
1
- {{#if (eq auth "better-auth")}}
2
- import { createContext } from '@/lib/context'
3
- {{/if}}
4
- import { appRouter } from '@/routers'
5
- import { OpenAPIHandler } from '@orpc/openapi/fetch'
6
- import { OpenAPIReferencePlugin } from '@orpc/openapi/plugins'
7
- import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
8
- import { RPCHandler } from '@orpc/server/fetch'
9
- import { onError } from '@orpc/server'
10
- import { NextRequest } from 'next/server'
11
-
12
- const rpcHandler = new RPCHandler(appRouter, {
13
- interceptors: [
14
- onError((error) => {
15
- console.error(error)
16
- }),
17
- ],
18
- })
19
- const apiHandler = new OpenAPIHandler(appRouter, {
20
- plugins: [
21
- new OpenAPIReferencePlugin({
22
- schemaConverters: [new ZodToJsonSchemaConverter()],
23
- }),
24
- ],
25
- interceptors: [
26
- onError((error) => {
27
- console.error(error)
28
- }),
29
- ],
30
- })
31
-
32
- async function handleRequest(req: NextRequest) {
33
- const rpcResult = await rpcHandler.handle(req, {
34
- prefix: '/rpc',
35
- context: {{#if (eq auth "better-auth")}}await createContext(req){{else}}{}{{/if}},
36
- })
37
- if (rpcResult.response) return rpcResult.response
38
-
39
- const apiResult = await apiHandler.handle(req, {
40
- prefix: '/rpc/api',
41
- context: {{#if (eq auth "better-auth")}}await createContext(req){{else}}{}{{/if}},
42
- })
43
- if (apiResult.response) return apiResult.response
44
-
45
- return new Response('Not found', { status: 404 })
46
- }
47
-
48
- export const GET = handleRequest
49
- export const POST = handleRequest
50
- export const PUT = handleRequest
51
- export const PATCH = handleRequest
52
- export const DELETE = handleRequest
@@ -1,14 +0,0 @@
1
- import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
2
- import { appRouter } from '@/routers';
3
- import { createContext } from '@/lib/context';
4
- import { NextRequest } from 'next/server';
5
-
6
- function handler(req: NextRequest) {
7
- return fetchRequestHandler({
8
- endpoint: '/trpc',
9
- req,
10
- router: appRouter,
11
- createContext: () => createContext(req)
12
- });
13
- }
14
- export { handler as GET, handler as POST };
@@ -1,5 +0,0 @@
1
- /// <reference types="next" />
2
- /// <reference types="next/image-types/global" />
3
-
4
- // NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,7 +0,0 @@
1
- import type { NextConfig } from "next";
2
-
3
- const nextConfig: NextConfig = {
4
- typedRoutes: true,
5
- };
6
-
7
- export default nextConfig;
@@ -1,27 +0,0 @@
1
- {
2
- "name": "server",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev --turbopack",
7
- "build": "next build",
8
- "start": "next start"
9
- },
10
- "dependencies": {
11
- "next": "15.5.0",
12
- "react": "19.1.0",
13
- "react-dom": "19.1.0",
14
- "dotenv": "^17.2.1"
15
- },
16
- {{#if (eq dbSetup 'supabase')}}
17
- "trustedDependencies": [
18
- "supabase"
19
- ],
20
- {{/if}}
21
- "devDependencies": {
22
- "@types/node": "^20",
23
- "@types/react": "~19.1.10",
24
- "zod": "^4.0.13",
25
- "typescript": "^5"
26
- }
27
- }
@@ -1,5 +0,0 @@
1
- import { NextResponse } from "next/server";
2
-
3
- export async function GET() {
4
- return NextResponse.json({ message: "OK" });
5
- }
@@ -1,19 +0,0 @@
1
- import { NextResponse } from "next/server";
2
-
3
- export function middleware() {
4
- const res = NextResponse.next()
5
-
6
- res.headers.append('Access-Control-Allow-Credentials', "true")
7
- res.headers.append('Access-Control-Allow-Origin', process.env.CORS_ORIGIN || "")
8
- res.headers.append('Access-Control-Allow-Methods', 'GET,POST,OPTIONS')
9
- res.headers.append(
10
- 'Access-Control-Allow-Headers',
11
- 'Content-Type, Authorization'
12
- )
13
-
14
- return res
15
- }
16
-
17
- export const config = {
18
- matcher: '/:path*',
19
- }
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": true,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "bundler",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "preserve",
15
- {{#unless (or (eq backend "convex") (eq backend "none"))}}
16
- "composite": true,
17
- {{/unless}}
18
- "incremental": true,
19
- "plugins": [
20
- {
21
- "name": "next"
22
- }
23
- ],
24
- "paths": {
25
- "@/*": ["./src/*"]
26
- {{#if (eq orm 'prisma')}},
27
- "prisma": ["node_modules/prisma"]
28
- {{/if}}
29
- },
30
- },
31
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
32
- "exclude": ["node_modules"]
33
- }
@@ -1,15 +0,0 @@
1
- import { google } from '@ai-sdk/google';
2
- import { streamText, type UIMessage, convertToModelMessages } from 'ai';
3
-
4
- export const maxDuration = 30;
5
-
6
- export async function POST(req: Request) {
7
- const { messages }: { messages: UIMessage[] } = await req.json();
8
-
9
- const result = streamText({
10
- model: google('gemini-2.0-flash'),
11
- messages: convertToModelMessages(messages),
12
- });
13
-
14
- return result.toUIMessageStreamResponse();
15
- }