create-vitnode-app 1.2.0-canary.4 → 1.2.0-canary.41
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/LICENSE.md +1 -1
- package/README.md +14 -5
- package/copy-of-vitnode-app/.vscode/settings.json +6 -0
- package/copy-of-vitnode-app/api/.gitignore_template +29 -0
- package/copy-of-vitnode-app/api/drizzle.config.ts +12 -0
- package/copy-of-vitnode-app/api/package.json +43 -0
- package/copy-of-vitnode-app/api/src/index.ts +27 -0
- package/copy-of-vitnode-app/api/src/vitnode.api.config.ts +23 -0
- package/copy-of-vitnode-app/api/tsconfig.json +16 -0
- package/copy-of-vitnode-app/api-bun/src/index.ts +13 -0
- package/copy-of-vitnode-app/api-single-app/.gitignore_template +37 -0
- package/copy-of-vitnode-app/{root → api-single-app}/src/app/api/[...route]/route.ts +0 -2
- package/copy-of-vitnode-app/api-single-app/src/vitnode.api.config.ts +18 -0
- package/copy-of-vitnode-app/docker/docker-compose.yml +20 -0
- package/copy-of-vitnode-app/eslint/.prettierrc.mjs +1 -1
- package/copy-of-vitnode-app/eslint/eslint.config.mjs +1 -1
- package/copy-of-vitnode-app/monorepo/.gitignore_template +41 -0
- package/copy-of-vitnode-app/monorepo/turbo.json +47 -0
- package/copy-of-vitnode-app/root/.env.example +9 -0
- package/copy-of-vitnode-app/root/.gitignore_template +37 -0
- package/copy-of-vitnode-app/root/README.md +48 -0
- package/copy-of-vitnode-app/root/global.d.ts +9 -0
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/layout.tsx +6 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/page.tsx +9 -17
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/(auth)/layout.tsx +8 -5
- package/copy-of-vitnode-app/root/src/app/[locale]/layout.tsx +11 -7
- package/copy-of-vitnode-app/root/src/app/global.css +127 -0
- package/copy-of-vitnode-app/root/src/middleware.ts +24 -0
- package/copy-of-vitnode-app/root/src/vitnode.config.ts +32 -0
- package/copy-of-vitnode-app/root/tsconfig.json +1 -1
- package/dist/src/create/create-package-json.js +255 -0
- package/dist/src/create/create-vitnode.js +119 -3
- package/dist/src/helpers/init-vitnode.js +15 -0
- package/dist/src/helpers/install-dependencies.js +67 -0
- package/dist/src/helpers/is-online.js +38 -0
- package/dist/src/helpers/is-writeable.js +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/prepare/prepare.js +1 -1
- package/dist/src/questions.js +38 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/copy-of-vitnode-app/root/.prettierrc.mjs +0 -11
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/not-found.tsx +0 -5
- package/copy-of-vitnode-app/root/src/app/globals.css +0 -119
- package/copy-of-vitnode-app/root/src/app/not-found.tsx +0 -13
- package/copy-of-vitnode-app/root/src/vitnode.api.config.ts +0 -5
- /package/copy-of-vitnode-app/{root → api-single-app}/drizzle.config.ts +0 -0
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -29,10 +29,19 @@ or
|
|
|
29
29
|
pnpm create vitnode-app@latest
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
or
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bun create vitnode-app@latest
|
|
36
|
+
```
|
|
37
|
+
|
|
32
38
|
## Options
|
|
33
39
|
|
|
34
|
-
| Option | Description
|
|
35
|
-
| ------------------- |
|
|
36
|
-
| `--package-manager` | Specify the package manager to use. Support `npm`, `pnpm`.
|
|
37
|
-
| `--eslint` | Initialize with eslint config.
|
|
38
|
-
| `--skip-install` | Skip installing packages after initializing the project.
|
|
40
|
+
| Option | Description |
|
|
41
|
+
| ------------------- | --------------------------------------------------------------------------------- |
|
|
42
|
+
| `--package-manager` | Specify the package manager to use. Support `npm`, `pnpm`. |
|
|
43
|
+
| `--eslint` | Initialize with eslint config. |
|
|
44
|
+
| `--skip-install` | Skip installing packages after initializing the project. |
|
|
45
|
+
| `--mode` | Specify the type of app to create. Support `singleApp`, `apiMonorepo`, `onlyApi`. |
|
|
46
|
+
| `--monorepo` | Create project with monorepo structure. |
|
|
47
|
+
| `--docker` | Initialize with Docker support. |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
|
|
4
|
+
# Turbo
|
|
5
|
+
.turbo
|
|
6
|
+
|
|
7
|
+
# Test & Build
|
|
8
|
+
/coverage
|
|
9
|
+
/desc
|
|
10
|
+
*.tsbuildinfo
|
|
11
|
+
|
|
12
|
+
# Misc
|
|
13
|
+
.DS_Store
|
|
14
|
+
*.pem
|
|
15
|
+
/.pnp
|
|
16
|
+
.pnp.js
|
|
17
|
+
npm-debug.log*
|
|
18
|
+
yarn-debug.log*
|
|
19
|
+
yarn-error.log*
|
|
20
|
+
|
|
21
|
+
# Local env files
|
|
22
|
+
.env
|
|
23
|
+
.env.local
|
|
24
|
+
.env.development.local
|
|
25
|
+
.env.test.local
|
|
26
|
+
.env.production.local
|
|
27
|
+
|
|
28
|
+
# Others
|
|
29
|
+
.vercel
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineVitNodeDrizzleConfig } from '@vitnode/core/drizzle.config';
|
|
2
|
+
|
|
3
|
+
import { POSTGRES_URL, vitNodeApiConfig } from './src/vitnode.api.config';
|
|
4
|
+
|
|
5
|
+
export default defineVitNodeDrizzleConfig({
|
|
6
|
+
vitNodeApiConfig,
|
|
7
|
+
out: './migrations/',
|
|
8
|
+
dialect: 'postgresql',
|
|
9
|
+
dbCredentials: {
|
|
10
|
+
url: POSTGRES_URL,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "api",
|
|
3
|
+
"version": "1.2.0-canary.40",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"db:push": "vitnode push",
|
|
8
|
+
"db:migrate": "vitnode migrate",
|
|
9
|
+
"init": "vitnode init --api",
|
|
10
|
+
"dev": "vitnode init --api && tsx watch src/index.ts",
|
|
11
|
+
"build": "tsc && tsc-alias -p tsconfig.json",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"lint:fix": "eslint . --fix",
|
|
15
|
+
"drizzle-kit": "drizzle-kit"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@hono/zod-openapi": "^0.19.9",
|
|
19
|
+
"@hono/zod-validator": "^0.7.0",
|
|
20
|
+
"@react-email/components": "^0.2.0",
|
|
21
|
+
"@vitnode/core": "workspace:*",
|
|
22
|
+
"drizzle-kit": "^0.31.4",
|
|
23
|
+
"drizzle-orm": "^0.44.2",
|
|
24
|
+
"hono": "^4.8.4",
|
|
25
|
+
"next-intl": "^4.3.4",
|
|
26
|
+
"react": "^19.1.0",
|
|
27
|
+
"react-dom": "^19.1.0",
|
|
28
|
+
"zod": "^3.25.76"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@hono/node-server": "^1.15.0",
|
|
32
|
+
"@types/node": "^24.0.12",
|
|
33
|
+
"@types/react": "^19.1.8",
|
|
34
|
+
"@types/react-dom": "^19.1.6",
|
|
35
|
+
"@vitnode/eslint-config": "workspace:*",
|
|
36
|
+
"dotenv": "^17.2.0",
|
|
37
|
+
"eslint": "^9.30.1",
|
|
38
|
+
"react-email": "^4.1.1",
|
|
39
|
+
"tsc-alias": "^1.8.16",
|
|
40
|
+
"tsx": "^4.20.3",
|
|
41
|
+
"typescript": "^5.8.3"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { serve } from '@hono/node-server';
|
|
2
|
+
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
3
|
+
import { VitNodeAPI } from '@vitnode/core/api/config';
|
|
4
|
+
|
|
5
|
+
import { vitNodeApiConfig } from './vitnode.api.config.js';
|
|
6
|
+
|
|
7
|
+
const app = new OpenAPIHono().basePath('/api');
|
|
8
|
+
|
|
9
|
+
VitNodeAPI({
|
|
10
|
+
app,
|
|
11
|
+
vitNodeApiConfig,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
serve(
|
|
15
|
+
{
|
|
16
|
+
fetch: app.fetch,
|
|
17
|
+
port: 8080,
|
|
18
|
+
},
|
|
19
|
+
info => {
|
|
20
|
+
const initMessage = '\x1b[34m[VitNode]\x1b[0m';
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line no-console
|
|
23
|
+
console.log(
|
|
24
|
+
`${initMessage} API server is running on http://localhost:${info.port}`,
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { buildApiConfig } from '@vitnode/core/vitnode.config';
|
|
2
|
+
import * as dotenv from 'dotenv';
|
|
3
|
+
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
4
|
+
|
|
5
|
+
dotenv.config({
|
|
6
|
+
quiet: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const POSTGRES_URL =
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
11
|
+
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
|
|
12
|
+
|
|
13
|
+
export const vitNodeApiConfig = buildApiConfig({
|
|
14
|
+
plugins: [],
|
|
15
|
+
dbProvider: drizzle({
|
|
16
|
+
connection: POSTGRES_URL,
|
|
17
|
+
casing: 'camelCase',
|
|
18
|
+
}),
|
|
19
|
+
metadata: {
|
|
20
|
+
title: 'VitNode API',
|
|
21
|
+
shortTitle: 'VitNode',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "@vitnode/eslint-config/tsconfig",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "NodeNext",
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"types": ["node"],
|
|
10
|
+
"paths": {
|
|
11
|
+
"@/*": ["./src/*"]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"include": ["src"],
|
|
15
|
+
"exclude": ["node_modules"]
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
2
|
+
import { VitNodeAPI } from '@vitnode/core/api/config';
|
|
3
|
+
|
|
4
|
+
import { vitNodeApiConfig } from './vitnode.api.config.js';
|
|
5
|
+
|
|
6
|
+
const app = new OpenAPIHono().basePath('/api');
|
|
7
|
+
|
|
8
|
+
VitNodeAPI({
|
|
9
|
+
app,
|
|
10
|
+
vitNodeApiConfig,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default app;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
|
|
4
|
+
# Turbo
|
|
5
|
+
.turbo
|
|
6
|
+
|
|
7
|
+
# Generated content
|
|
8
|
+
.contentlayer
|
|
9
|
+
.content-collections
|
|
10
|
+
.source
|
|
11
|
+
|
|
12
|
+
# Test & Build
|
|
13
|
+
/coverage
|
|
14
|
+
/.next/
|
|
15
|
+
/out/
|
|
16
|
+
/build
|
|
17
|
+
*.tsbuildinfo
|
|
18
|
+
|
|
19
|
+
# Misc
|
|
20
|
+
.DS_Store
|
|
21
|
+
*.pem
|
|
22
|
+
/.pnp
|
|
23
|
+
.pnp.js
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
yarn-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
|
|
28
|
+
# Local env files
|
|
29
|
+
.env
|
|
30
|
+
.env.local
|
|
31
|
+
.env.development.local
|
|
32
|
+
.env.test.local
|
|
33
|
+
.env.production.local
|
|
34
|
+
|
|
35
|
+
# Others
|
|
36
|
+
.vercel
|
|
37
|
+
next-env.d.ts
|
|
@@ -3,13 +3,11 @@ import { VitNodeAPI } from '@vitnode/core/api/config';
|
|
|
3
3
|
import { handle } from 'hono/vercel';
|
|
4
4
|
|
|
5
5
|
import { vitNodeApiConfig } from '@/vitnode.api.config';
|
|
6
|
-
import { vitNodeConfig } from '@/vitnode.config';
|
|
7
6
|
|
|
8
7
|
const app = new OpenAPIHono().basePath('/api');
|
|
9
8
|
VitNodeAPI({
|
|
10
9
|
app,
|
|
11
10
|
vitNodeApiConfig,
|
|
12
|
-
vitNodeConfig,
|
|
13
11
|
});
|
|
14
12
|
|
|
15
13
|
export const GET = handle(app);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { buildApiConfig } from '@vitnode/core/vitnode.config';
|
|
2
|
+
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
3
|
+
|
|
4
|
+
export const POSTGRES_URL =
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
6
|
+
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
|
|
7
|
+
|
|
8
|
+
export const vitNodeApiConfig = buildApiConfig({
|
|
9
|
+
metadata: {
|
|
10
|
+
title: 'VitNode',
|
|
11
|
+
shortTitle: 'VitNode',
|
|
12
|
+
},
|
|
13
|
+
plugins: [],
|
|
14
|
+
dbProvider: drizzle({
|
|
15
|
+
connection: POSTGRES_URL,
|
|
16
|
+
casing: 'camelCase',
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
database:
|
|
5
|
+
container_name: vitnode_postgres_dev
|
|
6
|
+
image: postgres:17.5-alpine
|
|
7
|
+
restart: unless-stopped
|
|
8
|
+
environment:
|
|
9
|
+
POSTGRES_USER: ${POSTGRES_USER-root}
|
|
10
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD-root}
|
|
11
|
+
POSTGRES_DB: ${POSTGRES_NAME-vitnode}
|
|
12
|
+
volumes:
|
|
13
|
+
- ./docker/dev:/var/lib/postgresql/data
|
|
14
|
+
ports:
|
|
15
|
+
- '5432:5432'
|
|
16
|
+
networks:
|
|
17
|
+
- vitnode_dev
|
|
18
|
+
|
|
19
|
+
networks:
|
|
20
|
+
vitnode_dev:
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Dependencies
|
|
4
|
+
node_modules
|
|
5
|
+
.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Local env files
|
|
9
|
+
.env
|
|
10
|
+
.env.local
|
|
11
|
+
.env.development.local
|
|
12
|
+
.env.test.local
|
|
13
|
+
.env.production.local
|
|
14
|
+
|
|
15
|
+
# Testing
|
|
16
|
+
coverage
|
|
17
|
+
|
|
18
|
+
# Turbo
|
|
19
|
+
.turbo
|
|
20
|
+
|
|
21
|
+
# Vercel
|
|
22
|
+
.vercel
|
|
23
|
+
|
|
24
|
+
# Build Outputs
|
|
25
|
+
.next/
|
|
26
|
+
out/
|
|
27
|
+
build
|
|
28
|
+
dist
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Debug
|
|
32
|
+
npm-debug.log*
|
|
33
|
+
yarn-debug.log*
|
|
34
|
+
yarn-error.log*
|
|
35
|
+
|
|
36
|
+
# Misc
|
|
37
|
+
.DS_Store
|
|
38
|
+
*.pem
|
|
39
|
+
|
|
40
|
+
# VitNode
|
|
41
|
+
/docker
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"ui": "tui",
|
|
4
|
+
"tasks": {
|
|
5
|
+
"db:migrate": {
|
|
6
|
+
"dependsOn": ["^db:migrate"],
|
|
7
|
+
"persistent": true,
|
|
8
|
+
"cache": false,
|
|
9
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
10
|
+
"env": ["POSTGRES_URL"]
|
|
11
|
+
},
|
|
12
|
+
"db:push": {
|
|
13
|
+
"dependsOn": ["^db:push"],
|
|
14
|
+
"cache": false,
|
|
15
|
+
"persistent": true,
|
|
16
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
17
|
+
"env": ["POSTGRES_URL"]
|
|
18
|
+
},
|
|
19
|
+
"build": {
|
|
20
|
+
"dependsOn": ["^build"],
|
|
21
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
22
|
+
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
|
|
23
|
+
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
24
|
+
},
|
|
25
|
+
"lint": {
|
|
26
|
+
"dependsOn": ["^lint"]
|
|
27
|
+
},
|
|
28
|
+
"lint:fix": {
|
|
29
|
+
"dependsOn": ["^lint:fix"]
|
|
30
|
+
},
|
|
31
|
+
"dev": {
|
|
32
|
+
"cache": false,
|
|
33
|
+
"persistent": true,
|
|
34
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
35
|
+
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
36
|
+
},
|
|
37
|
+
"start": {
|
|
38
|
+
"dependsOn": ["^start"]
|
|
39
|
+
},
|
|
40
|
+
"init": {
|
|
41
|
+
"cache": false,
|
|
42
|
+
"persistent": true,
|
|
43
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
44
|
+
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
|
|
4
|
+
# Turbo
|
|
5
|
+
.turbo
|
|
6
|
+
|
|
7
|
+
# Generated content
|
|
8
|
+
.contentlayer
|
|
9
|
+
.content-collections
|
|
10
|
+
.source
|
|
11
|
+
|
|
12
|
+
# Test & Build
|
|
13
|
+
/coverage
|
|
14
|
+
/.next/
|
|
15
|
+
/out/
|
|
16
|
+
/build
|
|
17
|
+
*.tsbuildinfo
|
|
18
|
+
|
|
19
|
+
# Misc
|
|
20
|
+
.DS_Store
|
|
21
|
+
*.pem
|
|
22
|
+
/.pnp
|
|
23
|
+
.pnp.js
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
yarn-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
|
|
28
|
+
# Local env files
|
|
29
|
+
.env
|
|
30
|
+
.env.local
|
|
31
|
+
.env.development.local
|
|
32
|
+
.env.test.local
|
|
33
|
+
.env.production.local
|
|
34
|
+
|
|
35
|
+
# Others
|
|
36
|
+
.vercel
|
|
37
|
+
next-env.d.ts
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<br>
|
|
3
|
+
<a href="https://vitnode.com/" target="_blank">
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/VitNode/vitnode/canary/assets/logo/vitnode_logo_dark.svg">
|
|
6
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/VitNode/vitnode/canary/assets/logo/vitnode_logo_light.svg">
|
|
7
|
+
<img alt="VitNode Logo" src="https://raw.githubusercontent.com/VitNode/vitnode/canary/assets/logo/vitnode_logo_light.svg" width="400">
|
|
8
|
+
</picture>
|
|
9
|
+
</a>
|
|
10
|
+
<br>
|
|
11
|
+
<br>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
# VitNode App
|
|
15
|
+
|
|
16
|
+
This is a basic template for a [VitNode](https://vitnode.com/) app.
|
|
17
|
+
|
|
18
|
+
## Getting Started
|
|
19
|
+
|
|
20
|
+
To get started, run the following commands:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm i
|
|
24
|
+
# or
|
|
25
|
+
bun i
|
|
26
|
+
# or
|
|
27
|
+
npm i
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
|
|
34
|
+
To start the development server, you need to create a `.env` file in the root of the project from `.env.example`.
|
|
35
|
+
|
|
36
|
+
In the `development` environment, you can just copy and paste the content of `.env.example` to `.env`.
|
|
37
|
+
|
|
38
|
+
### Development server
|
|
39
|
+
|
|
40
|
+
To start the development server, run the following command:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm dev
|
|
44
|
+
# or
|
|
45
|
+
bun dev
|
|
46
|
+
# or
|
|
47
|
+
npm run dev
|
|
48
|
+
```
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { LogoVitNode } from '@vitnode/core/components/logo-vitnode';
|
|
2
2
|
import { ThemeLayout } from '@vitnode/core/views/layouts/theme/layout';
|
|
3
3
|
|
|
4
|
+
import { vitNodeConfig } from '../../../vitnode.config';
|
|
5
|
+
|
|
4
6
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
5
7
|
return (
|
|
6
|
-
<ThemeLayout
|
|
8
|
+
<ThemeLayout
|
|
9
|
+
logo={<LogoVitNode className="w-34" />}
|
|
10
|
+
vitNodeConfig={vitNodeConfig}
|
|
11
|
+
>
|
|
7
12
|
{children}
|
|
8
13
|
</ThemeLayout>
|
|
9
14
|
);
|
|
@@ -3,16 +3,8 @@ import { buttonVariants } from '@vitnode/core/components/ui/button';
|
|
|
3
3
|
import { Link } from '@vitnode/core/lib/navigation';
|
|
4
4
|
import { cn } from '@vitnode/core/lib/utils';
|
|
5
5
|
import { ArrowRight, Book, Terminal } from 'lucide-react';
|
|
6
|
-
import { getTranslations } from 'next-intl/server';
|
|
7
|
-
|
|
8
|
-
export default async function Home({
|
|
9
|
-
params,
|
|
10
|
-
}: {
|
|
11
|
-
params: Promise<{ locale: string }>;
|
|
12
|
-
}) {
|
|
13
|
-
const { locale } = await params;
|
|
14
|
-
const t = await getTranslations({ locale, namespace: 'welcome.home' });
|
|
15
6
|
|
|
7
|
+
export default function Page() {
|
|
16
8
|
return (
|
|
17
9
|
<main className="container mx-auto flex min-h-[calc(100vh-4rem)] flex-col items-center justify-center gap-16 px-4 py-16">
|
|
18
10
|
{/* Hero Section */}
|
|
@@ -21,10 +13,10 @@ export default async function Home({
|
|
|
21
13
|
|
|
22
14
|
<div className="space-y-4">
|
|
23
15
|
<h1 className="from-foreground to-foreground/70 bg-gradient-to-br bg-clip-text text-4xl font-bold tracking-tight text-balance text-transparent md:text-5xl lg:text-6xl">
|
|
24
|
-
|
|
16
|
+
Start Your Journey!
|
|
25
17
|
</h1>
|
|
26
18
|
<p className="text-muted-foreground mx-auto max-w-2xl text-lg text-pretty">
|
|
27
|
-
|
|
19
|
+
Dive in. Create or install your first plugin!
|
|
28
20
|
</p>
|
|
29
21
|
</div>
|
|
30
22
|
|
|
@@ -39,9 +31,9 @@ export default async function Home({
|
|
|
39
31
|
href="/admin"
|
|
40
32
|
target="_blank"
|
|
41
33
|
>
|
|
42
|
-
<Terminal className="mr-2
|
|
43
|
-
|
|
44
|
-
<ArrowRight className="ml-2
|
|
34
|
+
<Terminal className="mr-2 size-4" />
|
|
35
|
+
Go to AdminCP
|
|
36
|
+
<ArrowRight className="ml-2 size-4" />
|
|
45
37
|
</Link>
|
|
46
38
|
|
|
47
39
|
<Link
|
|
@@ -55,8 +47,8 @@ export default async function Home({
|
|
|
55
47
|
rel="noopener noreferrer"
|
|
56
48
|
target="_blank"
|
|
57
49
|
>
|
|
58
|
-
<Book className="mr-2
|
|
59
|
-
|
|
50
|
+
<Book className="mr-2 size-4" />
|
|
51
|
+
Read our Docs
|
|
60
52
|
</Link>
|
|
61
53
|
|
|
62
54
|
<Link
|
|
@@ -71,7 +63,7 @@ export default async function Home({
|
|
|
71
63
|
target="_blank"
|
|
72
64
|
>
|
|
73
65
|
<svg
|
|
74
|
-
className="mr-2
|
|
66
|
+
className="mr-2 size-4"
|
|
75
67
|
role="img"
|
|
76
68
|
viewBox="0 0 24 24"
|
|
77
69
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AdminLayout,
|
|
3
|
+
type AdminLayoutProps,
|
|
4
|
+
} from '@vitnode/core/views/admin/layouts/admin-layout';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
) {
|
|
6
|
-
return <AdminLayout {...props} />;
|
|
6
|
+
import { vitNodeConfig } from '@/vitnode.config';
|
|
7
|
+
|
|
8
|
+
export default function Layout(props: AdminLayoutProps) {
|
|
9
|
+
return <AdminLayout vitNodeConfig={vitNodeConfig} {...props} />;
|
|
7
10
|
}
|
|
@@ -23,14 +23,18 @@ export const generateMetadata = (): Metadata =>
|
|
|
23
23
|
generateMetadataRootLayout(vitNodeConfig);
|
|
24
24
|
|
|
25
25
|
export const generateStaticParams = () =>
|
|
26
|
-
vitNodeConfig.i18n.locales.map(locale => ({ locale }));
|
|
26
|
+
vitNodeConfig.i18n.locales.map(locale => ({ locale: locale.code }));
|
|
27
|
+
|
|
28
|
+
export default async function LocaleLayout(props: RootLayoutProps) {
|
|
29
|
+
const { locale } = await props.params;
|
|
27
30
|
|
|
28
|
-
export default function LocaleLayout(props: RootLayoutProps) {
|
|
29
31
|
return (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
<html lang={locale} suppressHydrationWarning>
|
|
33
|
+
<body
|
|
34
|
+
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
35
|
+
>
|
|
36
|
+
<RootLayout config={vitNodeConfig} {...props} />
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
35
39
|
);
|
|
36
40
|
}
|