create-z3 0.0.1

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 (65) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +50 -0
  3. package/package.json +54 -0
  4. package/templates/tanstack-start/.env.example +45 -0
  5. package/templates/tanstack-start/.prettierignore +18 -0
  6. package/templates/tanstack-start/README.md +221 -0
  7. package/templates/tanstack-start/components.json +24 -0
  8. package/templates/tanstack-start/convex/_generated/api.d.ts +65 -0
  9. package/templates/tanstack-start/convex/_generated/api.js +23 -0
  10. package/templates/tanstack-start/convex/_generated/dataModel.d.ts +60 -0
  11. package/templates/tanstack-start/convex/_generated/server.d.ts +143 -0
  12. package/templates/tanstack-start/convex/_generated/server.js +93 -0
  13. package/templates/tanstack-start/convex/auth/adapter/index.ts +222 -0
  14. package/templates/tanstack-start/convex/auth/adapter/utils.ts +597 -0
  15. package/templates/tanstack-start/convex/auth/api.ts +8 -0
  16. package/templates/tanstack-start/convex/auth/config.ts +8 -0
  17. package/templates/tanstack-start/convex/auth/db.ts +299 -0
  18. package/templates/tanstack-start/convex/auth/index.ts +62 -0
  19. package/templates/tanstack-start/convex/auth/plugins/index.ts +7 -0
  20. package/templates/tanstack-start/convex/auth/sessions.ts +60 -0
  21. package/templates/tanstack-start/convex/http.ts +44 -0
  22. package/templates/tanstack-start/convex/schema.ts +69 -0
  23. package/templates/tanstack-start/eslint.config.js +77 -0
  24. package/templates/tanstack-start/package.json +74 -0
  25. package/templates/tanstack-start/prettier.config.js +35 -0
  26. package/templates/tanstack-start/public/favicon.ico +0 -0
  27. package/templates/tanstack-start/public/logo192.png +0 -0
  28. package/templates/tanstack-start/public/logo512.png +0 -0
  29. package/templates/tanstack-start/public/manifest.json +25 -0
  30. package/templates/tanstack-start/public/robots.txt +3 -0
  31. package/templates/tanstack-start/public/tanstack-circle-logo.png +0 -0
  32. package/templates/tanstack-start/public/tanstack-word-logo-white.svg +1 -0
  33. package/templates/tanstack-start/src/components/component-example.tsx +470 -0
  34. package/templates/tanstack-start/src/components/example.tsx +52 -0
  35. package/templates/tanstack-start/src/components/ui/alert-dialog.tsx +160 -0
  36. package/templates/tanstack-start/src/components/ui/badge.tsx +49 -0
  37. package/templates/tanstack-start/src/components/ui/button.tsx +58 -0
  38. package/templates/tanstack-start/src/components/ui/card.tsx +92 -0
  39. package/templates/tanstack-start/src/components/ui/combobox.tsx +271 -0
  40. package/templates/tanstack-start/src/components/ui/dropdown-menu.tsx +244 -0
  41. package/templates/tanstack-start/src/components/ui/field.tsx +222 -0
  42. package/templates/tanstack-start/src/components/ui/input-group.tsx +146 -0
  43. package/templates/tanstack-start/src/components/ui/input.tsx +20 -0
  44. package/templates/tanstack-start/src/components/ui/label.tsx +20 -0
  45. package/templates/tanstack-start/src/components/ui/select.tsx +189 -0
  46. package/templates/tanstack-start/src/components/ui/separator.tsx +19 -0
  47. package/templates/tanstack-start/src/components/ui/textarea.tsx +18 -0
  48. package/templates/tanstack-start/src/db/constants/auth.ts +41 -0
  49. package/templates/tanstack-start/src/db/constants/index.ts +8 -0
  50. package/templates/tanstack-start/src/env.ts +94 -0
  51. package/templates/tanstack-start/src/lib/auth/client.ts +18 -0
  52. package/templates/tanstack-start/src/lib/auth/server.ts +14 -0
  53. package/templates/tanstack-start/src/lib/utils.ts +6 -0
  54. package/templates/tanstack-start/src/logo.svg +12 -0
  55. package/templates/tanstack-start/src/providers.tsx +38 -0
  56. package/templates/tanstack-start/src/routeTree.gen.ts +127 -0
  57. package/templates/tanstack-start/src/router.tsx +41 -0
  58. package/templates/tanstack-start/src/routes/__root.tsx +92 -0
  59. package/templates/tanstack-start/src/routes/account/$accountView.tsx +15 -0
  60. package/templates/tanstack-start/src/routes/api/auth/$.tsx +11 -0
  61. package/templates/tanstack-start/src/routes/auth/$authView.tsx +15 -0
  62. package/templates/tanstack-start/src/routes/index.tsx +9 -0
  63. package/templates/tanstack-start/src/styles.css +156 -0
  64. package/templates/tanstack-start/tsconfig.json +42 -0
  65. package/templates/tanstack-start/vite.config.ts +32 -0
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/index.js ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { Command } from "commander";
5
+ import { select, input } from "@inquirer/prompts";
6
+ import chalk from "chalk";
7
+ import { readFileSync } from "fs";
8
+ import { fileURLToPath } from "url";
9
+ import { dirname, join } from "path";
10
+ var __filename = fileURLToPath(import.meta.url);
11
+ var __dirname = dirname(__filename);
12
+ var packageJson = JSON.parse(
13
+ readFileSync(join(__dirname, "../package.json"), "utf-8")
14
+ );
15
+ var program = new Command();
16
+ program.name("create-z3").version(packageJson.version).description("CLI for scaffolding Z3 Stack applications").argument("[project-name]", "Name of the project").action(async (projectNameArg) => {
17
+ try {
18
+ let projectName = projectNameArg;
19
+ if (!projectName) {
20
+ projectName = await input({
21
+ message: "What is your project named?"
22
+ });
23
+ }
24
+ const framework = await select({
25
+ message: "Which framework would you like to use?",
26
+ choices: [
27
+ { name: "TanStack Start", value: "tanstack" },
28
+ { name: "Next.js", value: "nextjs" }
29
+ ],
30
+ default: "tanstack"
31
+ });
32
+ const frameworkName = framework === "tanstack" ? "TanStack Start" : "Next.js";
33
+ console.log();
34
+ console.log(chalk.green("\u2705 Configuration complete!"));
35
+ console.log();
36
+ console.log(`Project name: ${projectName}`);
37
+ console.log(`Framework: ${frameworkName}`);
38
+ console.log();
39
+ console.log("(No scaffolding yet - this is a test version)");
40
+ console.log();
41
+ process.exit(0);
42
+ } catch (error) {
43
+ if (error instanceof Error && error.name === "ExitPromptError") {
44
+ console.log();
45
+ process.exit(0);
46
+ }
47
+ throw error;
48
+ }
49
+ });
50
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "create-z3",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "description": "CLI for scaffolding Z3 Stack applications (TanStack/Next.js + Convex + Better Auth)",
6
+ "bin": {
7
+ "create-z3": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "templates"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsup src/index.ts --format esm --dts",
15
+ "dev": "tsup src/index.ts --format esm --watch",
16
+ "typecheck": "tsc --noEmit",
17
+ "test": "echo \"No tests yet\""
18
+ },
19
+ "dependencies": {
20
+ "commander": "^12.0.0",
21
+ "@inquirer/prompts": "^7.2.0",
22
+ "fs-extra": "^11.2.0",
23
+ "chalk": "^5.3.0",
24
+ "ora": "^8.1.0",
25
+ "execa": "^9.5.2",
26
+ "sort-package-json": "^2.10.0",
27
+ "validate-npm-package-name": "^5.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "typescript": "^5.7.0",
31
+ "tsup": "^8.0.0",
32
+ "@types/node": "^22.0.0",
33
+ "@types/fs-extra": "^11.0.0",
34
+ "@types/validate-npm-package-name": "^4.0.0"
35
+ },
36
+ "engines": {
37
+ "node": ">=18.0.0"
38
+ },
39
+ "keywords": [
40
+ "cli",
41
+ "create-z3",
42
+ "z3-stack",
43
+ "tanstack",
44
+ "nextjs",
45
+ "convex",
46
+ "better-auth",
47
+ "typescript"
48
+ ],
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "https://github.com/zayecq/create-z3-app"
52
+ },
53
+ "license": "MIT"
54
+ }
@@ -0,0 +1,45 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Environment Variables Template
3
+ # -----------------------------------------------------------------------------
4
+ # Copy this file to .env and fill in the values
5
+ # DO NOT commit .env to version control - it contains secrets!
6
+ # -----------------------------------------------------------------------------
7
+
8
+ # -----------------------------------------------------------------------------
9
+ # App Environment
10
+ # -----------------------------------------------------------------------------
11
+ NODE_ENV=development
12
+
13
+ # -----------------------------------------------------------------------------
14
+ # Convex (Database & Realtime Backend)
15
+ # -----------------------------------------------------------------------------
16
+ # Get these from: https://dashboard.convex.dev
17
+ # CONVEX_URL is for server-side operations
18
+ # VITE_CONVEX_URL is for client-side SDK (must start with VITE_)
19
+ CONVEX_URL=https://your-deployment.convex.cloud
20
+ VITE_CONVEX_URL=https://your-deployment.convex.cloud
21
+ CONVEX_SITE_URL=https://your-deployment.convex.site
22
+ VITE_CONVEX_SITE_URL=https://your-deployment.convex.site
23
+
24
+ # -----------------------------------------------------------------------------
25
+ # Better Auth (Authentication - Phase 0+)
26
+ # -----------------------------------------------------------------------------
27
+ # Generate a random 32+ character secret: openssl rand -base64 32
28
+ BETTER_AUTH_SECRET=your-super-secret-32-character-minimum-string-here
29
+ SITE_URL=http://localhost:3000
30
+ VITE_SITE_URL=http://localhost:3000
31
+
32
+ # -----------------------------------------------------------------------------
33
+ # AWS (Lambda Workers & Storage - Phase 5+)
34
+ # -----------------------------------------------------------------------------
35
+ # Required for: AI generation workers, job queue, file storage
36
+ # Get credentials from: AWS IAM Console
37
+ AWS_REGION=us-west-1
38
+ AWS_ACCESS_KEY_ID=your-aws-access-key-id
39
+ AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
40
+
41
+ # -----------------------------------------------------------------------------
42
+ # Development Tools
43
+ # -----------------------------------------------------------------------------
44
+ # Set to "1" to skip env validation during build (useful for CI/CD)
45
+ # SKIP_ENV_VALIDATION=1
@@ -0,0 +1,18 @@
1
+ # Build outputs
2
+ dist
3
+ .output
4
+ .nitro
5
+ .tanstack
6
+
7
+ # Auto-generated files
8
+ **/routeTree.gen.ts
9
+ **/*.gen.ts
10
+
11
+ # Dependencies
12
+ node_modules
13
+
14
+ # Cache
15
+ .eslintcache
16
+
17
+ # Lock files
18
+ pnpm-lock.yaml
@@ -0,0 +1,221 @@
1
+ # TanStack Start + Better Auth + Convex + shadcn/ui Template
2
+
3
+ A modern, production-ready SaaS template built with:
4
+
5
+ - **[TanStack Start](https://tanstack.com/start)** - Full-stack React framework with type-safe routing
6
+ - **[Better Auth](https://www.better-auth.com/)** - Modern authentication with email/password and OAuth providers
7
+ - **[Convex](https://convex.dev/)** - Real-time database and backend
8
+ - **[shadcn/ui](https://ui.shadcn.com/)** - Beautifully designed components built on Radix UI
9
+ - **[Base UI](https://base-ui.com/)** - Unstyled, accessible component primitives
10
+ - **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework
11
+
12
+ ## Getting Started
13
+
14
+ ### 1. Prerequisites
15
+
16
+ - Node.js 18+ and pnpm installed
17
+ - A Convex account (free at [convex.dev](https://convex.dev))
18
+
19
+ ### 2. Clone and Install
20
+
21
+ ```bash
22
+ # Clone this template
23
+ git clone <your-repo-url>
24
+ cd <your-project-name>
25
+
26
+ # Install dependencies
27
+ pnpm install
28
+ ```
29
+
30
+ ### 3. Environment Setup
31
+
32
+ Copy the example environment file:
33
+
34
+ ```bash
35
+ cp .env.example .env
36
+ ```
37
+
38
+ ### 4. Generate Better Auth Secret
39
+
40
+ Generate a secure secret for Better Auth:
41
+
42
+ ```bash
43
+ pnpm secret:create
44
+ ```
45
+
46
+ This will generate a random 32-character hex string and copy it to your clipboard.
47
+
48
+ ### 5. Configure Convex
49
+
50
+ #### Set up Convex project
51
+
52
+ ```bash
53
+ npx convex dev
54
+ ```
55
+
56
+ This will:
57
+ - Create a new Convex project (or link to an existing one)
58
+ - Generate your `CONVEX_URL` and `VITE_CONVEX_URL`
59
+ - Start the Convex development server
60
+
61
+ #### Add environment variables to Convex
62
+
63
+ You need to add two critical environment variables to your Convex deployment via the [Convex Dashboard](https://dashboard.convex.dev):
64
+
65
+ 1. **BETTER_AUTH_SECRET**: Paste the secret you generated in step 4
66
+ 2. **SITE_URL**: Set to your application URL
67
+ - Development: `http://localhost:3000` (or whatever port your dev server uses)
68
+ - Production: Your production domain (e.g., `https://yourdomain.com`)
69
+
70
+ To add these in the Convex Dashboard:
71
+ 1. Go to your project at [dashboard.convex.dev](https://dashboard.convex.dev)
72
+ 2. Navigate to "Settings" → "Environment Variables"
73
+ 3. Add both `BETTER_AUTH_SECRET` and `SITE_URL`
74
+
75
+ ### 6. Update Your .env File
76
+
77
+ Update your `.env` file with the values from Convex setup:
78
+
79
+ ```env
80
+ NODE_ENV=development
81
+
82
+ # From Convex setup
83
+ CONVEX_URL=https://your-deployment.convex.cloud
84
+ VITE_CONVEX_URL=https://your-deployment.convex.cloud
85
+ CONVEX_SITE_URL=https://your-deployment.convex.site
86
+ VITE_CONVEX_SITE_URL=https://your-deployment.convex.site
87
+
88
+ # Better Auth (same secret you added to Convex Dashboard)
89
+ BETTER_AUTH_SECRET=your-generated-secret-here
90
+ SITE_URL=http://localhost:3000
91
+ VITE_SITE_URL=http://localhost:3000
92
+ ```
93
+
94
+ ### 7. Start Development
95
+
96
+ ```bash
97
+ # Terminal 1: Run Convex dev server
98
+ npx convex dev
99
+
100
+ # Terminal 2: Run the application
101
+ pnpm dev
102
+ ```
103
+
104
+ Visit `http://localhost:3000` to see your application running.
105
+
106
+ ## Customizing Authentication
107
+
108
+ ### Adding OAuth Providers
109
+
110
+ The template includes Google OAuth as an example. To add or modify providers:
111
+
112
+ 1. **Update Better Auth configuration** in `convex/auth/index.ts`:
113
+
114
+ ```typescript
115
+ export const createAuth = (ctx: GenericActionCtx<DataModel>) => {
116
+ return betterAuth({
117
+ socialProviders: {
118
+ google: {
119
+ clientId: process.env.GOOGLE_CLIENT_ID!,
120
+ clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
121
+ redirectURI: `${process.env.SITE_URL}/api/auth/callback/google`
122
+ },
123
+ // Add more providers
124
+ github: {
125
+ clientId: process.env.GITHUB_CLIENT_ID!,
126
+ clientSecret: process.env.GITHUB_CLIENT_SECRET!,
127
+ }
128
+ },
129
+ // ... rest of config
130
+ })
131
+ }
132
+ ```
133
+
134
+ 2. **Add credentials to Convex Dashboard** as environment variables
135
+
136
+ 3. **Consult the Better Auth documentation** for provider-specific configuration:
137
+ - [Better Auth Providers](https://www.better-auth.com/docs/authentication/social-login)
138
+
139
+ ### Customizing User Schema
140
+
141
+ To add custom fields to your user model:
142
+
143
+ 1. Update the `user.additionalFields` in `convex/auth/index.ts`
144
+ 2. Update your Convex schema accordingly
145
+ 3. See [Better Auth User Management](https://www.better-auth.com/docs/concepts/user-management) for details
146
+
147
+ ### Email/Password Configuration
148
+
149
+ The template has email/password authentication enabled by default. To customize:
150
+
151
+ - [Better Auth Email/Password Docs](https://www.better-auth.com/docs/authentication/email-password)
152
+ - [Email Verification Setup](https://www.better-auth.com/docs/authentication/email-verification)
153
+
154
+ ## Project Structure
155
+
156
+ ```
157
+ .
158
+ ├── app/ # TanStack Start application code
159
+ │ ├── routes/ # File-based routing
160
+ │ ├── components/ # React components
161
+ │ └── lib/ # Utilities and helpers
162
+ ├── convex/ # Convex backend
163
+ │ ├── auth/ # Better Auth integration
164
+ │ ├── schema.ts # Database schema
165
+ │ └── *.ts # Convex functions (queries, mutations, actions)
166
+ ├── public/ # Static assets
167
+ └── .env # Environment variables (not committed)
168
+ ```
169
+
170
+ ## Development Scripts
171
+
172
+ ```bash
173
+ pnpm dev # Start development server
174
+ pnpm build # Build for production
175
+ pnpm preview # Preview production build
176
+ pnpm test # Run tests
177
+ pnpm typecheck # Type check without emitting
178
+ pnpm lint # Lint code
179
+ pnpm lint:fix # Fix linting issues
180
+ pnpm format # Format code with Prettier
181
+ pnpm format:check # Check code formatting
182
+ pnpm validate # Run typecheck, lint, and format check
183
+ pnpm secret:create # Generate a Better Auth secret
184
+ ```
185
+
186
+ ## Documentation Resources
187
+
188
+ ### Core Technologies
189
+ - **TanStack Start**: [tanstack.com/start](https://tanstack.com/start)
190
+ - **TanStack Router**: [tanstack.com/router](https://tanstack.com/router)
191
+ - **Better Auth**: [better-auth.com/docs](https://www.better-auth.com/docs)
192
+ - **Convex**: [docs.convex.dev](https://docs.convex.dev)
193
+ - **shadcn/ui**: [ui.shadcn.com](https://ui.shadcn.com)
194
+ - **Base UI**: [base-ui.com](https://base-ui.com)
195
+
196
+ ### Integration Guides
197
+ - **Better Auth + Convex**: [better-auth.com/docs/integrations/convex](https://www.better-auth.com/docs/integrations/convex)
198
+ - **Better Auth + TanStack Start**: [better-auth.com/docs/integrations/tanstack-start](https://www.better-auth.com/docs/integrations/tanstack-start)
199
+
200
+ ## Deployment
201
+
202
+ ### Deploy to Production
203
+
204
+ 1. **Deploy Convex Backend**:
205
+ ```bash
206
+ npx convex deploy
207
+ ```
208
+
209
+ 2. **Update Convex environment variables** in production:
210
+ - Set `SITE_URL` to your production domain
211
+ - Keep `BETTER_AUTH_SECRET` the same (or rotate it)
212
+
213
+ 3. **Deploy your application** to your hosting provider (Vercel, Netlify, etc.)
214
+
215
+ 4. **Update environment variables** in your hosting provider with production values
216
+
217
+ See [Convex Production Deployment](https://docs.convex.dev/production/hosting) for detailed deployment instructions.
218
+
219
+ ## License
220
+
221
+ MIT
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "base-vega",
4
+ "rsc": false,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "src/styles.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "iconLibrary": "lucide",
14
+ "aliases": {
15
+ "components": "~/components",
16
+ "utils": "~/lib/utils",
17
+ "ui": "~/components/ui",
18
+ "lib": "~/lib",
19
+ "hooks": "~/hooks"
20
+ },
21
+ "menuColor": "default",
22
+ "menuAccent": "subtle",
23
+ "registries": {}
24
+ }
@@ -0,0 +1,65 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type * as auth_adapter_index from "../auth/adapter/index.js";
12
+ import type * as auth_adapter_utils from "../auth/adapter/utils.js";
13
+ import type * as auth_api from "../auth/api.js";
14
+ import type * as auth_config from "../auth/config.js";
15
+ import type * as auth_db from "../auth/db.js";
16
+ import type * as auth_index from "../auth/index.js";
17
+ import type * as auth_plugins_index from "../auth/plugins/index.js";
18
+ import type * as auth_sessions from "../auth/sessions.js";
19
+ import type * as http from "../http.js";
20
+
21
+ import type {
22
+ ApiFromModules,
23
+ FilterApi,
24
+ FunctionReference,
25
+ } from "convex/server";
26
+
27
+ declare const fullApi: ApiFromModules<{
28
+ "auth/adapter/index": typeof auth_adapter_index;
29
+ "auth/adapter/utils": typeof auth_adapter_utils;
30
+ "auth/api": typeof auth_api;
31
+ "auth/config": typeof auth_config;
32
+ "auth/db": typeof auth_db;
33
+ "auth/index": typeof auth_index;
34
+ "auth/plugins/index": typeof auth_plugins_index;
35
+ "auth/sessions": typeof auth_sessions;
36
+ http: typeof http;
37
+ }>;
38
+
39
+ /**
40
+ * A utility for referencing Convex functions in your app's public API.
41
+ *
42
+ * Usage:
43
+ * ```js
44
+ * const myFunctionReference = api.myModule.myFunction;
45
+ * ```
46
+ */
47
+ export declare const api: FilterApi<
48
+ typeof fullApi,
49
+ FunctionReference<any, "public">
50
+ >;
51
+
52
+ /**
53
+ * A utility for referencing Convex functions in your app's internal API.
54
+ *
55
+ * Usage:
56
+ * ```js
57
+ * const myFunctionReference = internal.myModule.myFunction;
58
+ * ```
59
+ */
60
+ export declare const internal: FilterApi<
61
+ typeof fullApi,
62
+ FunctionReference<any, "internal">
63
+ >;
64
+
65
+ export declare const components: {};
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import { anyApi, componentsGeneric } from "convex/server";
12
+
13
+ /**
14
+ * A utility for referencing Convex functions in your app's API.
15
+ *
16
+ * Usage:
17
+ * ```js
18
+ * const myFunctionReference = api.myModule.myFunction;
19
+ * ```
20
+ */
21
+ export const api = anyApi;
22
+ export const internal = anyApi;
23
+ export const components = componentsGeneric();
@@ -0,0 +1,60 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated data model types.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type {
12
+ DataModelFromSchemaDefinition,
13
+ DocumentByName,
14
+ TableNamesInDataModel,
15
+ SystemTableNames,
16
+ } from "convex/server";
17
+ import type { GenericId } from "convex/values";
18
+ import schema from "../schema.js";
19
+
20
+ /**
21
+ * The names of all of your Convex tables.
22
+ */
23
+ export type TableNames = TableNamesInDataModel<DataModel>;
24
+
25
+ /**
26
+ * The type of a document stored in Convex.
27
+ *
28
+ * @typeParam TableName - A string literal type of the table name (like "users").
29
+ */
30
+ export type Doc<TableName extends TableNames> = DocumentByName<
31
+ DataModel,
32
+ TableName
33
+ >;
34
+
35
+ /**
36
+ * An identifier for a document in Convex.
37
+ *
38
+ * Convex documents are uniquely identified by their `Id`, which is accessible
39
+ * on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
40
+ *
41
+ * Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
42
+ *
43
+ * IDs are just strings at runtime, but this type can be used to distinguish them from other
44
+ * strings when type checking.
45
+ *
46
+ * @typeParam TableName - A string literal type of the table name (like "users").
47
+ */
48
+ export type Id<TableName extends TableNames | SystemTableNames> =
49
+ GenericId<TableName>;
50
+
51
+ /**
52
+ * A type describing your Convex data model.
53
+ *
54
+ * This type includes information about what tables you have, the type of
55
+ * documents stored in those tables, and the indexes defined on them.
56
+ *
57
+ * This type is used to parameterize methods like `queryGeneric` and
58
+ * `mutationGeneric` to make them type-safe.
59
+ */
60
+ export type DataModel = DataModelFromSchemaDefinition<typeof schema>;