0pflow 0.1.0-dev.00aaa03 → 0.1.0-dev.06e289c
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.
- package/dist/cli/index.d.ts +5 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +26 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install.d.ts +13 -4
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +93 -71
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/mcp/config.d.ts +0 -1
- package/dist/cli/mcp/config.d.ts.map +1 -1
- package/dist/cli/mcp/config.js +2 -4
- package/dist/cli/mcp/config.js.map +1 -1
- package/dist/cli/mcp/tools/createApp.d.ts.map +1 -1
- package/dist/cli/mcp/tools/createApp.js +6 -6
- package/dist/cli/mcp/tools/createApp.js.map +1 -1
- package/dist/cli/mcp/tools/setupAppSchema.d.ts.map +1 -1
- package/dist/cli/mcp/tools/setupAppSchema.js +5 -2
- package/dist/cli/mcp/tools/setupAppSchema.js.map +1 -1
- package/package.json +3 -2
- package/templates/app/.env.example +13 -0
- package/templates/app/README.md +29 -0
- package/templates/app/biome.jsonc +81 -0
- package/templates/app/drizzle.config.ts +12 -0
- package/templates/app/next.config.js +10 -0
- package/templates/app/package.json +52 -0
- package/templates/app/postcss.config.js +5 -0
- package/templates/app/public/favicon.ico +0 -0
- package/templates/app/src/app/_components/.gitkeep +0 -0
- package/templates/app/src/app/api/trpc/[trpc]/route.ts +34 -0
- package/templates/app/src/app/layout.tsx +29 -0
- package/templates/app/src/app/page.tsx +18 -0
- package/templates/app/src/env.js +46 -0
- package/templates/app/src/server/api/root.ts +21 -0
- package/templates/app/src/server/api/routers/.gitkeep +0 -0
- package/templates/app/src/server/api/trpc.ts +106 -0
- package/templates/app/src/server/db/index.ts +18 -0
- package/templates/app/src/server/db/schema.ts +14 -0
- package/templates/app/src/styles/globals.css +6 -0
- package/templates/app/src/styles/globals.css.orange +126 -0
- package/templates/app/src/trpc/query-client.ts +25 -0
- package/templates/app/src/trpc/react.tsx +78 -0
- package/templates/app/src/trpc/server.ts +30 -0
- package/templates/app/tsconfig.check.json +23 -0
- package/templates/app/tsconfig.json +42 -0
- package/templates/app/tsconfig.server.json +5 -0
- package/templates/app/tsconfig.test.json +21 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupAppSchema.js","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/setupAppSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,WAAW,GAAG;IAClB,qBAAqB,EAAE,CAAC;SACrB,MAAM,EAAE;SACR,QAAQ,CAAC,mCAAmC,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC1E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,KAAK,CACJ,mBAAmB,EACnB,kFAAkF,CACnF;SACA,QAAQ,CACP,sFAAsF,CACvF;CACK,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACnE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,C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ev.06e289c",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"templates"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"build": "tsc",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Since the ".env" file is gitignored, you can use the ".env.example" file to
|
|
2
|
+
# build a new ".env" file when you clone the repo. Keep this file up-to-date
|
|
3
|
+
# when you add new variables to `.env`.
|
|
4
|
+
|
|
5
|
+
# This file will be committed to version control, so make sure not to have any
|
|
6
|
+
# secrets in it. If you are cloning this repo, create a copy of this file named
|
|
7
|
+
# ".env" and populate it with your secrets.
|
|
8
|
+
|
|
9
|
+
# When adding additional environment variables, the schema in "/src/env.js"
|
|
10
|
+
# should be updated accordingly.
|
|
11
|
+
|
|
12
|
+
# Drizzle
|
|
13
|
+
DATABASE_URL="postgresql://postgres:password@localhost:5432/{{app_name}}"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# {{app_name}}
|
|
2
|
+
|
|
3
|
+
Built with [T3 Stack](https://create.t3.gg/).
|
|
4
|
+
|
|
5
|
+
## What's next? How do I make an app with this?
|
|
6
|
+
|
|
7
|
+
We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.
|
|
8
|
+
|
|
9
|
+
If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help.
|
|
10
|
+
|
|
11
|
+
- [Next.js](https://nextjs.org)
|
|
12
|
+
- [NextAuth.js](https://next-auth.js.org)
|
|
13
|
+
- [Prisma](https://prisma.io)
|
|
14
|
+
- [Drizzle](https://orm.drizzle.team)
|
|
15
|
+
- [Tailwind CSS](https://tailwindcss.com)
|
|
16
|
+
- [tRPC](https://trpc.io)
|
|
17
|
+
|
|
18
|
+
## Learn More
|
|
19
|
+
|
|
20
|
+
To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:
|
|
21
|
+
|
|
22
|
+
- [Documentation](https://create.t3.gg/)
|
|
23
|
+
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials
|
|
24
|
+
|
|
25
|
+
You can check out the [create-t3-app GitHub repository](https://github.com/t3-oss/create-t3-app) — your feedback and contributions are welcome!
|
|
26
|
+
|
|
27
|
+
## How do I deploy this?
|
|
28
|
+
|
|
29
|
+
Follow our deployment guides for [Vercel](https://create.t3.gg/en/deployment/vercel), [Netlify](https://create.t3.gg/en/deployment/netlify) and [Docker](https://create.t3.gg/en/deployment/docker) for more information.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"root": true,
|
|
4
|
+
"vcs": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"useIgnoreFile": true,
|
|
7
|
+
"clientKind": "git"
|
|
8
|
+
},
|
|
9
|
+
"assist": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"actions": {
|
|
12
|
+
"recommended": true,
|
|
13
|
+
"source": {
|
|
14
|
+
"recommended": true,
|
|
15
|
+
"organizeImports": "on",
|
|
16
|
+
"useSortedAttributes": "on"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"formatter": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"indentStyle": "space",
|
|
23
|
+
"indentWidth": 2
|
|
24
|
+
},
|
|
25
|
+
"linter": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"rules": {
|
|
28
|
+
"recommended": true,
|
|
29
|
+
"correctness": {
|
|
30
|
+
"noUnusedImports": {
|
|
31
|
+
"level": "error",
|
|
32
|
+
"fix": "safe"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"nursery": {
|
|
36
|
+
"useSortedClasses": {
|
|
37
|
+
"level": "warn",
|
|
38
|
+
"fix": "safe",
|
|
39
|
+
"options": {
|
|
40
|
+
"functions": [
|
|
41
|
+
"clsx",
|
|
42
|
+
"cva",
|
|
43
|
+
"cn"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"html": {
|
|
51
|
+
"formatter": {
|
|
52
|
+
"enabled": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"javascript": {
|
|
56
|
+
"assist": {
|
|
57
|
+
"enabled": true
|
|
58
|
+
},
|
|
59
|
+
"formatter": {
|
|
60
|
+
"enabled": true
|
|
61
|
+
},
|
|
62
|
+
"linter": {
|
|
63
|
+
"enabled": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"css": {
|
|
67
|
+
"assist": {
|
|
68
|
+
"enabled": true
|
|
69
|
+
},
|
|
70
|
+
"formatter": {
|
|
71
|
+
"enabled": true
|
|
72
|
+
},
|
|
73
|
+
"linter": {
|
|
74
|
+
"enabled": true
|
|
75
|
+
},
|
|
76
|
+
"parser": {
|
|
77
|
+
"cssModules": true,
|
|
78
|
+
"tailwindDirectives": true
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Config } from "drizzle-kit";
|
|
2
|
+
|
|
3
|
+
import { env } from "~/env";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
schema: "./src/server/db/schema.ts",
|
|
7
|
+
dialect: "postgresql",
|
|
8
|
+
dbCredentials: {
|
|
9
|
+
url: env.DATABASE_URL,
|
|
10
|
+
},
|
|
11
|
+
schemaFilter: [env.DATABASE_SCHEMA],
|
|
12
|
+
} satisfies Config;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{app_name}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"check": "biome check .",
|
|
9
|
+
"check:unsafe": "biome check --write --unsafe .",
|
|
10
|
+
"check:write": "biome check --write .",
|
|
11
|
+
"db:generate": "drizzle-kit generate",
|
|
12
|
+
"db:migrate": "drizzle-kit migrate",
|
|
13
|
+
"db:push": "drizzle-kit push",
|
|
14
|
+
"db:studio": "drizzle-kit studio",
|
|
15
|
+
"dev": "next dev --turbo",
|
|
16
|
+
"0pflow": "0pflow",
|
|
17
|
+
"preview": "next build && next start",
|
|
18
|
+
"start": "next start",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"0pflow": "*",
|
|
23
|
+
"@t3-oss/env-nextjs": "^0.13.10",
|
|
24
|
+
"@tanstack/react-query": "^5.90.19",
|
|
25
|
+
"@trpc/client": "^11.8.1",
|
|
26
|
+
"@trpc/react-query": "^11.8.1",
|
|
27
|
+
"@trpc/server": "^11.8.1",
|
|
28
|
+
"drizzle-orm": "^0.41.0",
|
|
29
|
+
"next": "^16.1.4",
|
|
30
|
+
"postgres": "^3.4.8",
|
|
31
|
+
"react": "^19.2.3",
|
|
32
|
+
"react-dom": "^19.2.3",
|
|
33
|
+
"server-only": "^0.0.1",
|
|
34
|
+
"superjson": "^2.2.6",
|
|
35
|
+
"zod": "^4.3.5"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@biomejs/biome": "^2.3.11",
|
|
39
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
40
|
+
"@types/node": "^25.0.9",
|
|
41
|
+
"@types/react": "^19.2.9",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
43
|
+
"drizzle-kit": "^0.31.8",
|
|
44
|
+
"postcss": "^8.5.6",
|
|
45
|
+
"tailwindcss": "^4.1.18",
|
|
46
|
+
"typescript": "^5.9.3"
|
|
47
|
+
},
|
|
48
|
+
"ct3aMetadata": {
|
|
49
|
+
"initVersion": "7.40.0"
|
|
50
|
+
},
|
|
51
|
+
"packageManager": "npm@11.7.0"
|
|
52
|
+
}
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
|
2
|
+
import { type NextRequest } from "next/server";
|
|
3
|
+
|
|
4
|
+
import { env } from "~/env";
|
|
5
|
+
import { appRouter } from "~/server/api/root";
|
|
6
|
+
import { createTRPCContext } from "~/server/api/trpc";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when
|
|
10
|
+
* handling a HTTP request (e.g. when you make requests from Client Components).
|
|
11
|
+
*/
|
|
12
|
+
const createContext = async (req: NextRequest) => {
|
|
13
|
+
return createTRPCContext({
|
|
14
|
+
headers: req.headers,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const handler = (req: NextRequest) =>
|
|
19
|
+
fetchRequestHandler({
|
|
20
|
+
endpoint: "/api/trpc",
|
|
21
|
+
req,
|
|
22
|
+
router: appRouter,
|
|
23
|
+
createContext: () => createContext(req),
|
|
24
|
+
onError:
|
|
25
|
+
env.NODE_ENV === "development"
|
|
26
|
+
? ({ path, error }) => {
|
|
27
|
+
console.error(
|
|
28
|
+
`❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
: undefined,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { handler as GET, handler as POST };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "~/styles/globals.css";
|
|
2
|
+
|
|
3
|
+
import { type Metadata } from "next";
|
|
4
|
+
import { Geist } from "next/font/google";
|
|
5
|
+
|
|
6
|
+
import { TRPCReactProvider } from "~/trpc/react";
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: "{{app_name}}",
|
|
10
|
+
description: "{{product_brief}}",
|
|
11
|
+
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const geist = Geist({
|
|
15
|
+
subsets: ["latin"],
|
|
16
|
+
variable: "--font-geist-sans",
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export default function RootLayout({
|
|
20
|
+
children,
|
|
21
|
+
}: Readonly<{ children: React.ReactNode }>) {
|
|
22
|
+
return (
|
|
23
|
+
<html lang="en" className={`${geist.variable}`}>
|
|
24
|
+
<body>
|
|
25
|
+
<TRPCReactProvider>{children}</TRPCReactProvider>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HydrateClient } from "~/trpc/server";
|
|
2
|
+
|
|
3
|
+
export default async function Home() {
|
|
4
|
+
return (
|
|
5
|
+
<HydrateClient>
|
|
6
|
+
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
|
|
7
|
+
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
|
|
8
|
+
<h1 className="text-5xl font-extrabold tracking-tight sm:text-[5rem]">
|
|
9
|
+
{{app_name}}
|
|
10
|
+
</h1>
|
|
11
|
+
<p className="text-2xl text-white/70">
|
|
12
|
+
0pflow workflow app
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
</main>
|
|
16
|
+
</HydrateClient>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createEnv } from "@t3-oss/env-nextjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const env = createEnv({
|
|
5
|
+
/**
|
|
6
|
+
* Specify your server-side environment variables schema here. This way you can ensure the app
|
|
7
|
+
* isn't built with invalid env vars.
|
|
8
|
+
*/
|
|
9
|
+
server: {
|
|
10
|
+
DATABASE_URL: z.string().url(),
|
|
11
|
+
DATABASE_SCHEMA: z.string().default("{{app_name}}"),
|
|
12
|
+
NODE_ENV: z
|
|
13
|
+
.enum(["development", "test", "production"])
|
|
14
|
+
.default("development"),
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Specify your client-side environment variables schema here. This way you can ensure the app
|
|
19
|
+
* isn't built with invalid env vars. To expose them to the client, prefix them with
|
|
20
|
+
* `NEXT_PUBLIC_`.
|
|
21
|
+
*/
|
|
22
|
+
client: {
|
|
23
|
+
// NEXT_PUBLIC_CLIENTVAR: z.string(),
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
|
|
28
|
+
* middlewares) or client-side so we need to destruct manually.
|
|
29
|
+
*/
|
|
30
|
+
runtimeEnv: {
|
|
31
|
+
DATABASE_URL: process.env.DATABASE_URL,
|
|
32
|
+
DATABASE_SCHEMA: process.env.DATABASE_SCHEMA,
|
|
33
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
34
|
+
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
|
|
38
|
+
* useful for Docker builds.
|
|
39
|
+
*/
|
|
40
|
+
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
|
|
41
|
+
/**
|
|
42
|
+
* Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
|
|
43
|
+
* `SOME_VAR=''` will throw an error.
|
|
44
|
+
*/
|
|
45
|
+
emptyStringAsUndefined: true,
|
|
46
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createCallerFactory, createTRPCRouter, publicProcedure } from "~/server/api/trpc";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is the primary router for your server.
|
|
5
|
+
*
|
|
6
|
+
* All routers added in /api/routers should be manually added here.
|
|
7
|
+
*/
|
|
8
|
+
export const appRouter = createTRPCRouter({
|
|
9
|
+
health: publicProcedure.query(() => ({ status: "ok" })),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// export type definition of API
|
|
13
|
+
export type AppRouter = typeof appRouter;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create a server-side caller for the tRPC API.
|
|
17
|
+
* @example
|
|
18
|
+
* const trpc = createCaller(createContext);
|
|
19
|
+
* const res = await trpc.health();
|
|
20
|
+
*/
|
|
21
|
+
export const createCaller = createCallerFactory(appRouter);
|
|
File without changes
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS:
|
|
3
|
+
* 1. You want to modify request context (see Part 1).
|
|
4
|
+
* 2. You want to create a new middleware or type of procedure (see Part 3).
|
|
5
|
+
*
|
|
6
|
+
* TL;DR - This is where all the tRPC server stuff is created and plugged in. The pieces you will
|
|
7
|
+
* need to use are documented accordingly near the end.
|
|
8
|
+
*/
|
|
9
|
+
import { initTRPC } from "@trpc/server";
|
|
10
|
+
import superjson from "superjson";
|
|
11
|
+
import { ZodError } from "zod";
|
|
12
|
+
|
|
13
|
+
import { db } from "~/server/db";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 1. CONTEXT
|
|
17
|
+
*
|
|
18
|
+
* This section defines the "contexts" that are available in the backend API.
|
|
19
|
+
*
|
|
20
|
+
* These allow you to access things when processing a request, like the database, the session, etc.
|
|
21
|
+
*
|
|
22
|
+
* This helper generates the "internals" for a tRPC context. The API handler and RSC clients each
|
|
23
|
+
* wrap this and provides the required context.
|
|
24
|
+
*
|
|
25
|
+
* @see https://trpc.io/docs/server/context
|
|
26
|
+
*/
|
|
27
|
+
export const createTRPCContext = async (opts: { headers: Headers }) => {
|
|
28
|
+
return {
|
|
29
|
+
db,
|
|
30
|
+
...opts,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 2. INITIALIZATION
|
|
36
|
+
*
|
|
37
|
+
* This is where the tRPC API is initialized, connecting the context and transformer. We also parse
|
|
38
|
+
* ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
|
|
39
|
+
* errors on the backend.
|
|
40
|
+
*/
|
|
41
|
+
const t = initTRPC.context<typeof createTRPCContext>().create({
|
|
42
|
+
transformer: superjson,
|
|
43
|
+
errorFormatter({ shape, error }) {
|
|
44
|
+
return {
|
|
45
|
+
...shape,
|
|
46
|
+
data: {
|
|
47
|
+
...shape.data,
|
|
48
|
+
zodError:
|
|
49
|
+
error.cause instanceof ZodError ? error.cause.flatten() : null,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Create a server-side caller.
|
|
57
|
+
*
|
|
58
|
+
* @see https://trpc.io/docs/server/server-side-calls
|
|
59
|
+
*/
|
|
60
|
+
export const createCallerFactory = t.createCallerFactory;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 3. ROUTER & PROCEDURE (THE IMPORTANT BIT)
|
|
64
|
+
*
|
|
65
|
+
* These are the pieces you use to build your tRPC API. You should import these a lot in the
|
|
66
|
+
* "/src/server/api/routers" directory.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* This is how you create new routers and sub-routers in your tRPC API.
|
|
71
|
+
*
|
|
72
|
+
* @see https://trpc.io/docs/router
|
|
73
|
+
*/
|
|
74
|
+
export const createTRPCRouter = t.router;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Middleware for timing procedure execution and adding an artificial delay in development.
|
|
78
|
+
*
|
|
79
|
+
* You can remove this if you don't like it, but it can help catch unwanted waterfalls by simulating
|
|
80
|
+
* network latency that would occur in production but not in local development.
|
|
81
|
+
*/
|
|
82
|
+
const timingMiddleware = t.middleware(async ({ next, path }) => {
|
|
83
|
+
const start = Date.now();
|
|
84
|
+
|
|
85
|
+
if (t._config.isDev) {
|
|
86
|
+
// artificial delay in dev
|
|
87
|
+
const waitMs = Math.floor(Math.random() * 400) + 100;
|
|
88
|
+
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const result = await next();
|
|
92
|
+
|
|
93
|
+
const end = Date.now();
|
|
94
|
+
console.log(`[TRPC] ${path} took ${end - start}ms to execute`);
|
|
95
|
+
|
|
96
|
+
return result;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Public (unauthenticated) procedure
|
|
101
|
+
*
|
|
102
|
+
* This is the base piece you use to build new queries and mutations on your tRPC API. It does not
|
|
103
|
+
* guarantee that a user querying is authorized, but you can still access user session data if they
|
|
104
|
+
* are logged in.
|
|
105
|
+
*/
|
|
106
|
+
export const publicProcedure = t.procedure.use(timingMiddleware);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { drizzle } from "drizzle-orm/postgres-js";
|
|
2
|
+
import postgres from "postgres";
|
|
3
|
+
|
|
4
|
+
import { env } from "~/env";
|
|
5
|
+
import * as schema from "./schema";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Cache the database connection in development. This avoids creating a new connection on every HMR
|
|
9
|
+
* update.
|
|
10
|
+
*/
|
|
11
|
+
const globalForDb = globalThis as unknown as {
|
|
12
|
+
conn: postgres.Sql | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const conn = globalForDb.conn ?? postgres(env.DATABASE_URL);
|
|
16
|
+
if (env.NODE_ENV !== "production") globalForDb.conn = conn;
|
|
17
|
+
|
|
18
|
+
export const db = drizzle(conn, { schema });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { pgSchema } from "drizzle-orm/pg-core";
|
|
2
|
+
import { env } from "~/env";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Use a dedicated PostgreSQL schema for this app's tables.
|
|
6
|
+
* @see https://orm.drizzle.team/docs/schemas
|
|
7
|
+
*/
|
|
8
|
+
export const schema = pgSchema(env.DATABASE_SCHEMA);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Helper to create tables in the app's schema.
|
|
12
|
+
* Always use this instead of pgTable to ensure tables are in the correct schema.
|
|
13
|
+
*/
|
|
14
|
+
const createTable = schema.table;
|