@fecommunity/reactpress-server 4.0.0 → 4.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.
- package/README.md +325 -56
- package/bin/reactpress-server.js +6 -50
- package/dist/app.module.js +30 -18
- package/dist/app.module.js.map +1 -1
- package/dist/filters/http-exception.filter.js +1 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/generate-swagger.d.ts +1 -1
- package/dist/generate-swagger.js +11 -12
- package/dist/generate-swagger.js.map +1 -1
- package/dist/interceptors/transform.interceptor.d.ts +6 -2
- package/dist/interceptors/transform.interceptor.js +5 -10
- package/dist/interceptors/transform.interceptor.js.map +1 -1
- package/dist/logger/index.js +4 -5
- package/dist/logger/index.js.map +1 -1
- package/dist/main.d.ts +1 -3
- package/dist/main.js +23 -47
- package/dist/main.js.map +1 -1
- package/dist/modules/article/article.controller.d.ts +2 -7
- package/dist/modules/article/article.controller.js +48 -103
- package/dist/modules/article/article.controller.js.map +1 -1
- package/dist/modules/article/article.entity.d.ts +0 -4
- package/dist/modules/article/article.entity.js +41 -61
- package/dist/modules/article/article.entity.js.map +1 -1
- package/dist/modules/article/article.module.js +3 -18
- package/dist/modules/article/article.module.js.map +1 -1
- package/dist/modules/article/article.service.d.ts +2 -16
- package/dist/modules/article/article.service.js +29 -151
- package/dist/modules/article/article.service.js.map +1 -1
- package/dist/modules/auth/auth.controller.js +11 -11
- package/dist/modules/auth/auth.controller.js.map +1 -1
- package/dist/modules/auth/auth.module.js +4 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/auth.service.js +7 -8
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/jwt-auth.guard.js +3 -4
- package/dist/modules/auth/jwt-auth.guard.js.map +1 -1
- package/dist/modules/auth/jwt.strategy.js +3 -4
- package/dist/modules/auth/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/roles.guard.js +2 -2
- package/dist/modules/auth/roles.guard.js.map +1 -1
- package/dist/modules/category/category.controller.js +20 -21
- package/dist/modules/category/category.controller.js.map +1 -1
- package/dist/modules/category/category.entity.js +13 -13
- package/dist/modules/category/category.entity.js.map +1 -1
- package/dist/modules/category/category.module.js +1 -1
- package/dist/modules/category/category.module.js.map +1 -1
- package/dist/modules/category/category.service.js +4 -5
- package/dist/modules/category/category.service.js.map +1 -1
- package/dist/modules/comment/comment.controller.js +20 -24
- package/dist/modules/comment/comment.controller.js.map +1 -1
- package/dist/modules/comment/comment.entity.js +31 -31
- package/dist/modules/comment/comment.entity.js.map +1 -1
- package/dist/modules/comment/comment.module.js +2 -11
- package/dist/modules/comment/comment.module.js.map +1 -1
- package/dist/modules/comment/comment.service.d.ts +1 -5
- package/dist/modules/comment/comment.service.js +16 -43
- package/dist/modules/comment/comment.service.js.map +1 -1
- package/dist/modules/comment/html.d.ts +1 -1
- package/dist/modules/comment/html.js +3 -3
- package/dist/modules/comment/html.js.map +1 -1
- package/dist/modules/file/file.controller.d.ts +1 -1
- package/dist/modules/file/file.controller.js +20 -22
- package/dist/modules/file/file.controller.js.map +1 -1
- package/dist/modules/file/file.entity.d.ts +0 -7
- package/dist/modules/file/file.entity.js +15 -20
- package/dist/modules/file/file.entity.js.map +1 -1
- package/dist/modules/file/file.module.js +4 -16
- package/dist/modules/file/file.module.js.map +1 -1
- package/dist/modules/file/file.service.d.ts +1 -6
- package/dist/modules/file/file.service.js +38 -88
- package/dist/modules/file/file.service.js.map +1 -1
- package/dist/modules/install/install.controller.js +5 -5
- package/dist/modules/install/install.controller.js.map +1 -1
- package/dist/modules/install/install.module.js +1 -1
- package/dist/modules/install/install.module.js.map +1 -1
- package/dist/modules/install/install.service.js +2 -2
- package/dist/modules/install/install.service.js.map +1 -1
- package/dist/modules/knowledge/knowledge.controller.js +33 -35
- package/dist/modules/knowledge/knowledge.controller.js.map +1 -1
- package/dist/modules/knowledge/knowledge.entity.js +33 -33
- package/dist/modules/knowledge/knowledge.entity.js.map +1 -1
- package/dist/modules/knowledge/knowledge.module.js +1 -1
- package/dist/modules/knowledge/knowledge.module.js.map +1 -1
- package/dist/modules/knowledge/knowledge.service.js +11 -12
- package/dist/modules/knowledge/knowledge.service.js.map +1 -1
- package/dist/modules/page/page.controller.js +23 -24
- package/dist/modules/page/page.controller.js.map +1 -1
- package/dist/modules/page/page.entity.js +27 -27
- package/dist/modules/page/page.entity.js.map +1 -1
- package/dist/modules/page/page.module.js +1 -1
- package/dist/modules/page/page.module.js.map +1 -1
- package/dist/modules/page/page.service.js +12 -12
- package/dist/modules/page/page.service.js.map +1 -1
- package/dist/modules/search/search.controller.js +12 -12
- package/dist/modules/search/search.controller.js.map +1 -1
- package/dist/modules/search/search.entity.js +13 -13
- package/dist/modules/search/search.entity.js.map +1 -1
- package/dist/modules/search/search.module.js +1 -1
- package/dist/modules/search/search.module.js.map +1 -1
- package/dist/modules/search/search.service.js +2 -2
- package/dist/modules/search/search.service.js.map +1 -1
- package/dist/modules/setting/setting.constant.d.ts +4 -5
- package/dist/modules/setting/setting.constant.js +20 -5
- package/dist/modules/setting/setting.constant.js.map +1 -1
- package/dist/modules/setting/setting.controller.js +11 -11
- package/dist/modules/setting/setting.controller.js.map +1 -1
- package/dist/modules/setting/setting.entity.d.ts +0 -3
- package/dist/modules/setting/setting.entity.js +49 -64
- package/dist/modules/setting/setting.entity.js.map +1 -1
- package/dist/modules/setting/setting.module.js +2 -2
- package/dist/modules/setting/setting.module.js.map +1 -1
- package/dist/modules/setting/setting.service.d.ts +2 -13
- package/dist/modules/setting/setting.service.js +24 -169
- package/dist/modules/setting/setting.service.js.map +1 -1
- package/dist/modules/smtp/mail.util.d.ts +6 -7
- package/dist/modules/smtp/mail.util.js +9 -5
- package/dist/modules/smtp/mail.util.js.map +1 -1
- package/dist/modules/smtp/smtp.controller.d.ts +0 -3
- package/dist/modules/smtp/smtp.controller.js +14 -27
- package/dist/modules/smtp/smtp.controller.js.map +1 -1
- package/dist/modules/smtp/smtp.entity.js +15 -15
- package/dist/modules/smtp/smtp.entity.js.map +1 -1
- package/dist/modules/smtp/smtp.module.js +2 -2
- package/dist/modules/smtp/smtp.module.js.map +1 -1
- package/dist/modules/smtp/smtp.service.d.ts +0 -14
- package/dist/modules/smtp/smtp.service.js +12 -40
- package/dist/modules/smtp/smtp.service.js.map +1 -1
- package/dist/modules/tag/tag.controller.js +22 -24
- package/dist/modules/tag/tag.controller.js.map +1 -1
- package/dist/modules/tag/tag.entity.js +12 -12
- package/dist/modules/tag/tag.entity.js.map +1 -1
- package/dist/modules/tag/tag.module.js +1 -1
- package/dist/modules/tag/tag.module.js.map +1 -1
- package/dist/modules/tag/tag.service.js +4 -5
- package/dist/modules/tag/tag.service.js.map +1 -1
- package/dist/modules/user/user.controller.js +28 -39
- package/dist/modules/user/user.controller.js.map +1 -1
- package/dist/modules/user/user.entity.js +22 -22
- package/dist/modules/user/user.entity.js.map +1 -1
- package/dist/modules/user/user.module.js +2 -2
- package/dist/modules/user/user.module.js.map +1 -1
- package/dist/modules/user/user.service.js +14 -18
- package/dist/modules/user/user.service.js.map +1 -1
- package/dist/modules/view/view.controller.js +19 -20
- package/dist/modules/view/view.controller.js.map +1 -1
- package/dist/modules/view/view.entity.js +24 -24
- package/dist/modules/view/view.entity.js.map +1 -1
- package/dist/modules/view/view.module.js +1 -1
- package/dist/modules/view/view.module.js.map +1 -1
- package/dist/modules/view/view.service.js +4 -4
- package/dist/modules/view/view.service.js.map +1 -1
- package/dist/public/favicon.png +0 -0
- package/dist/starter.d.ts +1 -3
- package/dist/starter.js +14 -202
- package/dist/starter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +15957 -1
- package/dist/utils/date.util.js +1 -1
- package/dist/utils/date.util.js.map +1 -1
- package/dist/utils/markdown.util.js +1 -1
- package/dist/utils/markdown.util.js.map +1 -1
- package/dist/utils/oss/aliyun-oss-client.d.ts +1 -3
- package/dist/utils/oss/aliyun-oss-client.js +0 -5
- package/dist/utils/oss/aliyun-oss-client.js.map +1 -1
- package/dist/utils/oss/oss-client.d.ts +1 -3
- package/dist/utils/oss/oss-client.js.map +1 -1
- package/dist/utils/oss.util.d.ts +1 -3
- package/dist/utils/oss.util.js +1 -6
- package/dist/utils/oss.util.js.map +1 -1
- package/dist/utils/uniqueid.util.js +1 -1
- package/dist/utils/uniqueid.util.js.map +1 -1
- package/dist/utils/upload.util.d.ts +2 -6
- package/dist/utils/upload.util.js +8 -23
- package/dist/utils/upload.util.js.map +1 -1
- package/dist/utils/user.util.d.ts +0 -1
- package/dist/utils/user.util.js +2 -6
- package/dist/utils/user.util.js.map +1 -1
- package/package.json +32 -36
- package/public/favicon.png +0 -0
- package/dist/common/api-messages.d.ts +0 -41
- package/dist/common/api-messages.js +0 -45
- package/dist/common/api-messages.js.map +0 -1
- package/dist/database/typeorm-options.d.ts +0 -3
- package/dist/database/typeorm-options.js +0 -71
- package/dist/database/typeorm-options.js.map +0 -1
- package/dist/modules/api-key/api-key.controller.d.ts +0 -14
- package/dist/modules/api-key/api-key.controller.js +0 -63
- package/dist/modules/api-key/api-key.controller.js.map +0 -1
- package/dist/modules/api-key/api-key.entity.d.ts +0 -11
- package/dist/modules/api-key/api-key.entity.js +0 -63
- package/dist/modules/api-key/api-key.entity.js.map +0 -1
- package/dist/modules/api-key/api-key.guard.d.ts +0 -7
- package/dist/modules/api-key/api-key.guard.js +0 -39
- package/dist/modules/api-key/api-key.guard.js.map +0 -1
- package/dist/modules/api-key/api-key.module.d.ts +0 -2
- package/dist/modules/api-key/api-key.module.js +0 -28
- package/dist/modules/api-key/api-key.module.js.map +0 -1
- package/dist/modules/api-key/api-key.service.d.ts +0 -15
- package/dist/modules/api-key/api-key.service.js +0 -81
- package/dist/modules/api-key/api-key.service.js.map +0 -1
- package/dist/modules/article/article-revision.entity.d.ts +0 -11
- package/dist/modules/article/article-revision.entity.js +0 -53
- package/dist/modules/article/article-revision.entity.js.map +0 -1
- package/dist/modules/article/article-slug.util.d.ts +0 -2
- package/dist/modules/article/article-slug.util.js +0 -19
- package/dist/modules/article/article-slug.util.js.map +0 -1
- package/dist/modules/article/scheduled-publish.service.d.ts +0 -13
- package/dist/modules/article/scheduled-publish.service.js +0 -65
- package/dist/modules/article/scheduled-publish.service.js.map +0 -1
- package/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
- package/dist/modules/bootstrap/bootstrap.constants.js +0 -171
- package/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
- package/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
- package/dist/modules/bootstrap/bootstrap.service.js +0 -183
- package/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
- package/dist/modules/bootstrap/install-locale.d.ts +0 -2
- package/dist/modules/bootstrap/install-locale.js +0 -11
- package/dist/modules/bootstrap/install-locale.js.map +0 -1
- package/dist/modules/extension/extension.module.d.ts +0 -9
- package/dist/modules/extension/extension.module.js +0 -52
- package/dist/modules/extension/extension.module.js.map +0 -1
- package/dist/modules/extension/plugin-loader.service.d.ts +0 -12
- package/dist/modules/extension/plugin-loader.service.js +0 -96
- package/dist/modules/extension/plugin-loader.service.js.map +0 -1
- package/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
- package/dist/modules/extension/plugin-registry.bridge.js +0 -44
- package/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
- package/dist/modules/extension/plugin.controller.d.ts +0 -22
- package/dist/modules/extension/plugin.controller.js +0 -155
- package/dist/modules/extension/plugin.controller.js.map +0 -1
- package/dist/modules/extension/plugin.service.d.ts +0 -54
- package/dist/modules/extension/plugin.service.js +0 -414
- package/dist/modules/extension/plugin.service.js.map +0 -1
- package/dist/modules/extension/preview-draft.store.d.ts +0 -13
- package/dist/modules/extension/preview-draft.store.js +0 -41
- package/dist/modules/extension/preview-draft.store.js.map +0 -1
- package/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
- package/dist/modules/extension/theme-registry.bridge.js +0 -68
- package/dist/modules/extension/theme-registry.bridge.js.map +0 -1
- package/dist/modules/extension/theme.controller.d.ts +0 -66
- package/dist/modules/extension/theme.controller.js +0 -301
- package/dist/modules/extension/theme.controller.js.map +0 -1
- package/dist/modules/extension/theme.service.d.ts +0 -140
- package/dist/modules/extension/theme.service.js +0 -1039
- package/dist/modules/extension/theme.service.js.map +0 -1
- package/dist/modules/file/content-image-scan.util.d.ts +0 -52
- package/dist/modules/file/content-image-scan.util.js +0 -222
- package/dist/modules/file/content-image-scan.util.js.map +0 -1
- package/dist/modules/file/file-optimization.controller.d.ts +0 -12
- package/dist/modules/file/file-optimization.controller.js +0 -79
- package/dist/modules/file/file-optimization.controller.js.map +0 -1
- package/dist/modules/file/file-optimization.service.d.ts +0 -36
- package/dist/modules/file/file-optimization.service.js +0 -387
- package/dist/modules/file/file-optimization.service.js.map +0 -1
- package/dist/modules/file/file-optimization.types.d.ts +0 -66
- package/dist/modules/file/file-optimization.types.js +0 -5
- package/dist/modules/file/file-optimization.types.js.map +0 -1
- package/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
- package/dist/modules/file/image-optimizer-plugin.guard.js +0 -33
- package/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
- package/dist/modules/health/health.controller.d.ts +0 -11
- package/dist/modules/health/health.controller.js +0 -55
- package/dist/modules/health/health.controller.js.map +0 -1
- package/dist/modules/health/health.module.d.ts +0 -2
- package/dist/modules/health/health.module.js +0 -20
- package/dist/modules/health/health.module.js.map +0 -1
- package/dist/modules/hook/hook.module.d.ts +0 -2
- package/dist/modules/hook/hook.module.js +0 -22
- package/dist/modules/hook/hook.module.js.map +0 -1
- package/dist/modules/hook/hook.service.d.ts +0 -26
- package/dist/modules/hook/hook.service.js +0 -105
- package/dist/modules/hook/hook.service.js.map +0 -1
- package/dist/modules/webhook/webhook.controller.d.ts +0 -12
- package/dist/modules/webhook/webhook.controller.js +0 -63
- package/dist/modules/webhook/webhook.controller.js.map +0 -1
- package/dist/modules/webhook/webhook.entity.d.ts +0 -9
- package/dist/modules/webhook/webhook.entity.js +0 -54
- package/dist/modules/webhook/webhook.entity.js.map +0 -1
- package/dist/modules/webhook/webhook.module.d.ts +0 -2
- package/dist/modules/webhook/webhook.module.js +0 -27
- package/dist/modules/webhook/webhook.module.js.map +0 -1
- package/dist/modules/webhook/webhook.service.d.ts +0 -16
- package/dist/modules/webhook/webhook.service.js +0 -100
- package/dist/modules/webhook/webhook.service.js.map +0 -1
- package/dist/node-polyfills.d.ts +0 -18
- package/dist/node-polyfills.js +0 -24
- package/dist/node-polyfills.js.map +0 -1
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16.png +0 -0
- package/dist/public/favicon-32.png +0 -0
- package/dist/public/favicon-48.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/icon-192.png +0 -0
- package/dist/public/icon-512.png +0 -0
- package/dist/public/logo-200.png +0 -0
- package/dist/public/logo-400.png +0 -0
- package/dist/public/logo.png +0 -0
- package/dist/public/logo.svg +0 -7
- package/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utils/html-sanitize.util.d.ts +0 -1
- package/dist/utils/html-sanitize.util.js +0 -33
- package/dist/utils/html-sanitize.util.js.map +0 -1
- package/dist/utils/image-processor.util.d.ts +0 -23
- package/dist/utils/image-processor.util.js +0 -88
- package/dist/utils/image-processor.util.js.map +0 -1
- package/dist/utils/local-api-quiet.util.d.ts +0 -1
- package/dist/utils/local-api-quiet.util.js +0 -8
- package/dist/utils/local-api-quiet.util.js.map +0 -1
- package/dist/utils/project-root.util.d.ts +0 -2
- package/dist/utils/project-root.util.js +0 -42
- package/dist/utils/project-root.util.js.map +0 -1
- package/dist/utils/query-whitelist.util.d.ts +0 -1
- package/dist/utils/query-whitelist.util.js +0 -100
- package/dist/utils/query-whitelist.util.js.map +0 -1
- package/dist/utils/theme-placeholder-cover.d.ts +0 -7
- package/dist/utils/theme-placeholder-cover.js +0 -94
- package/dist/utils/theme-placeholder-cover.js.map +0 -1
- package/dist/utils/upload-url.util.d.ts +0 -4
- package/dist/utils/upload-url.util.js +0 -34
- package/dist/utils/upload-url.util.js.map +0 -1
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16.png +0 -0
- package/public/favicon-32.png +0 -0
- package/public/favicon-48.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/logo-200.png +0 -0
- package/public/logo-400.png +0 -0
- package/public/logo.png +0 -0
- package/public/logo.svg +0 -7
- package/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
- package/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
- package/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
package/README.md
CHANGED
|
@@ -1,105 +1,374 @@
|
|
|
1
|
+
> **Official hubs** (package name unchanged)
|
|
2
|
+
>
|
|
3
|
+
> - Site / docs: https://www.reactpress.cc/
|
|
4
|
+
> - Source: https://github.com/reactpressjs/reactpress
|
|
5
|
+
>
|
|
6
|
+
> Install: `npm i -g @fecommunity/reactpress`
|
|
7
|
+
|
|
1
8
|
# @fecommunity/reactpress-server
|
|
2
9
|
|
|
3
|
-
|
|
10
|
+
ReactPress Server - Enterprise-grade NestJS 10 backend API for ReactPress CMS with WordPress-style 5-minute installation.
|
|
4
11
|
|
|
5
|
-
[](https://www.npmjs.com/package/@fecommunity/reactpress-server)
|
|
13
|
+
[](https://github.com/fecommunity/reactpress/blob/master/server/LICENSE)
|
|
14
|
+
[](https://nodejs.org)
|
|
15
|
+
[](http://www.typescriptlang.org/)
|
|
16
|
+
[](https://nestjs.com/)
|
|
8
17
|
|
|
9
|
-
|
|
18
|
+
## Overview
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
ReactPress Server is an enterprise-grade, production-ready backend API built with NestJS 10 that powers the ReactPress CMS platform. It provides a comprehensive set of RESTful APIs for content management, user authentication, media handling, and more. With its WordPress-style 5-minute installation, it offers an incredibly smooth setup experience.
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
| :----------- | :----- |
|
|
15
|
-
| **Content** | Articles, pages, media, comments, search, site settings |
|
|
16
|
-
| **Extensibility** | Plugin hook runtime and theme catalog (ReactPress 4.0) |
|
|
17
|
-
| **API** | Headless REST with JWT auth, rate limiting, Swagger/OpenAPI |
|
|
18
|
-
| **Database** | MySQL (production) or SQLite (local / desktop) |
|
|
22
|
+
The server is built with a modular architecture following NestJS best practices, making it highly extensible and maintainable. It automatically generates OpenAPI/Swagger documentation that powers the [ReactPress Toolkit](../toolkit), ensuring seamless frontend-backend integration.
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
## Quick Start
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
### Installation & Setup
|
|
23
27
|
|
|
24
28
|
```bash
|
|
29
|
+
# Regular startup
|
|
25
30
|
npx @fecommunity/reactpress-server
|
|
26
|
-
|
|
31
|
+
|
|
32
|
+
# PM2 startup for production
|
|
27
33
|
npx @fecommunity/reactpress-server --pm2
|
|
28
34
|
```
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
That's it! The command will automatically:
|
|
37
|
+
|
|
38
|
+
1. **Auto-detect** if configuration exists
|
|
39
|
+
2. **Launch installation wizard** in your browser if no configuration found
|
|
40
|
+
3. **Start the server** immediately after installation
|
|
41
|
+
4. **Open API documentation** at `http://localhost:3002/api`
|
|
31
42
|
|
|
32
|
-
## Features
|
|
43
|
+
## Enterprise Features
|
|
33
44
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
45
|
+
- 🚀 **Zero-Command Installation** - No complex CLI parameters needed
|
|
46
|
+
- 🌍 **WordPress-Style Setup** - Familiar 5-minute installation process
|
|
47
|
+
- 🔧 **Auto-Configuration** - Generates `.env` files automatically
|
|
48
|
+
- 🔌 **Database Auto-Provisioning** - Creates MySQL database with migrations
|
|
49
|
+
- 🎯 **Seamless Flow** - From installation to running server in minutes
|
|
50
|
+
- 📖 **Auto-Documentation** - Swagger API docs available immediately
|
|
51
|
+
- ⚡ **PM2 Support** - Optional PM2 process management for production
|
|
52
|
+
- 🔐 **Enterprise Security** - JWT with refresh token rotation, rate limiting
|
|
53
|
+
- 🛡️ **Advanced Security** - Helmet.js, CSRF protection, input validation
|
|
54
|
+
- 📱 **Responsive APIs** - Mobile-friendly RESTful endpoints
|
|
55
|
+
- 🌐 **Globalization** - Multi-language support with RTL
|
|
56
|
+
- 📊 **Analytics Tracking** - Built-in view and visitor analytics
|
|
57
|
+
- 🔄 **Data Synchronization** - Scheduled tasks and webhook support
|
|
39
58
|
|
|
40
59
|
## Requirements
|
|
41
60
|
|
|
42
|
-
- Node.js >= 20
|
|
43
|
-
- MySQL 8.0+
|
|
44
|
-
- npm or pnpm
|
|
61
|
+
- Node.js >= 18.20.4
|
|
62
|
+
- MySQL 8.0+ or PostgreSQL 13+
|
|
63
|
+
- npm or pnpm package manager
|
|
64
|
+
|
|
65
|
+
## Usage Scenarios
|
|
66
|
+
|
|
67
|
+
### Standalone API Server
|
|
68
|
+
Perfect for:
|
|
69
|
+
- Headless CMS implementation
|
|
70
|
+
- Mobile app backend
|
|
71
|
+
- Microservices architecture
|
|
72
|
+
- Custom frontend integration
|
|
73
|
+
- Enterprise API gateway
|
|
74
|
+
|
|
75
|
+
### Full ReactPress Stack
|
|
76
|
+
Use with ReactPress client for complete CMS solution:
|
|
77
|
+
```bash
|
|
78
|
+
# Start server
|
|
79
|
+
npx @fecommunity/reactpress-server
|
|
80
|
+
|
|
81
|
+
# In another terminal, start client
|
|
82
|
+
npx @fecommunity/reactpress-client
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## API Modules
|
|
86
|
+
|
|
87
|
+
ReactPress Server provides comprehensive enterprise API modules:
|
|
88
|
+
|
|
89
|
+
- **Article Management** - Create, read, update, delete articles with versioning
|
|
90
|
+
- **User Authentication** - Registration, login, password management, 2FA
|
|
91
|
+
- **Comment System** - Comment moderation and management with spam detection
|
|
92
|
+
- **Media Management** - File upload and management (local/S3/Cloudinary)
|
|
93
|
+
- **Category & Tag** - Content organization systems with hierarchy
|
|
94
|
+
- **Page Management** - Custom page creation with templates
|
|
95
|
+
- **Settings** - System configuration management with environment overrides
|
|
96
|
+
- **SMTP** - Email sending capabilities with template system
|
|
97
|
+
- **Search** - Full-text search functionality with Elasticsearch integration
|
|
98
|
+
- **Analytics** - Visitor and view tracking with export capabilities
|
|
99
|
+
- **Webhooks** - Event-driven integrations with external services
|
|
100
|
+
- **Scheduled Tasks** - Cron jobs for automated operations
|
|
101
|
+
|
|
102
|
+
## PM2 Support
|
|
103
|
+
|
|
104
|
+
ReactPress server supports PM2 process management for production deployments:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Start with PM2
|
|
108
|
+
npx @fecommunity/reactpress-server --pm2
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
PM2 features:
|
|
112
|
+
- Automatic process restart on crash
|
|
113
|
+
- Memory monitoring and alerts
|
|
114
|
+
- Log management with rotation
|
|
115
|
+
- Cluster mode support for horizontal scaling
|
|
116
|
+
- Process monitoring dashboard with health checks
|
|
117
|
+
|
|
118
|
+
## Configuration
|
|
119
|
+
|
|
120
|
+
The installation wizard will create a `.env` file with:
|
|
121
|
+
|
|
122
|
+
```env
|
|
123
|
+
# Database Configuration (Production)
|
|
124
|
+
DB_HOST=prod-db.cluster-xyz.amazonaws.com
|
|
125
|
+
DB_PORT=3306
|
|
126
|
+
DB_USER=reactpress_user
|
|
127
|
+
DB_PASSWD=secure_password_here
|
|
128
|
+
DB_DATABASE=reactpress_prod
|
|
129
|
+
DB_SSL=true
|
|
130
|
+
|
|
131
|
+
# Site URLs (Production)
|
|
132
|
+
CLIENT_SITE_URL=https://yourdomain.com
|
|
133
|
+
SERVER_SITE_URL=https://api.yourdomain.com
|
|
134
|
+
|
|
135
|
+
# Security Settings (Production)
|
|
136
|
+
JWT_SECRET=your-very-secure-jwt-secret-here
|
|
137
|
+
JWT_EXPIRES_IN=24h
|
|
138
|
+
JWT_REFRESH_EXPIRES_IN=7d
|
|
139
|
+
|
|
140
|
+
# SMTP Configuration (Production)
|
|
141
|
+
SMTP_HOST=email-smtp.us-east-1.amazonaws.com
|
|
142
|
+
SMTP_PORT=587
|
|
143
|
+
SMTP_USER=your_smtp_username
|
|
144
|
+
SMTP_PASS=your_smtp_password
|
|
145
|
+
SMTP_FROM=noreply@yourdomain.com
|
|
146
|
+
|
|
147
|
+
# Cloud Storage (Optional)
|
|
148
|
+
S3_ACCESS_KEY_ID=your_aws_access_key
|
|
149
|
+
S3_SECRET_ACCESS_KEY=your_aws_secret_key
|
|
150
|
+
S3_BUCKET_NAME=your_bucket_name
|
|
151
|
+
S3_REGION=us-east-1
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## API Documentation
|
|
155
|
+
|
|
156
|
+
Once running, visit `http://localhost:3002/api` for:
|
|
157
|
+
- Interactive Swagger documentation
|
|
158
|
+
- API endpoint explorer
|
|
159
|
+
- Authentication examples
|
|
160
|
+
- Response schemas
|
|
161
|
+
- Request/response validation
|
|
162
|
+
- Code generation for multiple languages
|
|
45
163
|
|
|
46
164
|
## Development
|
|
47
165
|
|
|
48
166
|
```bash
|
|
167
|
+
# Clone repository
|
|
49
168
|
git clone https://github.com/fecommunity/reactpress.git
|
|
50
|
-
cd reactpress
|
|
169
|
+
cd reactpress/server
|
|
170
|
+
|
|
171
|
+
# Install dependencies
|
|
51
172
|
pnpm install
|
|
52
|
-
pnpm run --dir server dev
|
|
53
|
-
```
|
|
54
173
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
174
|
+
# Start development server with hot reload
|
|
175
|
+
pnpm run dev
|
|
176
|
+
|
|
177
|
+
# Start with PM2 (development)
|
|
178
|
+
pnpm run pm2:start
|
|
179
|
+
|
|
180
|
+
# Build for production
|
|
181
|
+
pnpm run build
|
|
182
|
+
|
|
183
|
+
# Run tests
|
|
184
|
+
pnpm run test
|
|
61
185
|
|
|
62
|
-
|
|
186
|
+
# Run tests with coverage
|
|
187
|
+
pnpm run test:cov
|
|
188
|
+
|
|
189
|
+
# Run end-to-end tests
|
|
190
|
+
pnpm run test:e2e
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Project Structure
|
|
63
194
|
|
|
64
195
|
```
|
|
65
196
|
server/
|
|
66
|
-
├── src/
|
|
67
|
-
├──
|
|
68
|
-
├──
|
|
69
|
-
|
|
197
|
+
├── src/
|
|
198
|
+
│ ├── modules/ # Feature modules
|
|
199
|
+
│ │ ├── article/ # Article management
|
|
200
|
+
│ │ ├── auth/ # Authentication
|
|
201
|
+
│ │ ├── user/ # User management
|
|
202
|
+
│ │ └── ... # Other modules
|
|
203
|
+
│ ├── common/ # Shared utilities and decorators
|
|
204
|
+
│ ├── filters/ # Exception filters
|
|
205
|
+
│ ├── interceptors/ # Request/response interceptors
|
|
206
|
+
│ ├── guards/ # Authentication guards
|
|
207
|
+
│ ├── pipes/ # Data transformation pipes
|
|
208
|
+
│ ├── logger/ # Logging utilities
|
|
209
|
+
│ └── utils/ # Utility functions
|
|
210
|
+
├── public/ # Static assets
|
|
211
|
+
│ └── swagger/ # Swagger documentation
|
|
212
|
+
├── dist/ # Compiled output
|
|
213
|
+
└── bin/ # CLI entry points
|
|
70
214
|
```
|
|
71
215
|
|
|
72
|
-
##
|
|
73
|
-
|
|
74
|
-
The install wizard generates `.env`. Key variables:
|
|
216
|
+
## Environment Variables
|
|
75
217
|
|
|
76
218
|
| Variable | Description | Default |
|
|
77
|
-
|
|
219
|
+
|----------|-------------|---------|
|
|
78
220
|
| `DB_HOST` | Database host | `127.0.0.1` |
|
|
79
221
|
| `DB_PORT` | Database port | `3306` |
|
|
222
|
+
| `DB_USER` | Database username | - |
|
|
223
|
+
| `DB_PASSWD` | Database password | - |
|
|
80
224
|
| `DB_DATABASE` | Database name | `reactpress` |
|
|
81
|
-
| `SERVER_PORT` |
|
|
82
|
-
| `JWT_SECRET` | JWT
|
|
83
|
-
| `CLIENT_SITE_URL` |
|
|
225
|
+
| `SERVER_PORT` | Server port | `3002` |
|
|
226
|
+
| `JWT_SECRET` | JWT secret key | - |
|
|
227
|
+
| `CLIENT_SITE_URL` | Client site URL | `http://localhost:3001` |
|
|
228
|
+
| `SERVER_SITE_URL` | Server site URL | `http://localhost:3002` |
|
|
229
|
+
| `SMTP_HOST` | SMTP server host | - |
|
|
230
|
+
| `SMTP_PORT` | SMTP server port | - |
|
|
231
|
+
| `SMTP_USER` | SMTP username | - |
|
|
232
|
+
| `SMTP_PASS` | SMTP password | - |
|
|
84
233
|
|
|
85
|
-
##
|
|
234
|
+
## CLI Commands
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Show help
|
|
238
|
+
npx @fecommunity/reactpress-server --help
|
|
239
|
+
|
|
240
|
+
# Start server
|
|
241
|
+
npx @fecommunity/reactpress-server
|
|
242
|
+
|
|
243
|
+
# Start with PM2
|
|
244
|
+
npx @fecommunity/reactpress-server --pm2
|
|
245
|
+
|
|
246
|
+
# Specify port
|
|
247
|
+
npx @fecommunity/reactpress-server --port 3002
|
|
248
|
+
|
|
249
|
+
# Enable verbose logging
|
|
250
|
+
npx @fecommunity/reactpress-server --verbose
|
|
251
|
+
|
|
252
|
+
# Run database migrations
|
|
253
|
+
npx @fecommunity/reactpress-server --migrate
|
|
254
|
+
|
|
255
|
+
# Seed database with sample data
|
|
256
|
+
npx @fecommunity/reactpress-server --seed
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Integration with ReactPress Toolkit
|
|
260
|
+
|
|
261
|
+
The server automatically generates the OpenAPI specification that powers the ReactPress Toolkit:
|
|
86
262
|
|
|
87
263
|
```typescript
|
|
88
|
-
|
|
264
|
+
// The toolkit is automatically generated from this server's API
|
|
265
|
+
import { api, types } from '@fecommunity/reactpress-toolkit';
|
|
266
|
+
|
|
267
|
+
// All API endpoints are strongly typed
|
|
268
|
+
const articles: types.IArticle[] = await api.article.findAll();
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Database Schema
|
|
272
|
+
|
|
273
|
+
ReactPress uses MySQL/PostgreSQL with the following key tables:
|
|
274
|
+
- `users` - User accounts and profiles with 2FA support
|
|
275
|
+
- `articles` - Blog posts and content with versioning
|
|
276
|
+
- `categories` - Content categorization with hierarchy
|
|
277
|
+
- `tags` - Content tagging system
|
|
278
|
+
- `comments` - Reader comments and discussions with moderation
|
|
279
|
+
- `files` - Media file management with cloud storage
|
|
280
|
+
- `settings` - System configuration with environment overrides
|
|
281
|
+
- `views` - Analytics and tracking
|
|
282
|
+
- `webhooks` - Event-driven integrations
|
|
283
|
+
- `scheduled_tasks` - Automated operations
|
|
284
|
+
|
|
285
|
+
## Security Features
|
|
286
|
+
|
|
287
|
+
- **JWT Authentication** - Secure token-based authentication with refresh rotation
|
|
288
|
+
- **Rate Limiting** - Adaptive throttling to prevent abuse
|
|
289
|
+
- **Input Validation** - Sanitize all user inputs with Zod schema validation
|
|
290
|
+
- **Helmet.js** - Secure HTTP headers
|
|
291
|
+
- **CSRF Protection** - Prevent cross-site request forgery
|
|
292
|
+
- **SQL Injection Prevention** - Through TypeORM parameterized queries
|
|
293
|
+
- **CORS Configuration** - Controlled cross-origin resource sharing
|
|
294
|
+
- **Data Encryption** - At-rest encryption for sensitive data
|
|
295
|
+
- **Audit Logging** - Comprehensive activity tracking
|
|
296
|
+
|
|
297
|
+
## Performance Optimization
|
|
89
298
|
|
|
90
|
-
|
|
299
|
+
- **Database Indexing** - Optimized queries with proper indexing
|
|
300
|
+
- **Connection Pooling** - Efficient database connection management
|
|
301
|
+
- **Caching** - Redis integration for frequently accessed data
|
|
302
|
+
- **Compression** - Gzip compression for API responses
|
|
303
|
+
- **Pagination** - Efficient data retrieval for large datasets
|
|
304
|
+
- **Query Optimization** - TypeORM query builder for complex operations
|
|
305
|
+
- **Background Jobs** - Queue system for long-running tasks
|
|
306
|
+
|
|
307
|
+
## Testing
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Run unit tests
|
|
311
|
+
pnpm run test
|
|
312
|
+
|
|
313
|
+
# Run integration tests
|
|
314
|
+
pnpm run test:integration
|
|
315
|
+
|
|
316
|
+
# Run end-to-end tests
|
|
317
|
+
pnpm run test:e2e
|
|
318
|
+
|
|
319
|
+
# Run tests with coverage
|
|
320
|
+
pnpm run test:cov
|
|
321
|
+
|
|
322
|
+
# Run linting
|
|
323
|
+
pnpm run lint
|
|
324
|
+
|
|
325
|
+
# Run formatting
|
|
326
|
+
pnpm run format
|
|
327
|
+
|
|
328
|
+
# Run type checking
|
|
329
|
+
pnpm run type-check
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## Deployment
|
|
333
|
+
|
|
334
|
+
### Production Deployment with PM2
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
# Start server with PM2
|
|
338
|
+
npx @fecommunity/reactpress-server --pm2
|
|
339
|
+
|
|
340
|
+
# Or build and start manually
|
|
341
|
+
pnpm run build
|
|
342
|
+
pnpm run start:prod
|
|
91
343
|
```
|
|
92
344
|
|
|
93
|
-
|
|
345
|
+
## Monitoring & Logging
|
|
346
|
+
|
|
347
|
+
- **Structured Logging** - JSON-formatted logs for easy parsing
|
|
348
|
+
- **Error Tracking** - Comprehensive error reporting with context
|
|
349
|
+
- **Performance Metrics** - Response time and throughput monitoring
|
|
350
|
+
- **Health Checks** - API endpoint for service status
|
|
351
|
+
- **Alerting** - Integration with monitoring systems (Prometheus, Grafana)
|
|
352
|
+
|
|
353
|
+
## Support
|
|
94
354
|
|
|
95
|
-
|
|
355
|
+
- 📖 [Documentation](https://github.com/fecommunity/reactpress)
|
|
356
|
+
- 🐛 [Issues](https://github.com/fecommunity/reactpress/issues)
|
|
357
|
+
- 💬 [Discussions](https://github.com/fecommunity/reactpress/discussions)
|
|
358
|
+
- 📧 [Enterprise Support](mailto:enterprise@reactpress.dev)
|
|
96
359
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
360
|
+
## Contributing
|
|
361
|
+
|
|
362
|
+
1. Fork the repository
|
|
363
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
364
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
365
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
366
|
+
5. Open a pull request
|
|
100
367
|
|
|
101
368
|
## License
|
|
102
369
|
|
|
103
|
-
MIT
|
|
370
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
371
|
+
|
|
372
|
+
---
|
|
104
373
|
|
|
105
|
-
|
|
374
|
+
Built with ❤️ by [FECommunity](https://github.com/fecommunity)
|
package/bin/reactpress-server.js
CHANGED
|
@@ -26,16 +26,16 @@ if (showHelp) {
|
|
|
26
26
|
ReactPress Server - NestJS-based backend API for ReactPress CMS
|
|
27
27
|
|
|
28
28
|
Usage:
|
|
29
|
-
reactpress-server [options]
|
|
30
|
-
(通常由 reactpress-cli start 调用)
|
|
29
|
+
npx @fecommunity/reactpress-server [options]
|
|
31
30
|
|
|
32
31
|
Options:
|
|
33
32
|
--pm2 Start server with PM2 process manager
|
|
34
33
|
--help, -h Show this help message
|
|
35
34
|
|
|
36
35
|
Examples:
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
npx @fecommunity/reactpress-server # Start server normally
|
|
37
|
+
npx @fecommunity/reactpress-server --pm2 # Start server with PM2
|
|
38
|
+
npx @fecommunity/reactpress-server --help # Show this help message
|
|
39
39
|
`);
|
|
40
40
|
process.exit(0);
|
|
41
41
|
}
|
|
@@ -154,22 +154,6 @@ function startWithPM2() {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
// Function to prepend bundled runtime paths so sibling toolkit/ can resolve server/node_modules.
|
|
158
|
-
function prependNodePath(...dirs) {
|
|
159
|
-
const Module = require('module');
|
|
160
|
-
const sep = path.delimiter;
|
|
161
|
-
const parts = (process.env.NODE_PATH || '').split(sep).filter(Boolean);
|
|
162
|
-
for (const dir of dirs) {
|
|
163
|
-
if (fs.existsSync(dir) && !parts.includes(dir)) {
|
|
164
|
-
parts.unshift(dir);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
if (parts.length) {
|
|
168
|
-
process.env.NODE_PATH = parts.join(sep);
|
|
169
|
-
Module._initPaths();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
157
|
// Function to start with regular Node.js
|
|
174
158
|
function startWithNode() {
|
|
175
159
|
// Check if the server is built
|
|
@@ -196,43 +180,15 @@ function startWithNode() {
|
|
|
196
180
|
console.log(`[ReactPress Server] Using existing REACTPRESS_ORIGINAL_CWD: ${process.env.REACTPRESS_ORIGINAL_CWD}`);
|
|
197
181
|
}
|
|
198
182
|
|
|
199
|
-
const siteRoot = process.env.REACTPRESS_ORIGINAL_CWD;
|
|
200
|
-
for (const localSiteModule of [
|
|
201
|
-
path.join(serverDir, '..', 'cli', 'out', 'core', 'services', 'local-site.js'),
|
|
202
|
-
path.join(serverDir, '..', 'out', 'core', 'services', 'local-site.js'),
|
|
203
|
-
]) {
|
|
204
|
-
if (!siteRoot || !fs.existsSync(localSiteModule)) continue;
|
|
205
|
-
try {
|
|
206
|
-
const { ensureBundledPlugins } = require(localSiteModule);
|
|
207
|
-
if (ensureBundledPlugins(siteRoot)) {
|
|
208
|
-
console.log('[ReactPress Server] Seeded bundled plugins into project');
|
|
209
|
-
}
|
|
210
|
-
} catch {
|
|
211
|
-
// ignore — plugins seeding is best-effort
|
|
212
|
-
}
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
183
|
// Change to the server directory
|
|
217
184
|
process.chdir(serverDir);
|
|
218
185
|
|
|
219
186
|
// Set environment variables
|
|
220
187
|
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
|
|
221
188
|
|
|
222
|
-
//
|
|
223
|
-
prependNodePath(path.join(serverDir, 'node_modules'));
|
|
224
|
-
|
|
225
|
-
// Import and run the server (require() alone does not invoke main — see dist/main.js)
|
|
189
|
+
// Import and run the server
|
|
226
190
|
try {
|
|
227
|
-
|
|
228
|
-
if (typeof mainModule.main !== 'function') {
|
|
229
|
-
console.error('[ReactPress Server] Server entry does not export main()');
|
|
230
|
-
process.exit(1);
|
|
231
|
-
}
|
|
232
|
-
mainModule.main().catch((error) => {
|
|
233
|
-
console.error('[ReactPress Server] Failed to start server:', error);
|
|
234
|
-
process.exit(1);
|
|
235
|
-
});
|
|
191
|
+
require(distPath);
|
|
236
192
|
} catch (error) {
|
|
237
193
|
console.error('[ReactPress Server] Failed to start server:', error);
|
|
238
194
|
process.exit(1);
|
package/dist/app.module.js
CHANGED
|
@@ -7,39 +7,56 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AppModule = void 0;
|
|
10
|
-
const
|
|
10
|
+
const reactpress_config_1 = require("@fecommunity/reactpress-config");
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
|
-
const
|
|
12
|
+
const config_1 = require("@nestjs/config");
|
|
13
13
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
14
|
-
const
|
|
15
|
-
const api_key_module_1 = require("./modules/api-key/api-key.module");
|
|
14
|
+
const article_entity_1 = require("./modules/article/article.entity");
|
|
16
15
|
const article_module_1 = require("./modules/article/article.module");
|
|
17
16
|
const auth_module_1 = require("./modules/auth/auth.module");
|
|
17
|
+
const category_entity_1 = require("./modules/category/category.entity");
|
|
18
18
|
const category_module_1 = require("./modules/category/category.module");
|
|
19
|
+
const comment_entity_1 = require("./modules/comment/comment.entity");
|
|
19
20
|
const comment_module_1 = require("./modules/comment/comment.module");
|
|
20
|
-
const
|
|
21
|
+
const file_entity_1 = require("./modules/file/file.entity");
|
|
21
22
|
const file_module_1 = require("./modules/file/file.module");
|
|
22
|
-
const
|
|
23
|
-
const hook_module_1 = require("./modules/hook/hook.module");
|
|
23
|
+
const knowledge_entity_1 = require("./modules/knowledge/knowledge.entity");
|
|
24
24
|
const knowledge_module_1 = require("./modules/knowledge/knowledge.module");
|
|
25
|
+
const page_entity_1 = require("./modules/page/page.entity");
|
|
25
26
|
const page_module_1 = require("./modules/page/page.module");
|
|
27
|
+
const search_entity_1 = require("./modules/search/search.entity");
|
|
26
28
|
const search_module_1 = require("./modules/search/search.module");
|
|
29
|
+
const setting_entity_1 = require("./modules/setting/setting.entity");
|
|
27
30
|
const setting_module_1 = require("./modules/setting/setting.module");
|
|
31
|
+
const smtp_entity_1 = require("./modules/smtp/smtp.entity");
|
|
28
32
|
const smtp_module_1 = require("./modules/smtp/smtp.module");
|
|
33
|
+
const tag_entity_1 = require("./modules/tag/tag.entity");
|
|
29
34
|
const tag_module_1 = require("./modules/tag/tag.module");
|
|
35
|
+
const user_entity_1 = require("./modules/user/user.entity");
|
|
30
36
|
const user_module_1 = require("./modules/user/user.module");
|
|
37
|
+
const view_entity_1 = require("./modules/view/view.entity");
|
|
31
38
|
const view_module_1 = require("./modules/view/view.module");
|
|
32
|
-
const webhook_module_1 = require("./modules/webhook/webhook.module");
|
|
33
39
|
let AppModule = class AppModule {
|
|
34
40
|
};
|
|
35
41
|
AppModule = __decorate([
|
|
36
|
-
|
|
42
|
+
common_1.Module({
|
|
37
43
|
imports: [
|
|
38
|
-
|
|
44
|
+
config_1.ConfigModule.forRoot({ isGlobal: true, envFilePath: [reactpress_config_1.file] }),
|
|
39
45
|
typeorm_1.TypeOrmModule.forRootAsync({
|
|
40
|
-
imports: [
|
|
41
|
-
inject: [
|
|
42
|
-
useFactory: async (configService) => (
|
|
46
|
+
imports: [config_1.ConfigModule],
|
|
47
|
+
inject: [config_1.ConfigService],
|
|
48
|
+
useFactory: async (configService) => ({
|
|
49
|
+
type: 'mysql',
|
|
50
|
+
entities: [user_entity_1.User, file_entity_1.File, knowledge_entity_1.Knowledge, article_entity_1.Article, category_entity_1.Category, tag_entity_1.Tag, comment_entity_1.Comment, setting_entity_1.Setting, smtp_entity_1.SMTP, page_entity_1.Page, view_entity_1.View, search_entity_1.Search],
|
|
51
|
+
host: configService.get('DB_HOST', '0.0.0.0'),
|
|
52
|
+
port: configService.get('DB_PORT', 3306),
|
|
53
|
+
username: configService.get('DB_USER', 'root'),
|
|
54
|
+
password: configService.get('DB_PASSWD', 'root'),
|
|
55
|
+
database: configService.get('DB_DATABASE', 'reactpress'),
|
|
56
|
+
charset: 'utf8mb4',
|
|
57
|
+
timezone: '+08:00',
|
|
58
|
+
synchronize: true,
|
|
59
|
+
}),
|
|
43
60
|
}),
|
|
44
61
|
user_module_1.UserModule,
|
|
45
62
|
file_module_1.FileModule,
|
|
@@ -54,11 +71,6 @@ AppModule = __decorate([
|
|
|
54
71
|
page_module_1.PageModule,
|
|
55
72
|
view_module_1.ViewModule,
|
|
56
73
|
search_module_1.SearchModule,
|
|
57
|
-
health_module_1.HealthModule,
|
|
58
|
-
hook_module_1.HookModule,
|
|
59
|
-
api_key_module_1.ApiKeyModule,
|
|
60
|
-
webhook_module_1.WebhookModule,
|
|
61
|
-
extension_module_1.ExtensionModule,
|
|
62
74
|
],
|
|
63
75
|
controllers: [],
|
|
64
76
|
providers: [],
|
package/dist/app.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,sEAAqE;AACrE,2CAAwC;AACxC,2CAA6D;AAC7D,6CAAgD;AAEhD,qEAA2D;AAE3D,qEAAiE;AAEjE,4DAAwD;AACxD,wEAA8D;AAE9D,wEAAoE;AACpE,qEAA2D;AAE3D,qEAAiE;AACjE,4DAAkD;AAElD,4DAAwD;AACxD,2EAAiE;AAEjE,2EAAuE;AACvE,4DAAkD;AAElD,4DAAwD;AAExD,kEAAwD;AACxD,kEAA8D;AAC9D,qEAA2D;AAE3D,qEAAiE;AACjE,4DAAkD;AAElD,4DAAwD;AACxD,yDAA+C;AAE/C,yDAAqD;AACrD,4DAAkD;AAElD,4DAAwD;AACxD,4DAAkD;AAElD,4DAAwD;AAsCxD,IAAa,SAAS,GAAtB,MAAa,SAAS;CAAG,CAAA;AAAZ,SAAS;IApCrB,eAAM,CAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,wBAAW,CAAC,EAAE,CAAC;YACpE,uBAAa,CAAC,YAAY,CAAC;gBACzB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACnD,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE,CAAC,kBAAI,EAAE,kBAAI,EAAE,4BAAS,EAAE,wBAAO,EAAE,0BAAQ,EAAE,gBAAG,EAAE,wBAAO,EAAE,wBAAO,EAAE,kBAAI,EAAE,kBAAI,EAAE,kBAAI,EAAE,sBAAM,CAAC;oBACrG,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC;oBAC7C,IAAI,EAAE,aAAa,CAAC,GAAG,CAAS,SAAS,EAAE,IAAI,CAAC;oBAChD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC;oBAC9C,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC;oBAChD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC;oBACxD,OAAO,EAAE,SAAS;oBAClB,QAAQ,EAAE,QAAQ;oBAClB,WAAW,EAAE,IAAI;iBAClB,CAAC;aACH,CAAC;YACF,wBAAU;YACV,wBAAU;YACV,sBAAS;YACT,8BAAa;YACb,kCAAe;YACf,gCAAc;YACd,8BAAa;YACb,8BAAa;YACb,wBAAU;YACV,wBAAU;YACV,wBAAU;YACV,wBAAU;YACV,4BAAY;SACb;QACD,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAAG;AAAZ,8BAAS"}
|
|
@@ -30,7 +30,7 @@ let HttpExceptionFilter = class HttpExceptionFilter {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
HttpExceptionFilter = __decorate([
|
|
33
|
-
|
|
33
|
+
common_1.Catch(common_1.HttpException)
|
|
34
34
|
], HttpExceptionFilter);
|
|
35
35
|
exports.HttpExceptionFilter = HttpExceptionFilter;
|
|
36
36
|
//# sourceMappingURL=http-exception.filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAkG;AAElG,sCAAwC;
|
|
1
|
+
{"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAkG;AAElG,sCAAwC;AAGxC,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC9B,KAAK,CAAC,SAAwB,EAAE,IAAmB;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC;QAChC,MAAM,MAAM,GAAG,SAAS,YAAY,sBAAa,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,mBAAU,CAAC,qBAAqB,CAAC;QAC7G,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC;QAC3D,MAAM,aAAa,GAAG;YACpB,UAAU,EAAE,MAAM;YAClB,GAAG;YACH,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,IAAI;SACX,CAAC;QAGF,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;QACnE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7B,oBAAW,CAAC,KAAK,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAtBY,mBAAmB;IAD/B,cAAK,CAAC,sBAAa,CAAC;GACR,mBAAmB,CAsB/B;AAtBY,kDAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|