create-zhx-monorepo 0.1.8 → 0.2.0
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/bin/index.js +0 -11
- package/package.json +1 -1
- package/templates/monorepo-starter/README.md +28 -0
- package/templates/monorepo-starter/server/.env.example +1 -0
- package/templates/monorepo-starter/server/prisma/generated/browser.ts +0 -54
- package/templates/monorepo-starter/server/prisma/generated/client.ts +0 -76
- package/templates/monorepo-starter/server/prisma/generated/commonInputTypes.ts +0 -577
- package/templates/monorepo-starter/server/prisma/generated/enums.ts +0 -68
- package/templates/monorepo-starter/server/prisma/generated/internal/class.ts +0 -250
- package/templates/monorepo-starter/server/prisma/generated/internal/prismaNamespace.ts +0 -1436
- package/templates/monorepo-starter/server/prisma/generated/internal/prismaNamespaceBrowser.ts +0 -227
- package/templates/monorepo-starter/server/prisma/generated/models/BackupCode.ts +0 -1375
- package/templates/monorepo-starter/server/prisma/generated/models/Notification.ts +0 -1587
- package/templates/monorepo-starter/server/prisma/generated/models/Otp.ts +0 -1488
- package/templates/monorepo-starter/server/prisma/generated/models/RefreshToken.ts +0 -1515
- package/templates/monorepo-starter/server/prisma/generated/models/RoleAssignment.ts +0 -1385
- package/templates/monorepo-starter/server/prisma/generated/models/SecuritySetting.ts +0 -1422
- package/templates/monorepo-starter/server/prisma/generated/models/User.ts +0 -2498
- package/templates/monorepo-starter/server/prisma/generated/models.ts +0 -18
- package/templates/monorepo-starter/server/prisma/migrations/20251218164821_init/migration.sql +0 -210
- package/templates/monorepo-starter/server/prisma/migrations/migration_lock.toml +0 -3
package/bin/index.js
CHANGED
|
@@ -107,17 +107,6 @@ const main = async () => {
|
|
|
107
107
|
execSync(`git remote add origin ${gitRemote}`, { stdio: "ignore" });
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// installing deps
|
|
111
|
-
console.log(cyan("📦 Installing server dependencies..."));
|
|
112
|
-
process.chdir(projectPath);
|
|
113
|
-
execSync("pnpm install", { stdio: "inherit" });
|
|
114
|
-
|
|
115
|
-
// Run Prisma commands
|
|
116
|
-
console.log(cyan("🧬 Running Prisma setup..."));
|
|
117
|
-
process.chdir(serverDir);
|
|
118
|
-
execSync("pnpm prisma:migrate:dev", { stdio: "inherit" });
|
|
119
|
-
execSync("pnpm prisma:generate", { stdio: "inherit" });
|
|
120
|
-
|
|
121
110
|
console.log(green("✅ Project ready!"));
|
|
122
111
|
console.log();
|
|
123
112
|
console.log("Next steps:");
|
package/package.json
CHANGED
|
@@ -25,6 +25,33 @@ pnpm install
|
|
|
25
25
|
pnpm dev # Start all apps
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
````
|
|
29
|
+
|
|
30
|
+
## Database Setup
|
|
31
|
+
|
|
32
|
+
1. Edit the `.env` file in the `server` directory:
|
|
33
|
+
|
|
34
|
+
```env
|
|
35
|
+
DB_URI="postgresql://username:password@localhost:5432/your-db-name"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Replace `username`, `password`, and `your-db-name` with your PostgreSQL credentials and the desired database name.
|
|
39
|
+
|
|
40
|
+
2. Navigate to the server folder:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cd server
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. Run Prisma commands to set up the database and generate the client:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm prisma:migrate:dev
|
|
50
|
+
pnpm prisma:generate
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> Note: Make sure your PostgreSQL server is running and accessible with the credentials you set.
|
|
54
|
+
|
|
28
55
|
## Usage
|
|
29
56
|
|
|
30
57
|
Import UI components in your app:
|
|
@@ -40,3 +67,4 @@ Feel free to modify, extend, and organize the template to fit your workflow.
|
|
|
40
67
|
---
|
|
41
68
|
|
|
42
69
|
Made with ❤️ using shadcn/ui & Monorepo
|
|
70
|
+
````
|
|
@@ -12,6 +12,7 @@ ADMIN_ENDPOINT="http://localhost:3001"
|
|
|
12
12
|
# ==============================
|
|
13
13
|
# Database
|
|
14
14
|
# ==============================
|
|
15
|
+
# example "postgresql://DB_USER:DB_PASSWORD@DB_HOST:DB_PORT/DB_NAME"
|
|
15
16
|
DB_URI="postgresql://postgres:47425@localhost:5432/your-proj"
|
|
16
17
|
|
|
17
18
|
# ==============================
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
// biome-ignore-all lint: generated file
|
|
5
|
-
// @ts-nocheck
|
|
6
|
-
/*
|
|
7
|
-
* This file should be your main import to use Prisma-related types and utilities in a browser.
|
|
8
|
-
* Use it to get access to models, enums, and input types.
|
|
9
|
-
*
|
|
10
|
-
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
|
|
11
|
-
* See `client.ts` for the standard, server-side entry point.
|
|
12
|
-
*
|
|
13
|
-
* 🟢 You can import this file directly.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import * as Prisma from './internal/prismaNamespaceBrowser'
|
|
17
|
-
export { Prisma }
|
|
18
|
-
export * as $Enums from './enums'
|
|
19
|
-
export * from './enums';
|
|
20
|
-
/**
|
|
21
|
-
* Model User
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export type User = Prisma.UserModel
|
|
25
|
-
/**
|
|
26
|
-
* Model RoleAssignment
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
export type RoleAssignment = Prisma.RoleAssignmentModel
|
|
30
|
-
/**
|
|
31
|
-
* Model SecuritySetting
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export type SecuritySetting = Prisma.SecuritySettingModel
|
|
35
|
-
/**
|
|
36
|
-
* Model BackupCode
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
export type BackupCode = Prisma.BackupCodeModel
|
|
40
|
-
/**
|
|
41
|
-
* Model RefreshToken
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
export type RefreshToken = Prisma.RefreshTokenModel
|
|
45
|
-
/**
|
|
46
|
-
* Model Otp
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
export type Otp = Prisma.OtpModel
|
|
50
|
-
/**
|
|
51
|
-
* Model Notification
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
export type Notification = Prisma.NotificationModel
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
// biome-ignore-all lint: generated file
|
|
5
|
-
// @ts-nocheck
|
|
6
|
-
/*
|
|
7
|
-
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
|
8
|
-
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
|
|
9
|
-
*
|
|
10
|
-
* 🟢 You can import this file directly.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import * as process from 'node:process'
|
|
14
|
-
import * as path from 'node:path'
|
|
15
|
-
import { fileURLToPath } from 'node:url'
|
|
16
|
-
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
|
|
17
|
-
|
|
18
|
-
import * as runtime from "@prisma/client/runtime/client"
|
|
19
|
-
import * as $Enums from "./enums"
|
|
20
|
-
import * as $Class from "./internal/class"
|
|
21
|
-
import * as Prisma from "./internal/prismaNamespace"
|
|
22
|
-
|
|
23
|
-
export * as $Enums from './enums'
|
|
24
|
-
export * from "./enums"
|
|
25
|
-
/**
|
|
26
|
-
* ## Prisma Client
|
|
27
|
-
*
|
|
28
|
-
* Type-safe database client for TypeScript
|
|
29
|
-
* @example
|
|
30
|
-
* ```
|
|
31
|
-
* const prisma = new PrismaClient()
|
|
32
|
-
* // Fetch zero or more Users
|
|
33
|
-
* const users = await prisma.user.findMany()
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* Read more in our [docs](https://pris.ly/d/client).
|
|
37
|
-
*/
|
|
38
|
-
export const PrismaClient = $Class.getPrismaClientClass()
|
|
39
|
-
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
40
|
-
export { Prisma }
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Model User
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
export type User = Prisma.UserModel
|
|
47
|
-
/**
|
|
48
|
-
* Model RoleAssignment
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
export type RoleAssignment = Prisma.RoleAssignmentModel
|
|
52
|
-
/**
|
|
53
|
-
* Model SecuritySetting
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
export type SecuritySetting = Prisma.SecuritySettingModel
|
|
57
|
-
/**
|
|
58
|
-
* Model BackupCode
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
export type BackupCode = Prisma.BackupCodeModel
|
|
62
|
-
/**
|
|
63
|
-
* Model RefreshToken
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
export type RefreshToken = Prisma.RefreshTokenModel
|
|
67
|
-
/**
|
|
68
|
-
* Model Otp
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
export type Otp = Prisma.OtpModel
|
|
72
|
-
/**
|
|
73
|
-
* Model Notification
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
export type Notification = Prisma.NotificationModel
|