create-vitnode-app 1.2.0-canary.5 → 1.2.0-canary.51
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/locales/@vitnode/blog/en.json +70 -0
- package/copy-of-vitnode-app/api/src/locales/@vitnode/core/en.json +217 -0
- package/copy-of-vitnode-app/api/src/vitnode.api.config.ts +33 -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/{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 +19 -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 +16 -2
- 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 +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]/layout.tsx +11 -7
- package/copy-of-vitnode-app/root/src/app/global.css +61 -62
- 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 +231 -40
- package/dist/src/create/create-vitnode.js +142 -9
- package/dist/src/helpers/init-vitnode.js +21 -0
- package/dist/src/helpers/install-dependencies.js +42 -4
- package/dist/src/helpers/is-online.js +1 -1
- 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 +44 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- 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/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.50",
|
|
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": "^1.0.2",
|
|
19
|
+
"@hono/zod-validator": "^0.7.2",
|
|
20
|
+
"@react-email/components": "^0.3.2",
|
|
21
|
+
"@vitnode/core": "workspace:*",
|
|
22
|
+
"drizzle-kit": "^0.31.4",
|
|
23
|
+
"drizzle-orm": "^0.44.3",
|
|
24
|
+
"hono": "^4.8.5",
|
|
25
|
+
"next-intl": "^4.3.4",
|
|
26
|
+
"react": "^19.1.0",
|
|
27
|
+
"react-dom": "^19.1.0",
|
|
28
|
+
"zod": "^4.0.5"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@hono/node-server": "^1.17.1",
|
|
32
|
+
"@types/node": "^24.1.0",
|
|
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.31.0",
|
|
38
|
+
"react-email": "^4.2.3",
|
|
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,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@vitnode/blog": {
|
|
3
|
+
"title": "Blog",
|
|
4
|
+
"admin": {
|
|
5
|
+
"nav": {
|
|
6
|
+
"posts": "Posts",
|
|
7
|
+
"categories": "Categories"
|
|
8
|
+
},
|
|
9
|
+
"categories": {
|
|
10
|
+
"desc": "Manage categories for blog posts.",
|
|
11
|
+
"table": {
|
|
12
|
+
"title": "Title",
|
|
13
|
+
"updated_at": "Updated At"
|
|
14
|
+
},
|
|
15
|
+
"delete": {
|
|
16
|
+
"title": "Delete Category",
|
|
17
|
+
"desc": "Are you sure you want to delete <title></title> category? This action cannot be undone.",
|
|
18
|
+
"confirm": "Yes, delete this category",
|
|
19
|
+
"success": "Category has been deleted successfully."
|
|
20
|
+
},
|
|
21
|
+
"create": {
|
|
22
|
+
"title": "Create Category",
|
|
23
|
+
"desc": "A new category for your blog posts.",
|
|
24
|
+
"form": {
|
|
25
|
+
"title": {
|
|
26
|
+
"label": "Title",
|
|
27
|
+
"already_exists": "This category title already exists."
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"submit": "Create"
|
|
31
|
+
},
|
|
32
|
+
"edit": {
|
|
33
|
+
"title": "Edit Category",
|
|
34
|
+
"submit": "Save Changes"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"posts": {
|
|
38
|
+
"desc": "Write and manage your blog posts.",
|
|
39
|
+
"table": {
|
|
40
|
+
"title": "Title",
|
|
41
|
+
"category": "Category",
|
|
42
|
+
"updated_at": "Updated At"
|
|
43
|
+
},
|
|
44
|
+
"create": {
|
|
45
|
+
"title": "Create Post",
|
|
46
|
+
"desc": "Write a new article for your blog.",
|
|
47
|
+
"form": {
|
|
48
|
+
"title": {
|
|
49
|
+
"label": "Title",
|
|
50
|
+
"already_exists": "This post title already exists."
|
|
51
|
+
},
|
|
52
|
+
"content": "Content",
|
|
53
|
+
"category": "Category"
|
|
54
|
+
},
|
|
55
|
+
"submit": "Create Post"
|
|
56
|
+
},
|
|
57
|
+
"edit": {
|
|
58
|
+
"title": "Edit Post",
|
|
59
|
+
"submit": "Save Changes"
|
|
60
|
+
},
|
|
61
|
+
"delete": {
|
|
62
|
+
"title": "Delete Post",
|
|
63
|
+
"desc": "Are you sure you want to delete <title></title> post? This action cannot be undone.",
|
|
64
|
+
"confirm": "Yes, delete this post",
|
|
65
|
+
"success": "Post has been deleted successfully."
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
{
|
|
2
|
+
"core": {
|
|
3
|
+
"global": {
|
|
4
|
+
"theme_switcher": "Toggle Theme",
|
|
5
|
+
"language_switcher": "Switch Language",
|
|
6
|
+
"toggle_sidebar": "Toggle Sidebar",
|
|
7
|
+
"no_results": {
|
|
8
|
+
"title": "No results found",
|
|
9
|
+
"desc": "Try adjusting your search or filter criteria."
|
|
10
|
+
},
|
|
11
|
+
"are_you_sure_want_to_leave_form": {
|
|
12
|
+
"title": "Are you sure you want to leave this form?",
|
|
13
|
+
"desc": "Your changes will not be saved.",
|
|
14
|
+
"cancel": "Cancel",
|
|
15
|
+
"confirm": "Yes, leave"
|
|
16
|
+
},
|
|
17
|
+
"confirm_action": {
|
|
18
|
+
"title": "Are you sure?",
|
|
19
|
+
"desc": "This action cannot be undone.",
|
|
20
|
+
"cancel": "Cancel",
|
|
21
|
+
"confirm": "Yes, confirm"
|
|
22
|
+
},
|
|
23
|
+
"search_placeholder": "Search...",
|
|
24
|
+
"results_not_found": "No results found",
|
|
25
|
+
"date": "{date, date}",
|
|
26
|
+
"date_medium": "{date, date, medium}",
|
|
27
|
+
"date_short": "{date, date, short}",
|
|
28
|
+
"register": "Register",
|
|
29
|
+
"login": "Login",
|
|
30
|
+
"save": "Save",
|
|
31
|
+
"submit": "Submit",
|
|
32
|
+
"cancel": "Cancel",
|
|
33
|
+
"optional": "Optional",
|
|
34
|
+
"loading": "Loading...",
|
|
35
|
+
"or": "or",
|
|
36
|
+
"back_home": "Back to home",
|
|
37
|
+
"go_back": "Go back",
|
|
38
|
+
"select_option": "Select an option",
|
|
39
|
+
"select_options": "Select options",
|
|
40
|
+
"go_to_prev_page": "Go to previous page",
|
|
41
|
+
"go_to_next_page": "Go to next page",
|
|
42
|
+
"errors": {
|
|
43
|
+
"title": "Oops! Something went wrong.",
|
|
44
|
+
"internal_server_error": "Internal server error.",
|
|
45
|
+
"field_required": "This field is required.",
|
|
46
|
+
"field_min_length": "This field must be at least {min} characters.",
|
|
47
|
+
"captcha_internal_error": "Captcha validation failed. Please try again later.",
|
|
48
|
+
"404": {
|
|
49
|
+
"title": "Page Not Found",
|
|
50
|
+
"desc": "Oops! The page you're looking for doesn't exist."
|
|
51
|
+
},
|
|
52
|
+
"500": {
|
|
53
|
+
"title": "Internal Server Error",
|
|
54
|
+
"desc": "Sorry, we're experiencing technical difficulties on our server."
|
|
55
|
+
},
|
|
56
|
+
"400": {
|
|
57
|
+
"title": "Bad Request",
|
|
58
|
+
"desc": "The request couldn't be processed due to invalid parameters."
|
|
59
|
+
},
|
|
60
|
+
"403": {
|
|
61
|
+
"title": "Forbidden",
|
|
62
|
+
"desc": "You don't have permission to access this resource."
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"user_bar": {
|
|
66
|
+
"log_out": "Log out",
|
|
67
|
+
"admin_cp": "Admin CP"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"auth": {
|
|
71
|
+
"sso": {
|
|
72
|
+
"or": "Or continue With",
|
|
73
|
+
"access_denied": "You have denied access to the application or the request has expired. Please try again."
|
|
74
|
+
},
|
|
75
|
+
"sign_up": {
|
|
76
|
+
"desc": "Hello there! Create your account to get started.",
|
|
77
|
+
"already_have_account": "You already have an account? <link>Sign in</link>.",
|
|
78
|
+
"submit": "Register",
|
|
79
|
+
"username": {
|
|
80
|
+
"label": "Username",
|
|
81
|
+
"min_length": "Username must be at least 3 characters long.",
|
|
82
|
+
"max_length": "Username must be at most 32 characters long.",
|
|
83
|
+
"exists": "Username already exists.",
|
|
84
|
+
"your_user_code": "Your user code: <code></code>"
|
|
85
|
+
},
|
|
86
|
+
"email": {
|
|
87
|
+
"label": "Email",
|
|
88
|
+
"invalid": "Invalid email address.",
|
|
89
|
+
"exists": "Email already exists."
|
|
90
|
+
},
|
|
91
|
+
"password": {
|
|
92
|
+
"label": "Password",
|
|
93
|
+
"invalid": "Password is too weak.",
|
|
94
|
+
"requirements": {
|
|
95
|
+
"label": "Password should contain:",
|
|
96
|
+
"min_length": "At least 8 characters",
|
|
97
|
+
"uppercase": "At least one uppercase letter",
|
|
98
|
+
"number": "At least one number",
|
|
99
|
+
"special_char": "At least one special character"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"terms": {
|
|
103
|
+
"label": "Accept terms and conditions",
|
|
104
|
+
"required": "You must accept the terms and conditions.",
|
|
105
|
+
"desc": "You agree to our <link>Legal documents & Policies</link>."
|
|
106
|
+
},
|
|
107
|
+
"newsletter": {
|
|
108
|
+
"label": "Newsletter",
|
|
109
|
+
"desc": "Receive the latest news and updates."
|
|
110
|
+
},
|
|
111
|
+
"email_confirmation": {
|
|
112
|
+
"title": "Check your email",
|
|
113
|
+
"desc": "We've sent a confirmation link to your email address",
|
|
114
|
+
"check_spam": "If you don't see the email in your inbox, please check your spam folder."
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"sign_in": {
|
|
118
|
+
"desc": "Welcome back! Sign in to your account.",
|
|
119
|
+
"do_not_have_account": "Don't have an account? <link>Sign up</link>.",
|
|
120
|
+
"email": {
|
|
121
|
+
"label": "Email",
|
|
122
|
+
"invalid": "Invalid email address."
|
|
123
|
+
},
|
|
124
|
+
"password": {
|
|
125
|
+
"label": "Password",
|
|
126
|
+
"required": "Password is required."
|
|
127
|
+
},
|
|
128
|
+
"errors": {
|
|
129
|
+
"access_denied": {
|
|
130
|
+
"title": "Invalid credentials",
|
|
131
|
+
"desc": "The email address or password was incorrect. Please try again (make sure your caps lock is off)."
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"submit": "Login"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"admin": {
|
|
139
|
+
"dashboard": {
|
|
140
|
+
"dev_mode": "Development Mode",
|
|
141
|
+
"version": "Version: {version}"
|
|
142
|
+
},
|
|
143
|
+
"global": {
|
|
144
|
+
"nav": {
|
|
145
|
+
"core": "Core",
|
|
146
|
+
"dashboard": "Dashboard",
|
|
147
|
+
"users": {
|
|
148
|
+
"title": "Users",
|
|
149
|
+
"list": "User List"
|
|
150
|
+
},
|
|
151
|
+
"user_bar": {
|
|
152
|
+
"home_page": "Home Page",
|
|
153
|
+
"debug": "Debug Panel",
|
|
154
|
+
"log_out": "Log Out"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"user": {
|
|
159
|
+
"list": {
|
|
160
|
+
"desc": "Manage users of your application.",
|
|
161
|
+
"user": "User",
|
|
162
|
+
"createdAt": "Created At",
|
|
163
|
+
"emailNotVerified": "Email Not Verified"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"debug": {
|
|
167
|
+
"title": "Debug Panel",
|
|
168
|
+
"desc": "Check logs, errors, and other debug information.",
|
|
169
|
+
"actions": {
|
|
170
|
+
"clear_cache": {
|
|
171
|
+
"label": "Clear Cache",
|
|
172
|
+
"title": "Are you sure you want to clear the cache?",
|
|
173
|
+
"desc": "This action will remove all cached data, which may affect performance temporarily.",
|
|
174
|
+
"success": "Cache cleared successfully.",
|
|
175
|
+
"confirm": "Yes, clear cache"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"logs": {
|
|
179
|
+
"title": "System Logs",
|
|
180
|
+
"created_at": "Created At",
|
|
181
|
+
"plugin": "Plugin",
|
|
182
|
+
"content": "Content",
|
|
183
|
+
"type": "Type",
|
|
184
|
+
"types": {
|
|
185
|
+
"warn": "Warning",
|
|
186
|
+
"error": "Error",
|
|
187
|
+
"debug": "Debug"
|
|
188
|
+
},
|
|
189
|
+
"status_code": "Status Code",
|
|
190
|
+
"more": {
|
|
191
|
+
"title": "More Details",
|
|
192
|
+
"desc": "Log ID: <logId></logId>",
|
|
193
|
+
"log_overview": {
|
|
194
|
+
"title": "Log Overview",
|
|
195
|
+
"log_type": "Log Type",
|
|
196
|
+
"status_code": "Status Code",
|
|
197
|
+
"log_id": "Log ID",
|
|
198
|
+
"created_at": "Created At",
|
|
199
|
+
"plugin": "Plugin",
|
|
200
|
+
"user": "User"
|
|
201
|
+
},
|
|
202
|
+
"request_information": {
|
|
203
|
+
"title": "Request Information",
|
|
204
|
+
"ip_address": "IP Address",
|
|
205
|
+
"request_method": "Request Method",
|
|
206
|
+
"request_url": "Request URL",
|
|
207
|
+
"user_agent": "User Agent"
|
|
208
|
+
},
|
|
209
|
+
"log_content": {
|
|
210
|
+
"title": "Log Content",
|
|
211
|
+
"full_log": "Full Log Message"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NodemailerEmailAdapter } from '@vitnode/core/api/adapters/email/nodemailer';
|
|
2
|
+
import { buildApiConfig } from '@vitnode/core/vitnode.config';
|
|
3
|
+
import * as dotenv from 'dotenv';
|
|
4
|
+
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
5
|
+
|
|
6
|
+
dotenv.config({
|
|
7
|
+
quiet: true,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const POSTGRES_URL =
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
12
|
+
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
|
|
13
|
+
|
|
14
|
+
export const vitNodeApiConfig = buildApiConfig({
|
|
15
|
+
plugins: [],
|
|
16
|
+
pathToMessages: async path => await import(`./locales/${path}`),
|
|
17
|
+
dbProvider: drizzle({
|
|
18
|
+
connection: POSTGRES_URL,
|
|
19
|
+
casing: 'camelCase',
|
|
20
|
+
}),
|
|
21
|
+
email: {
|
|
22
|
+
adapter: NodemailerEmailAdapter({
|
|
23
|
+
from: process.env.NODE_MAILER_FROM,
|
|
24
|
+
host: process.env.NODE_MAILER_HOST,
|
|
25
|
+
password: process.env.NODE_MAILER_PASSWORD,
|
|
26
|
+
user: process.env.NOD_EMAILER_USER,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
metadata: {
|
|
30
|
+
title: 'VitNode API',
|
|
31
|
+
shortTitle: 'VitNode',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -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,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
|
|
@@ -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,19 @@
|
|
|
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
|
+
pathToMessages: async path => await import(`./locales/${path}`),
|
|
10
|
+
metadata: {
|
|
11
|
+
title: 'VitNode',
|
|
12
|
+
shortTitle: 'VitNode',
|
|
13
|
+
},
|
|
14
|
+
plugins: [],
|
|
15
|
+
dbProvider: drizzle({
|
|
16
|
+
connection: POSTGRES_URL,
|
|
17
|
+
casing: 'camelCase',
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
@@ -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,17 @@
|
|
|
1
|
-
import eslintVitNode from 'eslint-config
|
|
1
|
+
import eslintVitNode from '@vitnode/eslint-config/eslint';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname } from 'node:path';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
...eslintVitNode,
|
|
9
|
+
{
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parserOptions: {
|
|
12
|
+
project: './tsconfig.json',
|
|
13
|
+
tsconfigRootDir: __dirname,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|