@reldens/cms 0.84.0 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/api-reference.md +172 -171
- package/.claude/architecture-guide.md +28 -1
- package/.claude/configuration-guide.md +128 -126
- package/.claude/installation-guide.md +225 -225
- package/.claude/password-management-guide.md +2 -2
- package/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/bin/reldens-cms-generate-entities.js +19 -8
- package/bin/reldens-cms-update-password.js +16 -8
- package/bin/reldens-cms.js +145 -138
- package/install/index.html +132 -132
- package/lib/admin-manager/router-contents.js +854 -854
- package/lib/installer.js +673 -636
- package/lib/manager-config-loader.js +35 -33
- package/lib/manager-services-initializer.js +346 -323
- package/lib/manager.js +310 -306
- package/lib/mysql-installer.js +104 -104
- package/lib/prisma-subprocess-worker.js +9 -4
- package/package.json +4 -4
- package/templates/.env.dist +2 -0
- package/templates/index.js.dist +30 -30
|
@@ -1,126 +1,128 @@
|
|
|
1
|
-
# Configuration Guide
|
|
2
|
-
|
|
3
|
-
## Environment Variables
|
|
4
|
-
|
|
5
|
-
```env
|
|
6
|
-
RELDENS_APP_HOST=http://localhost
|
|
7
|
-
RELDENS_APP_PORT=8080
|
|
8
|
-
RELDENS_ADMIN_ROUTE_PATH=/admin
|
|
9
|
-
RELDENS_ADMIN_SECRET=your-secret-key
|
|
10
|
-
|
|
11
|
-
RELDENS_DB_CLIENT=mysql
|
|
12
|
-
RELDENS_DB_HOST=localhost
|
|
13
|
-
RELDENS_DB_PORT=3306
|
|
14
|
-
RELDENS_DB_NAME=cms_db
|
|
15
|
-
RELDENS_DB_USER=username
|
|
16
|
-
RELDENS_DB_PASSWORD=password
|
|
17
|
-
RELDENS_STORAGE_DRIVER=
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- `reloadTime:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
# Configuration Guide
|
|
2
|
+
|
|
3
|
+
## Environment Variables
|
|
4
|
+
|
|
5
|
+
```env
|
|
6
|
+
RELDENS_APP_HOST=http://localhost
|
|
7
|
+
RELDENS_APP_PORT=8080
|
|
8
|
+
RELDENS_ADMIN_ROUTE_PATH=/admin
|
|
9
|
+
RELDENS_ADMIN_SECRET=your-secret-key
|
|
10
|
+
|
|
11
|
+
RELDENS_DB_CLIENT=mysql
|
|
12
|
+
RELDENS_DB_HOST=localhost
|
|
13
|
+
RELDENS_DB_PORT=3306
|
|
14
|
+
RELDENS_DB_NAME=cms_db
|
|
15
|
+
RELDENS_DB_USER=username
|
|
16
|
+
RELDENS_DB_PASSWORD=password
|
|
17
|
+
RELDENS_STORAGE_DRIVER=mikro-orm
|
|
18
|
+
RELDENS_PRISMA_ADAPTER=@prisma/adapter-mariadb
|
|
19
|
+
RELDENS_PRISMA_ADAPTER_CLASS=PrismaMariaDb
|
|
20
|
+
|
|
21
|
+
RELDENS_DEFAULT_DOMAIN=example.com
|
|
22
|
+
RELDENS_DOMAIN_MAPPING={"dev.example.com":"development"}
|
|
23
|
+
RELDENS_SITE_KEY_MAPPING={"example.com":"main"}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Template Reloading Configuration
|
|
27
|
+
|
|
28
|
+
Configure template reloading for development environments:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
const cms = new Manager({
|
|
32
|
+
// Development: reload templates on every request when changes detected
|
|
33
|
+
reloadTime: -1,
|
|
34
|
+
|
|
35
|
+
// Production: disable template reloading (default)
|
|
36
|
+
reloadTime: 0,
|
|
37
|
+
|
|
38
|
+
// Interval-based: reload every 5 seconds when changes detected
|
|
39
|
+
reloadTime: 5000
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Template Reloading Options:**
|
|
44
|
+
|
|
45
|
+
- `reloadTime: 0` (default) - Template reloading disabled. Templates load once at startup.
|
|
46
|
+
- `reloadTime: -1` - Reload templates on every request when file changes are detected. Best for active development.
|
|
47
|
+
- `reloadTime: > 0` - Check for template changes at specified interval (milliseconds) and reload when needed. Good for development with lower overhead.
|
|
48
|
+
|
|
49
|
+
**How it works:**
|
|
50
|
+
|
|
51
|
+
- Tracks file modification times for admin and frontend templates
|
|
52
|
+
- Only reloads templates that have actually changed
|
|
53
|
+
- Automatically updates admin contents and frontend template cache
|
|
54
|
+
- Works with both admin panel templates and frontend templates/partials
|
|
55
|
+
- Zero performance impact when disabled (`reloadTime: 0`)
|
|
56
|
+
|
|
57
|
+
## Custom Entity Configuration
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
const entityConfig = {
|
|
61
|
+
articles: {
|
|
62
|
+
listProperties: ['title', 'status', 'created_at'],
|
|
63
|
+
showProperties: ['title', 'content', 'author', 'status'],
|
|
64
|
+
editProperties: ['title', 'content', 'author_id', 'status'],
|
|
65
|
+
filterProperties: ['status', 'author_id'],
|
|
66
|
+
titleProperty: 'title',
|
|
67
|
+
parentItemLabel: 'Content',
|
|
68
|
+
properties: {
|
|
69
|
+
title: { type: 'string', isRequired: true },
|
|
70
|
+
content: { type: 'text' },
|
|
71
|
+
author_id: { type: 'reference', reference: 'users' },
|
|
72
|
+
featured_image: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
isUpload: true,
|
|
75
|
+
allowedTypes: 'image',
|
|
76
|
+
bucket: 'uploads'
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const cms = new Manager({
|
|
83
|
+
entitiesConfig: entityConfig
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Manager Configuration Options
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
const cms = new Manager({
|
|
91
|
+
projectRoot: process.cwd(),
|
|
92
|
+
|
|
93
|
+
// Entity Access Control
|
|
94
|
+
entityAccess: {
|
|
95
|
+
cmsPages: { public: true, operations: ['read'] },
|
|
96
|
+
articles: { public: true, operations: ['read'] },
|
|
97
|
+
users: { public: false }
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Authentication
|
|
101
|
+
authenticationMethod: 'db-users',
|
|
102
|
+
adminRoleId: 99,
|
|
103
|
+
authenticationCallback: async (email, password, roleId) => {
|
|
104
|
+
return await yourAuthService.validate(email, password, roleId);
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
// Performance
|
|
108
|
+
cache: true,
|
|
109
|
+
reloadTime: 0,
|
|
110
|
+
|
|
111
|
+
// Multi-Domain
|
|
112
|
+
defaultDomain: 'example.com',
|
|
113
|
+
domainMapping: {'dev.example.com': 'development'},
|
|
114
|
+
siteKeyMapping: {'example.com': 'main'},
|
|
115
|
+
|
|
116
|
+
// Custom Entities
|
|
117
|
+
entitiesConfig: entityConfig,
|
|
118
|
+
entitiesTranslations: {},
|
|
119
|
+
adminTranslations: {},
|
|
120
|
+
|
|
121
|
+
// Optional Custom Services
|
|
122
|
+
app: customExpressApp,
|
|
123
|
+
appServer: customAppServer,
|
|
124
|
+
dataServer: customDataServer,
|
|
125
|
+
adminManager: customAdmin,
|
|
126
|
+
frontend: customFrontend
|
|
127
|
+
});
|
|
128
|
+
```
|