0pflow 0.1.0-dev.4fd2ac2 → 0.1.0-dev.628bd97

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 (35) hide show
  1. package/dist/cli/mcp/config.d.ts +1 -0
  2. package/dist/cli/mcp/config.d.ts.map +1 -1
  3. package/dist/cli/mcp/config.js +4 -2
  4. package/dist/cli/mcp/config.js.map +1 -1
  5. package/dist/cli/mcp/tools/createApp.d.ts.map +1 -1
  6. package/dist/cli/mcp/tools/createApp.js +1 -3
  7. package/dist/cli/mcp/tools/createApp.js.map +1 -1
  8. package/package.json +2 -3
  9. package/templates/app/.env.example +0 -13
  10. package/templates/app/README.md +0 -29
  11. package/templates/app/biome.jsonc +0 -81
  12. package/templates/app/drizzle.config.ts +0 -12
  13. package/templates/app/next.config.js +0 -10
  14. package/templates/app/package.json +0 -52
  15. package/templates/app/postcss.config.js +0 -5
  16. package/templates/app/public/favicon.ico +0 -0
  17. package/templates/app/src/app/_components/.gitkeep +0 -0
  18. package/templates/app/src/app/api/trpc/[trpc]/route.ts +0 -34
  19. package/templates/app/src/app/layout.tsx +0 -29
  20. package/templates/app/src/app/page.tsx +0 -18
  21. package/templates/app/src/env.js +0 -46
  22. package/templates/app/src/server/api/root.ts +0 -21
  23. package/templates/app/src/server/api/routers/.gitkeep +0 -0
  24. package/templates/app/src/server/api/trpc.ts +0 -106
  25. package/templates/app/src/server/db/index.ts +0 -18
  26. package/templates/app/src/server/db/schema.ts +0 -14
  27. package/templates/app/src/styles/globals.css +0 -6
  28. package/templates/app/src/styles/globals.css.orange +0 -126
  29. package/templates/app/src/trpc/query-client.ts +0 -25
  30. package/templates/app/src/trpc/react.tsx +0 -78
  31. package/templates/app/src/trpc/server.ts +0 -30
  32. package/templates/app/tsconfig.check.json +0 -23
  33. package/templates/app/tsconfig.json +0 -42
  34. package/templates/app/tsconfig.server.json +0 -5
  35. package/templates/app/tsconfig.test.json +0 -21
@@ -1,4 +1,5 @@
1
1
  export declare const packageRoot: string;
2
+ export declare const monorepoRoot: string;
2
3
  export declare const templatesDir: string;
3
4
  export declare const version: string;
4
5
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/config.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,QAAoC,CAAC;AAG7D,eAAO,MAAM,YAAY,QAAiC,CAAC;AAM3D,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/config.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,QAAoC,CAAC;AAG7D,eAAO,MAAM,YAAY,QAAgC,CAAC;AAG1D,eAAO,MAAM,YAAY,QAAkC,CAAC;AAM5D,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC"}
@@ -4,8 +4,10 @@ import { fileURLToPath } from "node:url";
4
4
  const __dirname = dirname(fileURLToPath(import.meta.url));
5
5
  // Package root directory (relative to dist/cli/mcp/)
6
6
  export const packageRoot = join(__dirname, "..", "..", "..");
7
- // Templates directory (bundled with the package)
8
- export const templatesDir = join(packageRoot, "templates");
7
+ // Monorepo root (up from packages/core)
8
+ export const monorepoRoot = join(packageRoot, "..", "..");
9
+ // Templates directory at monorepo root level
10
+ export const templatesDir = join(monorepoRoot, "templates");
9
11
  // Read version from package.json
10
12
  const pkg = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf-8"));
11
13
  export const version = pkg.version;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/cli/mcp/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GA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AAE,cAAc,CAAC,EAAE,OAAO,CAAC,CACzD,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createApp.d.ts","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/createApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAmBjD,QAAA,MAAM,WAAW;;;CAMP,CAAC;AAEX,QAAA,MAAM,YAAY;;;;CAIR,CAAC;AAQX,eAAO,MAAM,gBAAgB,EAAE,UAAU,CACvC,aAAa,EACb,OAAO,WAAW,EAClB,OAAO,YAAY,CAuDpB,CAAC"}
