create-vitnode-app 1.2.0-canary.6 → 1.2.0-canary.61
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 +25 -5
- package/copy-of-vitnode-app/.vscode/settings.json +11 -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/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 +16 -0
- package/copy-of-vitnode-app/api-single-app/.env.example +8 -0
- package/copy-of-vitnode-app/api-single-app/.gitignore_template +37 -0
- package/copy-of-vitnode-app/api-single-app/drizzle.config.ts +12 -0
- package/copy-of-vitnode-app/api-single-app/src/app/api/[...route]/route.ts +16 -0
- 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 +18 -2
- package/copy-of-vitnode-app/eslint-react/eslint.config.mjs +19 -0
- package/copy-of-vitnode-app/monorepo/.gitignore_template +41 -0
- package/copy-of-vitnode-app/monorepo/apps/api/.env.example +8 -0
- package/copy-of-vitnode-app/monorepo/apps/web/.env.example +1 -0
- package/copy-of-vitnode-app/monorepo/turbo.json +40 -0
- package/copy-of-vitnode-app/root/.env.example +2 -4
- package/copy-of-vitnode-app/root/.gitignore_template +37 -0
- package/copy-of-vitnode-app/root/README.md +47 -0
- package/copy-of-vitnode-app/root/global.d.ts +9 -0
- package/copy-of-vitnode-app/root/next.config.ts +3 -6
- package/copy-of-vitnode-app/root/postcss.config.mjs +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/[...rest]/page.tsx +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/layout.tsx +8 -3
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/not-found.tsx +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/(main)/page.tsx +20 -27
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/(auth)/layout.tsx +2 -2
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/page.tsx +1 -1
- package/copy-of-vitnode-app/root/src/app/[locale]/layout.tsx +20 -17
- package/copy-of-vitnode-app/root/src/app/global-error.tsx +8 -11
- package/copy-of-vitnode-app/root/src/app/global.css +63 -64
- package/copy-of-vitnode-app/root/src/app/layout.tsx +1 -1
- package/copy-of-vitnode-app/root/src/proxy.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 +251 -56
- package/dist/src/create/create-vitnode.js +161 -27
- package/dist/src/create/package-versions.js +41 -0
- package/dist/src/helpers/get-available-package-managers.js +6 -6
- package/dist/src/helpers/get-package-json.js +2 -2
- package/dist/src/helpers/get-package-manager-from-root.js +15 -0
- package/dist/src/helpers/get-vitnode-package-version.js +9 -0
- package/dist/src/helpers/init-vitnode.js +21 -0
- package/dist/src/helpers/install-dependencies.js +55 -14
- package/dist/src/helpers/is-folder-empty.js +25 -26
- package/dist/src/helpers/is-online.js +16 -16
- package/dist/src/helpers/is-writeable.js +3 -3
- package/dist/src/helpers/validate-pkg.js +1 -1
- package/dist/src/helpers/with-If.js +1 -0
- package/dist/src/index.js +29 -26
- package/dist/src/plugin/create/create-package-json.js +62 -0
- package/dist/src/plugin/create/create-plugin-vitnode.js +50 -0
- package/dist/src/plugin/index.js +18 -6
- package/dist/src/plugin/questions.js +14 -0
- package/dist/src/plugin/validation.js +76 -0
- package/dist/src/prepare/prepare.js +5 -5
- package/dist/src/questions.js +52 -15
- package/dist/src/validation.js +15 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +25 -0
- package/package.json +9 -9
- package/copy-of-vitnode-app/root/.prettierrc.mjs +0 -11
- package/copy-of-vitnode-app/root/drizzle.config.ts +0 -12
- package/copy-of-vitnode-app/root/gitignore_template +0 -43
- package/copy-of-vitnode-app/root/src/app/[locale]/admin/not-found.tsx +0 -5
- package/copy-of-vitnode-app/root/src/app/api/[...route]/route.ts +0 -18
- 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/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -29,10 +29,30 @@ 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
|
|
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 & Prettier 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. |
|
|
48
|
+
| `--plugin` | Create a VitNode plugin project. |
|
|
49
|
+
|
|
50
|
+
## Create Plugin
|
|
51
|
+
|
|
52
|
+
Use the `--plugin` flag to create a VitNode plugin project.
|
|
53
|
+
|
|
54
|
+
### Options
|
|
55
|
+
|
|
56
|
+
| Option | Description |
|
|
57
|
+
| ---------------- | -------------------------------------------------------- |
|
|
58
|
+
| `--skip-install` | Skip installing packages after initializing the project. |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": ["vitnode"],
|
|
3
|
+
"github.copilot.chat.commitMessageGeneration.instructions": [
|
|
4
|
+
{
|
|
5
|
+
"text": "Follow the Conventional Commits format strictly for commit messages. Use the structure below:\n\n```\n<type>[optional scope]: <gitmoji> <description>\n```\n\nGuidelines:\n\n1. **Type and Scope**: Choose an appropriate type (e.g., `feat`, `fix`, `refactor`, `docs`) and optional scope to describe the affected module or feature.\n\n2. **Gitmoji**: Include a relevant `gitmoji` that best represents the nature of the change.\n\n3. **Description**: Write a concise, informative description in the header; use backticks if referencing code or specific terms.\n\nCommit messages should be clear, informative, and professional, aiding readability and project tracking."
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"search.exclude": {
|
|
9
|
+
"**/(plugins)/*": true
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -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,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 { config } from "dotenv";
|
|
3
|
+
import { drizzle } from "drizzle-orm/postgres-js";
|
|
4
|
+
|
|
5
|
+
config({
|
|
6
|
+
quiet: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const POSTGRES_URL =
|
|
10
|
+
process.env.POSTGRES_URL ?? "postgresql://root:root@localhost:5432/vitnode";
|
|
11
|
+
|
|
12
|
+
export const vitNodeApiConfig = buildApiConfig({
|
|
13
|
+
plugins: [],
|
|
14
|
+
pathToMessages: async path => await import(`./locales/${path}`),
|
|
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/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,16 @@
|
|
|
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 {
|
|
14
|
+
port: 8080,
|
|
15
|
+
fetch: app.fetch,
|
|
16
|
+
};
|
|
@@ -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,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,16 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { VitNodeAPI } from "@vitnode/core/api/config";
|
|
3
|
+
import { handle } from "hono/vercel";
|
|
4
|
+
|
|
5
|
+
import { vitNodeApiConfig } from "@/vitnode.api.config";
|
|
6
|
+
|
|
7
|
+
const app = new OpenAPIHono().basePath("/api");
|
|
8
|
+
VitNodeAPI({
|
|
9
|
+
app,
|
|
10
|
+
vitNodeApiConfig,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const GET = handle(app);
|
|
14
|
+
export const POST = handle(app);
|
|
15
|
+
export const PUT = handle(app);
|
|
16
|
+
export const DELETE = 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
|
+
process.env.POSTGRES_URL ?? "postgresql://root:root@localhost:5432/vitnode";
|
|
6
|
+
|
|
7
|
+
export const vitNodeApiConfig = buildApiConfig({
|
|
8
|
+
pathToMessages: async path => await import(`./locales/${path}`),
|
|
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:
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import eslintVitNode from
|
|
1
|
+
import eslintVitNode from "@vitnode/config/eslint";
|
|
2
|
+
import eslintVitNodeReact from "@vitnode/config/eslint.react";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { dirname } from "node:path";
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
...eslintVitNode,
|
|
10
|
+
...eslintVitNodeReact,
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: "./tsconfig.json",
|
|
15
|
+
tsconfigRootDir: __dirname,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import eslintVitNode from "@vitnode/config/eslint";
|
|
2
|
+
import eslintVitNodeReact from "@vitnode/config/eslint.react";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
...eslintVitNode,
|
|
10
|
+
...eslintVitNodeReact,
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: "./tsconfig.json",
|
|
15
|
+
tsconfigRootDir: __dirname,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
@@ -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 @@
|
|
|
1
|
+
NEXT_PUBLIC_API_URL=http://localhost:8080
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
"build": {
|
|
13
|
+
"dependsOn": ["^build"],
|
|
14
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
15
|
+
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
|
|
16
|
+
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
17
|
+
},
|
|
18
|
+
"dev": {
|
|
19
|
+
"cache": false,
|
|
20
|
+
"persistent": true,
|
|
21
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
22
|
+
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
23
|
+
},
|
|
24
|
+
"start": {
|
|
25
|
+
"dependsOn": ["^start"]
|
|
26
|
+
},
|
|
27
|
+
"lint": {
|
|
28
|
+
"dependsOn": ["^lint"]
|
|
29
|
+
},
|
|
30
|
+
"lint:fix": {
|
|
31
|
+
"dependsOn": ["^lint:fix"]
|
|
32
|
+
},
|
|
33
|
+
"init": {
|
|
34
|
+
"cache": false,
|
|
35
|
+
"persistent": true,
|
|
36
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
37
|
+
"env": ["POSTGRES_URL", "NEXT_PUBLIC_API_URL", "NEXT_PUBLIC_WEB_URL"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
LOGIN_TOKEN_SECRET=secret
|
|
2
1
|
POSTGRES_URL=postgresql://root:root@localhost:5432/vitnode
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
NEXT_PUBLIC_FRONTEND_URL=http://localhost:3000
|
|
3
|
+
NEXT_PUBLIC_API_URL=http://localhost:3000
|
|
4
|
+
NEXT_PUBLIC_WEB_URL=http://localhost:3000
|
|
7
5
|
|
|
8
6
|
# === Docker Database Postgres ===
|
|
9
7
|
POSTGRES_USER=root
|
|
@@ -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
|
|
@@ -1 +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
|
+
|
|
1
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,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { vitNodeNextConfig } from "@vitnode/core/config/next.config";
|
|
2
|
+
import type { NextConfig } from "next";
|
|
3
3
|
|
|
4
4
|
const nextConfig: NextConfig = {
|
|
5
|
-
|
|
6
|
-
inlineCss: true,
|
|
7
|
-
reactCompiler: true,
|
|
8
|
-
},
|
|
5
|
+
reactCompiler: true,
|
|
9
6
|
};
|
|
10
7
|
|
|
11
8
|
export default vitNodeNextConfig(nextConfig);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { LogoVitNode } from
|
|
2
|
-
import { ThemeLayout } from
|
|
1
|
+
import { LogoVitNode } from "@vitnode/core/components/logo-vitnode";
|
|
2
|
+
import { ThemeLayout } from "@vitnode/core/views/layouts/theme/layout";
|
|
3
|
+
|
|
4
|
+
import { vitNodeConfig } from "../../../vitnode.config";
|
|
3
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
|
);
|