@openmfp/create-portal 0.1.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/LICENSE +201 -0
- package/README.md +78 -0
- package/package.json +39 -0
- package/src/generate-portal.js +110 -0
- package/src/scripts/backend/backend-generator.js +52 -0
- package/src/scripts/backend/templates/nest-cli.json +4 -0
- package/src/scripts/backend/templates/package.json +32 -0
- package/src/scripts/backend/templates/src/app.module.ts +22 -0
- package/src/scripts/backend/templates/src/main.ts +9 -0
- package/src/scripts/backend/templates/tsconfig.build.json +4 -0
- package/src/scripts/backend/templates/tsconfig.json +23 -0
- package/src/scripts/frontend/frontend-generator.js +132 -0
- package/src/scripts/frontend/templates/angular.json +97 -0
- package/src/scripts/frontend/templates/build-scripts/extract-versions.js +21 -0
- package/src/scripts/frontend/templates/package.json +43 -0
- package/src/scripts/frontend/templates/proxy.config.json +8 -0
- package/src/scripts/frontend/templates/src/app/app.routes.ts +3 -0
- package/src/scripts/frontend/templates/src/assets/.gitkeep +0 -0
- package/src/scripts/frontend/templates/src/environments/environment.prod.ts +3 -0
- package/src/scripts/frontend/templates/src/environments/environment.ts +3 -0
- package/src/scripts/frontend/templates/src/favicon.ico +0 -0
- package/src/scripts/frontend/templates/src/index.html +15 -0
- package/src/scripts/frontend/templates/src/main.ts +9 -0
- package/src/scripts/frontend/templates/src/styles.scss +1 -0
- package/src/scripts/frontend/templates/tsconfig.app.json +9 -0
- package/src/scripts/frontend/templates/tsconfig.json +29 -0
- package/src/scripts/root/root-generator.js +26 -0
- package/src/scripts/root/templates/README.md +49 -0
- package/src/scripts/root/templates/package.json +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @openmfp/create-portal
|
|
2
|
+
|
|
3
|
+
A CLI tool for scaffolding OpenMFP Portal projects with a full-stack setup.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`create-portal` is a project generator that creates a complete OpenMFP Portal application with:
|
|
8
|
+
|
|
9
|
+
- **Frontend**: Angular application with OpenMFP Portal UI library
|
|
10
|
+
- **Backend**: NestJS server with OpenMFP Portal server library
|
|
11
|
+
- Pre-configured build and development scripts
|
|
12
|
+
- Modern development environment setup
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- Node.js >= 24.0.0
|
|
17
|
+
- npm >= 11.0.0
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### Using npx
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx @openmfp/create-portal
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Custom Project Name
|
|
28
|
+
|
|
29
|
+
Create a portal with a specific name:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx @openmfp/create-portal my-awesome-portal
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The script will:
|
|
36
|
+
|
|
37
|
+
1. Create the project directory
|
|
38
|
+
2. Generate all necessary configuration files
|
|
39
|
+
3. Set up frontend and backend structures
|
|
40
|
+
4. Install all dependencies automatically
|
|
41
|
+
5. Display the complete project structure
|
|
42
|
+
|
|
43
|
+
## Troubleshooting
|
|
44
|
+
|
|
45
|
+
### Directory Already Exists
|
|
46
|
+
|
|
47
|
+
If the target directory already exists, the script will exit with an error. Choose a different project name or remove the existing directory.
|
|
48
|
+
|
|
49
|
+
### Dependency Installation Fails
|
|
50
|
+
|
|
51
|
+
If automatic installation fails, you can manually install dependencies:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd my-portal
|
|
55
|
+
npm install
|
|
56
|
+
cd frontend && npm install
|
|
57
|
+
cd ../backend && npm install
|
|
58
|
+
```
|
|
59
|
+
## Repository
|
|
60
|
+
|
|
61
|
+
- GitHub: [@openmfp/create-portal](https://github.com/openmfp/create-portal)
|
|
62
|
+
- npm: [@openmfp/create-portal](https://www.npmjs.com/package/@openmfp/create-portal)
|
|
63
|
+
|
|
64
|
+
## Contributing
|
|
65
|
+
|
|
66
|
+
Please refer to the [CONTRIBUTING](CONTRIBUTING.md) file in this repository for instructions on how to contribute to openMFP.
|
|
67
|
+
|
|
68
|
+
## Code of Conduct
|
|
69
|
+
|
|
70
|
+
Please refer to the [CODE_OF_CONDUCT.md](https://github.com/openmfp/create-portal?tab=coc-ov-file) of NeoNephos for information on the expected Code of Conduct for contributing to openMFP.
|
|
71
|
+
|
|
72
|
+
## Licensing
|
|
73
|
+
|
|
74
|
+
Please see our [LICENSE](https://github.com/openmfp/create-portal?tab=Apache-2.0-1-ov-file) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/openmfp/create-portal).
|
|
75
|
+
|
|
76
|
+
## Support
|
|
77
|
+
|
|
78
|
+
For questions and support, please open an issue on the GitHub repository.
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openmfp/create-portal",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI tool for scaffolding OpenMFP Portal projects",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/openmfp/create-portal.git"
|
|
8
|
+
},
|
|
9
|
+
"bin": "./src/generate-portal.js",
|
|
10
|
+
"author": "OpenMFP",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"openmfp",
|
|
15
|
+
"portal",
|
|
16
|
+
"cli",
|
|
17
|
+
"generator",
|
|
18
|
+
"create"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": "25.7.0",
|
|
22
|
+
"npm": "11.11.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "npm run test:unit && npm run test:integration",
|
|
26
|
+
"test:unit": "node --test test/generate-portal.test.js test/generators.test.js",
|
|
27
|
+
"test:integration": "node --test test/generate-portal.integration.test.js",
|
|
28
|
+
"test:watch": "node --test --watch"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"src/",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/openmfp/create-portal/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/openmfp/create-portal#readme"
|
|
39
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from "child_process";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { generateBackendFiles } from "./scripts/backend/backend-generator.js";
|
|
7
|
+
import { generateFrontendFiles } from "./scripts/frontend/frontend-generator.js";
|
|
8
|
+
import { generateRootFiles } from "./scripts/root/root-generator.js";
|
|
9
|
+
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const skipInstall = args.includes("--skip-install");
|
|
12
|
+
const projectName = args.find((arg) => !arg.startsWith("--")) || "my-portal";
|
|
13
|
+
|
|
14
|
+
console.log(`\n🚀 Creating portal: ${projectName}\n`);
|
|
15
|
+
|
|
16
|
+
const projectDir = path.join(process.cwd(), projectName);
|
|
17
|
+
|
|
18
|
+
if (fs.existsSync(projectDir)) {
|
|
19
|
+
console.error(`❌ Directory "${projectName}" already exists!`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function createDir(dirPath) {
|
|
24
|
+
if (!fs.existsSync(dirPath)) {
|
|
25
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function writeFile(filePath, content) {
|
|
30
|
+
createDir(path.dirname(filePath));
|
|
31
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function displayProjectStructure(dir, prefix = "", isRoot = true) {
|
|
35
|
+
if (fs.statSync(dir).isDirectory()) {
|
|
36
|
+
const items = fs
|
|
37
|
+
.readdirSync(dir)
|
|
38
|
+
.filter((item) => !item.startsWith(".") && item !== "node_modules")
|
|
39
|
+
.map((item) => ({
|
|
40
|
+
name: item,
|
|
41
|
+
path: path.join(dir, item),
|
|
42
|
+
isDirectory: fs.statSync(path.join(dir, item)).isDirectory(),
|
|
43
|
+
}))
|
|
44
|
+
.sort((a, b) => {
|
|
45
|
+
if (a.isDirectory && !b.isDirectory) return -1;
|
|
46
|
+
if (!a.isDirectory && b.isDirectory) return 1;
|
|
47
|
+
return a.name.localeCompare(b.name);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
items.forEach((item, index) => {
|
|
51
|
+
const isLastItem = index === items.length - 1;
|
|
52
|
+
const connector = isLastItem ? "└── " : "├── ";
|
|
53
|
+
|
|
54
|
+
console.log(prefix + connector + item.name + (item.isDirectory ? "/" : ""));
|
|
55
|
+
|
|
56
|
+
if (item.isDirectory) {
|
|
57
|
+
const newPrefix = prefix + (isLastItem ? " " : "│ ");
|
|
58
|
+
displayProjectStructure(item.path, newPrefix, false);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
createDir(projectDir);
|
|
65
|
+
|
|
66
|
+
generateRootFiles(projectDir, projectName, writeFile);
|
|
67
|
+
generateBackendFiles(projectDir, writeFile);
|
|
68
|
+
generateFrontendFiles(projectDir, writeFile, createDir);
|
|
69
|
+
|
|
70
|
+
console.log("✅ Project structure created successfully!");
|
|
71
|
+
displayProjectStructure(projectDir);
|
|
72
|
+
|
|
73
|
+
if (skipInstall) {
|
|
74
|
+
console.log("\n⏭️ Skipping dependency installation\n");
|
|
75
|
+
console.log("🎉 Portal created successfully!\n");
|
|
76
|
+
console.log("To get started:\n");
|
|
77
|
+
console.log(` cd ${projectName}`);
|
|
78
|
+
console.log(" npm install");
|
|
79
|
+
console.log(" npm start\n");
|
|
80
|
+
process.exit(0);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
console.log("\n📦 Installing dependencies...\n");
|
|
84
|
+
|
|
85
|
+
process.chdir(projectDir);
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
console.log("Installing root dependencies...");
|
|
89
|
+
execSync("npm install", { stdio: "inherit" });
|
|
90
|
+
|
|
91
|
+
console.log("\nInstalling frontend dependencies...");
|
|
92
|
+
execSync("npm run npm:install:ui", { stdio: "inherit" });
|
|
93
|
+
|
|
94
|
+
console.log("\nInstalling backend dependencies...");
|
|
95
|
+
execSync("npm run npm:install:server", { stdio: "inherit" });
|
|
96
|
+
|
|
97
|
+
console.log("\n✅ All dependencies installed successfully!\n");
|
|
98
|
+
console.log("🎉 Portal created successfully!\n");
|
|
99
|
+
console.log("To get started:\n");
|
|
100
|
+
console.log(` cd ${projectName}`);
|
|
101
|
+
console.log(" npm start\n");
|
|
102
|
+
console.log("Frontend: http://localhost:4300");
|
|
103
|
+
console.log("Backend: http://localhost:3000\n");
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error("\n❌ Error installing dependencies:", error.message);
|
|
106
|
+
console.log("\nYou can install dependencies manually:");
|
|
107
|
+
console.log(` cd ${projectName}`);
|
|
108
|
+
console.log(" npm install\n");
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
export function generateBackendFiles(projectDir, writeFile) {
|
|
9
|
+
const templatesDir = path.join(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
const backendPackageJson = fs.readFileSync(
|
|
12
|
+
path.join(templatesDir, "package.json"),
|
|
13
|
+
"utf-8"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
writeFile(path.join(projectDir, "backend", "package.json"), backendPackageJson);
|
|
17
|
+
|
|
18
|
+
const backendTsConfig = fs.readFileSync(
|
|
19
|
+
path.join(templatesDir, "tsconfig.json"),
|
|
20
|
+
"utf-8"
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
writeFile(path.join(projectDir, "backend", "tsconfig.json"), backendTsConfig);
|
|
24
|
+
|
|
25
|
+
const backendTsConfigBuild = fs.readFileSync(
|
|
26
|
+
path.join(templatesDir, "tsconfig.build.json"),
|
|
27
|
+
"utf-8"
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
writeFile(
|
|
31
|
+
path.join(projectDir, "backend", "tsconfig.build.json"),
|
|
32
|
+
backendTsConfigBuild
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const nestCliJson = fs.readFileSync(path.join(templatesDir, "nest-cli.json"), "utf-8");
|
|
36
|
+
|
|
37
|
+
writeFile(path.join(projectDir, "backend", "nest-cli.json"), nestCliJson);
|
|
38
|
+
|
|
39
|
+
const backendMainTs = fs.readFileSync(
|
|
40
|
+
path.join(templatesDir, "src", "main.ts"),
|
|
41
|
+
"utf-8"
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
writeFile(path.join(projectDir, "backend", "src", "main.ts"), backendMainTs);
|
|
45
|
+
|
|
46
|
+
const backendAppModuleTs = fs.readFileSync(
|
|
47
|
+
path.join(templatesDir, "src", "app.module.ts"),
|
|
48
|
+
"utf-8"
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
writeFile(path.join(projectDir, "backend", "src", "app.module.ts"), backendAppModuleTs);
|
|
52
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "backend",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "nest build",
|
|
8
|
+
"start": "nest start",
|
|
9
|
+
"start:watch": "nest start --watch",
|
|
10
|
+
"start:dev": "nest start --watch",
|
|
11
|
+
"start:debug": "nest start --debug --watch",
|
|
12
|
+
"start:prod": "node dist/main"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@nestjs/common": "^11.1.9",
|
|
16
|
+
"@nestjs/core": "^11.1.9",
|
|
17
|
+
"@nestjs/platform-express": "^11.1.9",
|
|
18
|
+
"@nestjs/serve-static": "^5.0.4",
|
|
19
|
+
"@openmfp/portal-server-lib": "^0.163.23",
|
|
20
|
+
"dotenv": "^17.3.1",
|
|
21
|
+
"reflect-metadata": "^0.2.2",
|
|
22
|
+
"rxjs": "^7.8.1"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@nestjs/cli": "^11.0.12",
|
|
26
|
+
"@nestjs/schematics": "^11.0.9",
|
|
27
|
+
"@types/express": "5.0.6",
|
|
28
|
+
"@types/node": "24.10.14",
|
|
29
|
+
"typescript": "^5.8.0"
|
|
30
|
+
},
|
|
31
|
+
"type": "module"
|
|
32
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Module } from '@nestjs/common';
|
|
2
|
+
import { PortalModule, PortalModuleOptions } from '@openmfp/portal-server-lib';
|
|
3
|
+
import { config } from 'dotenv';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
|
|
6
|
+
const __filename = new URL(import.meta.url).pathname;
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
config({ path: './.env' });
|
|
10
|
+
|
|
11
|
+
const portalOptions: PortalModuleOptions = {
|
|
12
|
+
frontendDistSources: path.join(
|
|
13
|
+
__dirname,
|
|
14
|
+
'../..',
|
|
15
|
+
'frontend/dist/frontend/browser',
|
|
16
|
+
),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
@Module({
|
|
20
|
+
imports: [PortalModule.create(portalOptions)],
|
|
21
|
+
})
|
|
22
|
+
export class AppModule {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppModule } from './app.module.js';
|
|
2
|
+
import { NestFactory } from '@nestjs/core';
|
|
3
|
+
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
4
|
+
|
|
5
|
+
async function bootstrap() {
|
|
6
|
+
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
|
7
|
+
await app.listen(process.env.PORT || 3000);
|
|
8
|
+
}
|
|
9
|
+
bootstrap();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "NodeNext",
|
|
4
|
+
"moduleResolution": "node16",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"removeComments": true,
|
|
8
|
+
"emitDecoratorMetadata": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"target": "ES2022",
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"outDir": "./dist",
|
|
14
|
+
"baseUrl": "./",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"strictNullChecks": false,
|
|
18
|
+
"noImplicitAny": false,
|
|
19
|
+
"strictBindCallApply": false,
|
|
20
|
+
"forceConsistentCasingInFileNames": false,
|
|
21
|
+
"noFallthroughCasesInSwitch": false
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
export function generateFrontendFiles(projectDir, writeFile, createDir) {
|
|
9
|
+
const templatesDir = path.join(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
const frontendPackageJson = fs.readFileSync(
|
|
12
|
+
path.join(templatesDir, "package.json"),
|
|
13
|
+
"utf-8"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
writeFile(
|
|
17
|
+
path.join(projectDir, "frontend", "package.json"),
|
|
18
|
+
frontendPackageJson
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const frontendTsConfig = fs.readFileSync(
|
|
22
|
+
path.join(templatesDir, "tsconfig.json"),
|
|
23
|
+
"utf-8"
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
writeFile(
|
|
27
|
+
path.join(projectDir, "frontend", "tsconfig.json"),
|
|
28
|
+
frontendTsConfig
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const frontendTsConfigApp = fs.readFileSync(
|
|
32
|
+
path.join(templatesDir, "tsconfig.app.json"),
|
|
33
|
+
"utf-8"
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
writeFile(
|
|
37
|
+
path.join(projectDir, "frontend", "tsconfig.app.json"),
|
|
38
|
+
frontendTsConfigApp
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const angularJson = fs.readFileSync(
|
|
42
|
+
path.join(templatesDir, "angular.json"),
|
|
43
|
+
"utf-8"
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
writeFile(
|
|
47
|
+
path.join(projectDir, "frontend", "angular.json"),
|
|
48
|
+
angularJson
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const proxyConfig = fs.readFileSync(
|
|
52
|
+
path.join(templatesDir, "proxy.config.json"),
|
|
53
|
+
"utf-8"
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
writeFile(
|
|
57
|
+
path.join(projectDir, "frontend", "proxy.config.json"),
|
|
58
|
+
proxyConfig
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const frontendMainTs = fs.readFileSync(
|
|
62
|
+
path.join(templatesDir, "src", "main.ts"),
|
|
63
|
+
"utf-8"
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
writeFile(path.join(projectDir, "frontend", "src", "main.ts"), frontendMainTs);
|
|
67
|
+
|
|
68
|
+
const indexHtml = fs.readFileSync(
|
|
69
|
+
path.join(templatesDir, "src", "index.html"),
|
|
70
|
+
"utf-8"
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
writeFile(path.join(projectDir, "frontend", "src", "index.html"), indexHtml);
|
|
74
|
+
|
|
75
|
+
const stylesScss = fs.readFileSync(
|
|
76
|
+
path.join(templatesDir, "src", "styles.scss"),
|
|
77
|
+
"utf-8"
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
writeFile(path.join(projectDir, "frontend", "src", "styles.scss"), stylesScss);
|
|
81
|
+
|
|
82
|
+
const appRoutesTs = fs.readFileSync(
|
|
83
|
+
path.join(templatesDir, "src", "app", "app.routes.ts"),
|
|
84
|
+
"utf-8"
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
writeFile(path.join(projectDir, "frontend", "src", "app", "app.routes.ts"), appRoutesTs);
|
|
88
|
+
|
|
89
|
+
const environmentTs = fs.readFileSync(
|
|
90
|
+
path.join(templatesDir, "src", "environments", "environment.ts"),
|
|
91
|
+
"utf-8"
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
writeFile(
|
|
95
|
+
path.join(projectDir, "frontend", "src", "environments", "environment.ts"),
|
|
96
|
+
environmentTs
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const environmentProdTs = fs.readFileSync(
|
|
100
|
+
path.join(templatesDir, "src", "environments", "environment.prod.ts"),
|
|
101
|
+
"utf-8"
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
writeFile(
|
|
105
|
+
path.join(projectDir, "frontend", "src", "environments", "environment.prod.ts"),
|
|
106
|
+
environmentProdTs
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const extractVersionsJs = fs.readFileSync(
|
|
110
|
+
path.join(templatesDir, "build-scripts", "extract-versions.js"),
|
|
111
|
+
"utf-8"
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
writeFile(
|
|
115
|
+
path.join(projectDir, "frontend", "build-scripts", "extract-versions.js"),
|
|
116
|
+
extractVersionsJs
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const gitkeep = fs.readFileSync(
|
|
120
|
+
path.join(templatesDir, "src", "assets", ".gitkeep"),
|
|
121
|
+
"utf-8"
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
writeFile(path.join(projectDir, "frontend", "src", "assets", ".gitkeep"), gitkeep);
|
|
125
|
+
|
|
126
|
+
const favicon = fs.readFileSync(
|
|
127
|
+
path.join(templatesDir, "src", "favicon.ico"),
|
|
128
|
+
"utf-8"
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
writeFile(path.join(projectDir, "frontend", "src", "favicon.ico"), favicon);
|
|
132
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"frontend": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"root": "",
|
|
14
|
+
"sourceRoot": "src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular/build:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"outputPath": {
|
|
21
|
+
"base": "dist/frontend"
|
|
22
|
+
},
|
|
23
|
+
"index": "src/index.html",
|
|
24
|
+
"polyfills": ["@angular/localize/init"],
|
|
25
|
+
"tsConfig": "tsconfig.app.json",
|
|
26
|
+
"inlineStyleLanguage": "scss",
|
|
27
|
+
"assets": [
|
|
28
|
+
"src/favicon.ico",
|
|
29
|
+
"src/assets",
|
|
30
|
+
{
|
|
31
|
+
"glob": "**",
|
|
32
|
+
"input": "node_modules/@openmfp/portal-ui-lib/assets/",
|
|
33
|
+
"output": "/assets/"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"glob": "**",
|
|
37
|
+
"input": "node_modules/@luigi-project/core",
|
|
38
|
+
"output": "/luigi-core"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"styles": ["src/styles.scss"],
|
|
42
|
+
"scripts": [],
|
|
43
|
+
"browser": "src/main.ts"
|
|
44
|
+
},
|
|
45
|
+
"configurations": {
|
|
46
|
+
"production": {
|
|
47
|
+
"budgets": [
|
|
48
|
+
{
|
|
49
|
+
"type": "initial",
|
|
50
|
+
"maximumWarning": "500kb",
|
|
51
|
+
"maximumError": "2mb"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "anyComponentStyle",
|
|
55
|
+
"maximumWarning": "2kb",
|
|
56
|
+
"maximumError": "4kb"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"fileReplacements": [
|
|
60
|
+
{
|
|
61
|
+
"replace": "src/environments/environment.ts",
|
|
62
|
+
"with": "src/environments/environment.prod.ts"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"outputHashing": "all"
|
|
66
|
+
},
|
|
67
|
+
"development": {
|
|
68
|
+
"optimization": false,
|
|
69
|
+
"extractLicenses": false,
|
|
70
|
+
"sourceMap": true,
|
|
71
|
+
"namedChunks": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"defaultConfiguration": "production"
|
|
75
|
+
},
|
|
76
|
+
"serve": {
|
|
77
|
+
"builder": "@angular/build:dev-server",
|
|
78
|
+
"options": {
|
|
79
|
+
"proxyConfig": "proxy.config.json"
|
|
80
|
+
},
|
|
81
|
+
"configurations": {
|
|
82
|
+
"production": {
|
|
83
|
+
"buildTarget": "frontend:build:production"
|
|
84
|
+
},
|
|
85
|
+
"development": {
|
|
86
|
+
"buildTarget": "frontend:build:development"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"defaultConfiguration": "development"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"cli": {
|
|
95
|
+
"analytics": false
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
5
|
+
const outputPath = path.join(__dirname, '..', 'src', 'assets', 'dependencies-versions.json');
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
9
|
+
const versions = {
|
|
10
|
+
...packageJson.dependencies,
|
|
11
|
+
...packageJson.devDependencies,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
15
|
+
fs.writeFileSync(outputPath, JSON.stringify(versions, null, 2));
|
|
16
|
+
|
|
17
|
+
console.log('✓ Dependencies versions extracted');
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error('Error extracting versions:', error);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "frontend",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"extract-versions": "node ./build-scripts/extract-versions.js",
|
|
7
|
+
"prebuild": "npm run extract-versions",
|
|
8
|
+
"prebuild:watch": "npm run extract-versions",
|
|
9
|
+
"prestart": "npm run extract-versions",
|
|
10
|
+
"prestart:watch": "npm run extract-versions",
|
|
11
|
+
"start": "ng serve --port 4300",
|
|
12
|
+
"build": "ng build",
|
|
13
|
+
"build:watch": "ng build --watch --configuration development"
|
|
14
|
+
},
|
|
15
|
+
"private": true,
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@angular/animations": "21.1.4",
|
|
18
|
+
"@angular/common": "21.1.4",
|
|
19
|
+
"@angular/compiler": "21.1.4",
|
|
20
|
+
"@angular/core": "21.1.4",
|
|
21
|
+
"@angular/elements": "21.1.4",
|
|
22
|
+
"@angular/forms": "21.1.4",
|
|
23
|
+
"@angular/localize": "21.1.4",
|
|
24
|
+
"@angular/platform-browser": "21.1.4",
|
|
25
|
+
"@angular/platform-browser-dynamic": "21.1.4",
|
|
26
|
+
"@angular/router": "21.1.4",
|
|
27
|
+
"@luigi-project/client": "2.27.0",
|
|
28
|
+
"@luigi-project/core": "2.27.0",
|
|
29
|
+
"@luigi-project/plugin-auth-oauth2": "2.27.0",
|
|
30
|
+
"@openmfp/portal-ui-lib": "0.192.1",
|
|
31
|
+
"rxjs": "7.8.2",
|
|
32
|
+
"tslib": "2.8.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@angular-devkit/build-angular": "21.1.4",
|
|
36
|
+
"@angular/build": "21.1.4",
|
|
37
|
+
"@angular/cli": "21.1.4",
|
|
38
|
+
"@angular/compiler-cli": "21.1.4",
|
|
39
|
+
"nodemon": "3.1.14",
|
|
40
|
+
"rimraf": "6.1.3",
|
|
41
|
+
"typescript": "5.9.3"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>OpenMFP Portal</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="stylesheet" href="/luigi-core/luigi_horizon.css" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
12
|
+
<script src="/luigi-core/luigi.js"></script>
|
|
13
|
+
<app-portal></app-portal>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { provideZonelessChangeDetection } from "@angular/core";
|
|
2
|
+
import { bootstrapApplication } from "@angular/platform-browser";
|
|
3
|
+
import { PortalComponent, PortalOptions, providePortal } from "@openmfp/portal-ui-lib";
|
|
4
|
+
|
|
5
|
+
const portalOptions: PortalOptions = {};
|
|
6
|
+
|
|
7
|
+
bootstrapApplication(PortalComponent, {
|
|
8
|
+
providers: [provideZonelessChangeDetection(), providePortal(portalOptions)],
|
|
9
|
+
}).catch((err) => console.error(err));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./dist/out-tsc",
|
|
5
|
+
"strict": true,
|
|
6
|
+
"noImplicitOverride": true,
|
|
7
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
8
|
+
"noImplicitReturns": true,
|
|
9
|
+
"noFallthroughCasesInSwitch": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"declaration": false,
|
|
14
|
+
"experimentalDecorators": true,
|
|
15
|
+
"moduleResolution": "node",
|
|
16
|
+
"importHelpers": true,
|
|
17
|
+
"target": "ES2022",
|
|
18
|
+
"module": "ES2022",
|
|
19
|
+
"useDefineForClassFields": false,
|
|
20
|
+
"lib": ["ES2022", "dom"],
|
|
21
|
+
"resolveJsonModule": true
|
|
22
|
+
},
|
|
23
|
+
"angularCompilerOptions": {
|
|
24
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
25
|
+
"strictInjectionParameters": true,
|
|
26
|
+
"strictInputAccessModifiers": true,
|
|
27
|
+
"strictTemplates": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
export function generateRootFiles(projectDir, projectName, writeFile) {
|
|
9
|
+
const templatesDir = path.join(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
const rootPackageJson = fs
|
|
12
|
+
.readFileSync(path.join(templatesDir, "package.json"), "utf-8")
|
|
13
|
+
.replace(/{{projectName}}/g, projectName);
|
|
14
|
+
|
|
15
|
+
writeFile(path.join(projectDir, "package.json"), rootPackageJson);
|
|
16
|
+
|
|
17
|
+
const readme = fs
|
|
18
|
+
.readFileSync(path.join(templatesDir, "README.md"), "utf-8")
|
|
19
|
+
.replace(/{{projectName}}/g, projectName);
|
|
20
|
+
|
|
21
|
+
writeFile(path.join(projectDir, "README.md"), readme);
|
|
22
|
+
|
|
23
|
+
const gitignore = fs.readFileSync(path.join(templatesDir, ".gitignore"), "utf-8");
|
|
24
|
+
|
|
25
|
+
writeFile(path.join(projectDir, ".gitignore"), gitignore);
|
|
26
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
OpenMFP Portal
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js >= 24.0.0
|
|
8
|
+
- npm >= 11.0.0
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This will install dependencies for both frontend and backend.
|
|
17
|
+
|
|
18
|
+
## Development
|
|
19
|
+
|
|
20
|
+
Start both frontend and backend in development mode:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm start
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- Frontend will be available at: http://localhost:4300
|
|
27
|
+
- Backend will be available at: http://localhost:3000
|
|
28
|
+
|
|
29
|
+
## Build
|
|
30
|
+
|
|
31
|
+
Build both frontend and backend:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm run build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Project Structure
|
|
38
|
+
|
|
39
|
+
- `backend/` - NestJS backend application
|
|
40
|
+
- `frontend/` - Angular frontend application
|
|
41
|
+
|
|
42
|
+
## Available Scripts
|
|
43
|
+
|
|
44
|
+
- `npm start` - Start both frontend and backend in development mode
|
|
45
|
+
- `npm run build` - Build both applications
|
|
46
|
+
- `npm run start:ui` - Start only frontend
|
|
47
|
+
- `npm run start:server` - Start only backend
|
|
48
|
+
- `npm run build:ui` - Build only frontend
|
|
49
|
+
- `npm run build:server` - Build only backend
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "OpenMFP Portal",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": "25.7.0",
|
|
7
|
+
"npm": "11.11.0"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"npm:install:ui": "cd frontend && npm install",
|
|
11
|
+
"npm:install:server": "cd backend && npm install",
|
|
12
|
+
"build": "concurrently 'npm:build:ui' 'npm:build:server'",
|
|
13
|
+
"build:ui": "cd frontend && npm run build",
|
|
14
|
+
"build:server": "cd backend && npm run build",
|
|
15
|
+
"start": "concurrently 'npm:start:ui' 'npm:start:server'",
|
|
16
|
+
"start:ui": "cd frontend && npm run start",
|
|
17
|
+
"start:server": "cd backend && npm run start",
|
|
18
|
+
"build:ui:watch": "cd frontend && npm run build:watch",
|
|
19
|
+
"start:server:watch": "cd backend && npm run start:watch",
|
|
20
|
+
"start:watch": "concurrently 'npm:start:server:watch' 'npm:build:ui:watch'"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"concurrently": "9.2.1"
|
|
24
|
+
},
|
|
25
|
+
"private": true
|
|
26
|
+
}
|