1
+ {"version":3,"file":"createApp.d.ts","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/createApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgBjD,QAAA,MAAM,WAAW;;;CAMP,CAAC;AAEX,QAAA,MAAM,YAAY;;;;CAIR,CAAC;AAQX,eAAO,MAAM,gBAAgB,EAAE,UAAU,CACvC,aAAa,EACb,OAAO,WAAW,EAClB,OAAO,YAAY,CAuDpB,CAAC"}
@@ -2,10 +2,8 @@ import { exec } from "node:child_process";
2
2
  import { existsSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { z } from "zod";
5
- import { packageRoot } from "../config.js";
5
+ import { monorepoRoot } from "../config.js";
6
6
  import { writeAppTemplates, create0pflowDirectories } from "../lib/templates.js";
7
- // Monorepo root (only valid in dev mode when running from packages/core)
8
- const monorepoRoot = join(packageRoot, "..", "..");
9
7
  // Check if running in development mode (monorepo with packages/core exists)
10
8
  function isDevMode() {
11
9
  const corePath = join(monorepoRoot, "packages", "core");
@@ -1 +1 @@
1
- {"version":3,"file":"createApp.js","sourceRoot":"","sources":["../../../../src/cli/mcp/tools/createApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAGjF,yEAAyE;AACzE,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEnD,4EAA4E;AAC5E,SAAS,SAAS;IAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,GAAY,EAAE,EAAE,CAC9C,IAAI,OAAO,CAAqC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAClE,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,KAAK;YAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;;YAC/C,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,MAAM,WAAW,GAAG;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gBACH,iDAAiD;gBACjD,MAAM,iBAAiB,CAAC,OAAO,EAAE;oBAC/B,QAAQ,EAAE,OAAO;iBAClB,CAAC,CAAC;gBAEH,qCAAqC;gBACrC,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;gBAEvC,+DAA+D;gBAC/D,IAAI,SAAS,EAAE,EAAE,CAAC;oBAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;oBACxD,kCAAkC;oBAClC,MAAM,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;oBACtC,0BAA0B;oBAC1B,MAAM,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;gBAC9C,CAAC;gBAED,oCAAoC;gBACpC,IAAI,YAAY,EAAE,CAAC;oBACjB,MAAM,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;gBAC1C,CAAC;gBAED,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,uBAAuB,OAAO,QAAQ,OAAO,EAAE;oBACxD,IAAI,EAAE,OAAO;iBACd,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,KAAK,GAAG,GAAkC,CAAC;gBACjD,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,yBAAyB,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE;iBACzE,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "0pflow",
3
- "version": "0.1.0-dev.4fd2ac2",
3
+ "version": "0.1.0-dev.628bd97",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,8 +18,7 @@
18
18
  }
19
19
  },
20
20
  "files": [
21
- "dist",
22
- "templates"
21
+ "dist"
23
22
  ],
24
23
  "scripts": {
25
24
  "build": "tsc",
@@ -1,13 +0,0 @@
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}}"
@@ -1,29 +0,0 @@
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.
@@ -1,81 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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;
@@ -1,10 +0,0 @@
1
- /**
2
- * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
3
- * for Docker builds.
4
- */
5
- import "./src/env.js";
6
-
7
- /** @type {import("next").NextConfig} */
8
- const config = {};
9
-
10
- export default config;
@@ -1,52 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- plugins: {
3
- "@tailwindcss/postcss": {},
4
- },
5
- };
Binary file
File without changes
@@ -1,34 +0,0 @@
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 };
@@ -1,29 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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
- }
@@ -1,46 +0,0 @@
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
- });
@@ -1,21 +0,0 @@
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
@@ -1,106 +0,0 @@
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);
@@ -1,18 +0,0 @@
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 });
@@ -1,14 +0,0 @@
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;
@@ -1,6 +0,0 @@
1
- @import "tailwindcss";
2
-
3
- @theme {
4
- --font-sans: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif,
5
- "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
6
- }
@@ -1,126 +0,0 @@
1
- @import "tailwindcss";
2
- @import "tw-animate-css";
3
-
4
- @custom-variant dark (&:is(.dark *));
5
-
6
- @theme {
7
- --font-sans: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif,
8
- "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
9
- }
10
-
11
- @theme inline {
12
- --radius-sm: calc(var(--radius) - 4px);
13
- --radius-md: calc(var(--radius) - 2px);
14
- --radius-lg: var(--radius);
15
- --radius-xl: calc(var(--radius) + 4px);
16
- --color-background: var(--background);
17
- --color-foreground: var(--foreground);
18
- --color-card: var(--card);
19
- --color-card-foreground: var(--card-foreground);
20
- --color-popover: var(--popover);
21
- --color-popover-foreground: var(--popover-foreground);
22
- --color-primary: var(--primary);
23
- --color-primary-foreground: var(--primary-foreground);
24
- --color-secondary: var(--secondary);
25
- --color-secondary-foreground: var(--secondary-foreground);
26
- --color-muted: var(--muted);
27
- --color-muted-foreground: var(--muted-foreground);
28
- --color-accent: var(--accent);
29
- --color-accent-foreground: var(--accent-foreground);
30
- --color-destructive: var(--destructive);
31
- --color-border: var(--border);
32
- --color-input: var(--input);
33
- --color-ring: var(--ring);
34
- --color-chart-1: var(--chart-1);
35
- --color-chart-2: var(--chart-2);
36
- --color-chart-3: var(--chart-3);
37
- --color-chart-4: var(--chart-4);
38
- --color-chart-5: var(--chart-5);
39
- --color-sidebar: var(--sidebar);
40
- --color-sidebar-foreground: var(--sidebar-foreground);
41
- --color-sidebar-primary: var(--sidebar-primary);
42
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
43
- --color-sidebar-accent: var(--sidebar-accent);
44
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
45
- --color-sidebar-border: var(--sidebar-border);
46
- --color-sidebar-ring: var(--sidebar-ring);
47
- }
48
-
49
- :root {
50
- --radius: 0.65rem;
51
- --background: oklch(1 0 0);
52
- --foreground: oklch(0.141 0.005 285.823);
53
- --card: oklch(1 0 0);
54
- --card-foreground: oklch(0.141 0.005 285.823);
55
- --popover: oklch(1 0 0);
56
- --popover-foreground: oklch(0.141 0.005 285.823);
57
- --primary: oklch(0.646 0.222 41.116);
58
- --primary-foreground: oklch(0.98 0.016 73.684);
59
- --secondary: oklch(0.967 0.001 286.375);
60
- --secondary-foreground: oklch(0.21 0.006 285.885);
61
- --muted: oklch(0.967 0.001 286.375);
62
- --muted-foreground: oklch(0.552 0.016 285.938);
63
- --accent: oklch(0.967 0.001 286.375);
64
- --accent-foreground: oklch(0.21 0.006 285.885);
65
- --destructive: oklch(0.577 0.245 27.325);
66
- --border: oklch(0.92 0.004 286.32);
67
- --input: oklch(0.92 0.004 286.32);
68
- --ring: oklch(0.75 0.183 55.934);
69
- --chart-1: oklch(0.837 0.128 66.29);
70
- --chart-2: oklch(0.705 0.213 47.604);
71
- --chart-3: oklch(0.646 0.222 41.116);
72
- --chart-4: oklch(0.553 0.195 38.402);
73
- --chart-5: oklch(0.47 0.157 37.304);
74
- --sidebar: oklch(0.985 0 0);
75
- --sidebar-foreground: oklch(0.141 0.005 285.823);
76
- --sidebar-primary: oklch(0.646 0.222 41.116);
77
- --sidebar-primary-foreground: oklch(0.98 0.016 73.684);
78
- --sidebar-accent: oklch(0.967 0.001 286.375);
79
- --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
80
- --sidebar-border: oklch(0.92 0.004 286.32);
81
- --sidebar-ring: oklch(0.75 0.183 55.934);
82
- }
83
-
84
- .dark {
85
- --background: oklch(0.141 0.005 285.823);
86
- --foreground: oklch(0.985 0 0);
87
- --card: oklch(0.21 0.006 285.885);
88
- --card-foreground: oklch(0.985 0 0);
89
- --popover: oklch(0.21 0.006 285.885);
90
- --popover-foreground: oklch(0.985 0 0);
91
- --primary: oklch(0.705 0.213 47.604);
92
- --primary-foreground: oklch(0.98 0.016 73.684);
93
- --secondary: oklch(0.274 0.006 286.033);
94
- --secondary-foreground: oklch(0.985 0 0);
95
- --muted: oklch(0.274 0.006 286.033);
96
- --muted-foreground: oklch(0.705 0.015 286.067);
97
- --accent: oklch(0.274 0.006 286.033);
98
- --accent-foreground: oklch(0.985 0 0);
99
- --destructive: oklch(0.704 0.191 22.216);
100
- --border: oklch(1 0 0 / 10%);
101
- --input: oklch(1 0 0 / 15%);
102
- --ring: oklch(0.408 0.123 38.172);
103
- --chart-1: oklch(0.837 0.128 66.29);
104
- --chart-2: oklch(0.705 0.213 47.604);
105
- --chart-3: oklch(0.646 0.222 41.116);
106
- --chart-4: oklch(0.553 0.195 38.402);
107
- --chart-5: oklch(0.47 0.157 37.304);
108
- --sidebar: oklch(0.21 0.006 285.885);
109
- --sidebar-foreground: oklch(0.985 0 0);
110
- --sidebar-primary: oklch(0.705 0.213 47.604);
111
- --sidebar-primary-foreground: oklch(0.98 0.016 73.684);
112
- --sidebar-accent: oklch(0.274 0.006 286.033);
113
- --sidebar-accent-foreground: oklch(0.985 0 0);
114
- --sidebar-border: oklch(1 0 0 / 10%);
115
- --sidebar-ring: oklch(0.408 0.123 38.172);
116
- }
117
-
118
- @layer base {
119
- * {
120
- @apply border-border outline-ring/50;
121
- }
122
-
123
- body {
124
- @apply bg-background text-foreground;
125
- }
126
- }
@@ -1,25 +0,0 @@
1
- import {
2
- defaultShouldDehydrateQuery,
3
- QueryClient,
4
- } from "@tanstack/react-query";
5
- import SuperJSON from "superjson";
6
-
7
- export const createQueryClient = () =>
8
- new QueryClient({
9
- defaultOptions: {
10
- queries: {
11
- // With SSR, we usually want to set some default staleTime
12
- // above 0 to avoid refetching immediately on the client
13
- staleTime: 30 * 1000,
14
- },
15
- dehydrate: {
16
- serializeData: SuperJSON.serialize,
17
- shouldDehydrateQuery: (query) =>
18
- defaultShouldDehydrateQuery(query) ||
19
- query.state.status === "pending",
20
- },
21
- hydrate: {
22
- deserializeData: SuperJSON.deserialize,
23
- },
24
- },
25
- });
@@ -1,78 +0,0 @@
1
- "use client";
2
-
3
- import { QueryClientProvider, type QueryClient } from "@tanstack/react-query";
4
- import { httpBatchStreamLink, loggerLink } from "@trpc/client";
5
- import { createTRPCReact } from "@trpc/react-query";
6
- import { type inferRouterInputs, type inferRouterOutputs } from "@trpc/server";
7
- import { useState } from "react";
8
- import SuperJSON from "superjson";
9
-
10
- import { type AppRouter } from "~/server/api/root";
11
- import { createQueryClient } from "./query-client";
12
-
13
- let clientQueryClientSingleton: QueryClient | undefined = undefined;
14
- const getQueryClient = () => {
15
- if (typeof window === "undefined") {
16
- // Server: always make a new query client
17
- return createQueryClient();
18
- }
19
- // Browser: use singleton pattern to keep the same query client
20
- clientQueryClientSingleton ??= createQueryClient();
21
-
22
- return clientQueryClientSingleton;
23
- };
24
-
25
- export const api = createTRPCReact<AppRouter>();
26
-
27
- /**
28
- * Inference helper for inputs.
29
- *
30
- * @example type HelloInput = RouterInputs['example']['hello']
31
- */
32
- export type RouterInputs = inferRouterInputs<AppRouter>;
33
-
34
- /**
35
- * Inference helper for outputs.
36
- *
37
- * @example type HelloOutput = RouterOutputs['example']['hello']
38
- */
39
- export type RouterOutputs = inferRouterOutputs<AppRouter>;
40
-
41
- export function TRPCReactProvider(props: { children: React.ReactNode }) {
42
- const queryClient = getQueryClient();
43
-
44
- const [trpcClient] = useState(() =>
45
- api.createClient({
46
- links: [
47
- loggerLink({
48
- enabled: (op) =>
49
- process.env.NODE_ENV === "development" ||
50
- (op.direction === "down" && op.result instanceof Error),
51
- }),
52
- httpBatchStreamLink({
53
- transformer: SuperJSON,
54
- url: `${getBaseUrl()}/api/trpc`,
55
- headers: () => {
56
- const headers = new Headers();
57
- headers.set("x-trpc-source", "nextjs-react");
58
- return headers;
59
- },
60
- }),
61
- ],
62
- })
63
- );
64
-
65
- return (
66
- <QueryClientProvider client={queryClient}>
67
- <api.Provider client={trpcClient} queryClient={queryClient}>
68
- {props.children}
69
- </api.Provider>
70
- </QueryClientProvider>
71
- );
72
- }
73
-
74
- function getBaseUrl() {
75
- if (typeof window !== "undefined") return window.location.origin;
76
- if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`;
77
- return `http://localhost:${process.env.PORT ?? 3000}`;
78
- }
@@ -1,30 +0,0 @@
1
- import "server-only";
2
-
3
- import { createHydrationHelpers } from "@trpc/react-query/rsc";
4
- import { headers } from "next/headers";
5
- import { cache } from "react";
6
-
7
- import { createCaller, type AppRouter } from "~/server/api/root";
8
- import { createTRPCContext } from "~/server/api/trpc";
9
- import { createQueryClient } from "./query-client";
10
-
11
- /**
12
- * This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when
13
- * handling a tRPC call from a React Server Component.
14
- */
15
- const createContext = cache(async () => {
16
- const heads = new Headers(await headers());
17
- heads.set("x-trpc-source", "rsc");
18
-
19
- return createTRPCContext({
20
- headers: heads,
21
- });
22
- });
23
-
24
- const getQueryClient = cache(createQueryClient);
25
- const caller = createCaller(createContext);
26
-
27
- export const { trpc: api, HydrateClient } = createHydrationHelpers<AppRouter>(
28
- caller,
29
- getQueryClient
30
- );
@@ -1,23 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "noUnusedLocals": true,
5
- "noUnusedParameters": true,
6
- "allowUnreachableCode": false,
7
- "allowUnusedLabels": false
8
- },
9
- "exclude": [
10
- "node_modules",
11
- ".next",
12
- "dist",
13
- "coverage",
14
- "**/*.test.ts",
15
- "**/*.test.tsx",
16
- "**/*.spec.ts",
17
- "**/*.spec.tsx",
18
- "src/**/__tests__/**",
19
- "tests/**",
20
- "vitest.config.*",
21
- "vitest.setup.*"
22
- ]
23
- }
@@ -1,42 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Base Options: */
4
- "esModuleInterop": true,
5
- "skipLibCheck": true,
6
- "target": "es2022",
7
- "allowJs": true,
8
- "resolveJsonModule": true,
9
- "moduleDetection": "force",
10
- "isolatedModules": true,
11
- "verbatimModuleSyntax": true,
12
-
13
- /* Strictness */
14
- "strict": true,
15
- "noUncheckedIndexedAccess": true,
16
- "checkJs": true,
17
-
18
- /* Bundled projects */
19
- "lib": ["dom", "dom.iterable", "ES2022"],
20
- "noEmit": true,
21
- "module": "ESNext",
22
- "moduleResolution": "Bundler",
23
- "jsx": "preserve",
24
- "plugins": [{ "name": "next" }],
25
- "incremental": true,
26
-
27
- /* Path Aliases */
28
- "baseUrl": ".",
29
- "paths": {
30
- "~/*": ["./src/*"]
31
- }
32
- },
33
- "include": [
34
- "next-env.d.ts",
35
- "**/*.ts",
36
- "**/*.tsx",
37
- "**/*.cjs",
38
- "**/*.js",
39
- ".next/types/**/*.ts"
40
- ],
41
- "exclude": ["node_modules", "generated"]
42
- }
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": ["src/server/**/*.ts", "src/env.js"],
4
- "exclude": ["node_modules"]
5
- }
@@ -1,21 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "noUnusedLocals": true,
5
- "noUnusedParameters": true,
6
- "allowUnreachableCode": false,
7
- },
8
- "include": [
9
- "**/*.test.ts",
10
- "**/*.test.tsx",
11
- "**/*.spec.ts",
12
- "**/*.spec.tsx",
13
- "src/**/__tests__/*.ts",
14
- "src/**/__tests__/*.tsx",
15
- "src/tests/**/*.ts",
16
- "tests/**/*.ts",
17
- "tests/**/*.tsx",
18
- "vitest.config.*",
19
- "vitest.setup.*"
20
- ]
21
- }