diff --git a/admin/index.ts b/admin/index.ts new file mode 100644 index 00000000..39608087 --- /dev/null +++ b/admin/index.ts @@ -0,0 +1,22 @@ +import AdminJS from "adminjs"; +import AdminJSExpress from "@adminjs/express"; +import express from "express"; + +const PORT = 3000; + +const start = async () => { + const app = express(); + + const admin = new AdminJS({}); + + const adminRouter = AdminJSExpress.buildRouter(admin); + app.use(admin.options.rootPath, adminRouter); + + app.listen(PORT, () => { + console.log( + `AdminJS started on http://localhost:${PORT}${admin.options.rootPath}`, + ); + }); +}; + +void start(); diff --git a/admin/package.json b/admin/package.json index cab14827..cd7845b8 100644 --- a/admin/package.json +++ b/admin/package.json @@ -2,20 +2,32 @@ "name": "admin", "version": "1.0.0", "description": "", - "main": "index.js", + "type": "module", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start:dev": "nodemon --exec tsx index.ts" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "@adminjs/express": "^6.1.0", + "@adminjs/typeorm": "^5.0.1", "adminjs": "^7.8.13", "express": "^4.21.0", - "typeorm": "catalog:", + "express-formidable": "^1.2.0", + "express-session": "^1.18.0", + "nodemon": "^3.1.7", "pg": "catalog:", "reflect-metadata": "catalog:", + "tslib": "^2.7.0", + "typeorm": "catalog:", "typescript": "catalog:" + }, + "devDependencies": { + "@types/express": "^4.17.17", + "@types/node": "^22.7.4", + "ts-node": "^10.9.1", + "tsx": "^4.19.1" } } diff --git a/admin/tsconfig.json b/admin/tsconfig.json new file mode 100644 index 00000000..a178cac0 --- /dev/null +++ b/admin/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "target": "esnext", + "outDir": "./dist", + "rootDir": "./", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "isolatedModules": true, + "skipLibCheck": true, + "paths": { + "@shared/*": ["../shared/*"], + "@api/*": ["../api/src/*"] + } + }, + "include": ["./**/*.ts", "../shared/**/*.ts", "../api/**/*.ts"], + "exclude": ["node_modules"] +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8cc10174..1764b07b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,24 +40,52 @@ importers: '@adminjs/express': specifier: ^6.1.0 version: 6.1.0(adminjs@7.8.13(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/babel__core@7.20.5)(@types/react-dom@18.3.0)(@types/react@18.3.5))(express-formidable@1.2.0)(express-session@1.18.0)(express@4.21.0)(tslib@2.7.0) + '@adminjs/typeorm': + specifier: ^5.0.1 + version: 5.0.1(adminjs@7.8.13(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/babel__core@7.20.5)(@types/react-dom@18.3.0)(@types/react@18.3.5))(typeorm@0.3.20(pg@8.12.0)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.4.5))) adminjs: specifier: ^7.8.13 version: 7.8.13(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/babel__core@7.20.5)(@types/react-dom@18.3.0)(@types/react@18.3.5) express: specifier: ^4.21.0 version: 4.21.0 + express-formidable: + specifier: ^1.2.0 + version: 1.2.0 + express-session: + specifier: ^1.18.0 + version: 1.18.0 + nodemon: + specifier: ^3.1.7 + version: 3.1.7 pg: specifier: 'catalog:' version: 8.12.0 reflect-metadata: specifier: 'catalog:' version: 0.2.2 + tslib: + specifier: ^2.7.0 + version: 2.7.0 typeorm: specifier: 'catalog:' - version: 0.3.20(pg@8.12.0)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.4.5)) + version: 0.3.20(pg@8.12.0)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.4.5)) typescript: specifier: 'catalog:' version: 5.4.5 + devDependencies: + '@types/express': + specifier: ^4.17.17 + version: 4.17.21 + '@types/node': + specifier: ^22.7.4 + version: 22.7.4 + ts-node: + specifier: ^10.9.1 + version: 10.9.2(@types/node@22.7.4)(typescript@5.4.5) + tsx: + specifier: ^4.19.1 + version: 4.19.1 api: dependencies: @@ -301,6 +329,12 @@ packages: express-session: '>=1.17.3' tslib: ^2.5.0 + '@adminjs/typeorm@5.0.1': + resolution: {integrity: sha512-kzIGNUQAakfNp0Ajl6n2fqgqFZPtI0+vtAq3xBTVN6evYPQaaf/4ZVx4b7Fjcwkp/iw4j+dgPBZbnANqWySLxw==} + peerDependencies: + adminjs: ^7.0.0 + typeorm: ~0.3.0 + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -2475,6 +2509,9 @@ packages: '@types/node@20.14.2': resolution: {integrity: sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==} + '@types/node@22.7.4': + resolution: {integrity: sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==} + '@types/nodemailer@6.4.15': resolution: {integrity: sha512-0EBJxawVNjPkng1zm2vopRctuWVCxk34JcIlRuXSf54habUWdz1FB7wHDqOqvDa8Mtpt0Q3LTXQkAs2LNyK5jQ==} @@ -4086,6 +4123,9 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore-by-default@1.0.1: + resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -4891,6 +4931,11 @@ packages: resolution: {integrity: sha512-AHf04ySLC6CIfuRtRiEYtGEXgRfa6INgWGluDhnxTZhHSKvrBu7lc1VVchQ0d8nPc4cFaZoPq8vkyNoZr0TpGQ==} engines: {node: '>=6.0.0'} + nodemon@3.1.7: + resolution: {integrity: sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==} + engines: {node: '>=10'} + hasBin: true + nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} @@ -5314,6 +5359,9 @@ packages: proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + pstree.remy@1.1.8: + resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==} + punycode.js@2.3.1: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} engines: {node: '>=6'} @@ -5716,6 +5764,10 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-update-notifier@2.0.0: + resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} + engines: {node: '>=10'} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -5992,6 +6044,10 @@ packages: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} + touch@3.1.1: + resolution: {integrity: sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==} + hasBin: true + tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -6070,6 +6126,11 @@ packages: tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tsx@4.19.1: + resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + engines: {node: '>=18.0.0'} + hasBin: true + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -6191,9 +6252,15 @@ packages: unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + undefsafe@2.0.5: + resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==} + undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + unicode-canonical-property-names-ecmascript@2.0.1: resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} engines: {node: '>=4'} @@ -6488,6 +6555,11 @@ snapshots: express-session: 1.18.0 tslib: 2.7.0 + '@adminjs/typeorm@5.0.1(adminjs@7.8.13(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/babel__core@7.20.5)(@types/react-dom@18.3.0)(@types/react@18.3.5))(typeorm@0.3.20(pg@8.12.0)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.4.5)))': + dependencies: + adminjs: 7.8.13(@tiptap/extension-text-style@2.8.0(@tiptap/core@2.1.13(@tiptap/pm@2.1.13)))(@types/babel__core@7.20.5)(@types/react-dom@18.3.0)(@types/react@18.3.5) + typeorm: 0.3.20(pg@8.12.0)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.4.5)) + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.3.0': @@ -9264,11 +9336,11 @@ snapshots: '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 20.14.2 + '@types/node': 22.7.4 '@types/connect@3.4.38': dependencies: - '@types/node': 20.14.2 + '@types/node': 22.7.4 '@types/cookiejar@2.1.5': {} @@ -9278,7 +9350,7 @@ snapshots: '@types/express-serve-static-core@4.19.5': dependencies: - '@types/node': 20.14.2 + '@types/node': 22.7.4 '@types/qs': 6.9.15 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -9347,6 +9419,10 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@22.7.4': + dependencies: + undici-types: 6.19.8 + '@types/nodemailer@6.4.15': dependencies: '@types/node': 20.14.2 @@ -9399,12 +9475,12 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 20.14.2 + '@types/node': 22.7.4 '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 20.14.2 + '@types/node': 22.7.4 '@types/send': 0.17.4 '@types/stack-utils@2.0.3': {} @@ -11452,6 +11528,8 @@ snapshots: ieee754@1.2.1: {} + ignore-by-default@1.0.1: {} + ignore@5.3.2: {} immutable@4.3.7: {} @@ -12408,6 +12486,19 @@ snapshots: nodemailer@6.9.15: {} + nodemon@3.1.7: + dependencies: + chokidar: 3.6.0 + debug: 4.3.6(supports-color@5.5.0) + ignore-by-default: 1.0.1 + minimatch: 3.1.2 + pstree.remy: 1.1.8 + semver: 7.6.3 + simple-update-notifier: 2.0.0 + supports-color: 5.5.0 + touch: 3.1.1 + undefsafe: 2.0.5 + nopt@5.0.0: dependencies: abbrev: 1.1.1 @@ -12862,6 +12953,8 @@ snapshots: proxy-from-env@1.1.0: {} + pstree.remy@1.1.8: {} + punycode.js@2.3.1: {} punycode@2.3.1: {} @@ -13331,6 +13424,10 @@ snapshots: signal-exit@4.1.0: {} + simple-update-notifier@2.0.0: + dependencies: + semver: 7.6.3 + sisteransi@1.0.5: {} slash@3.0.0: {} @@ -13655,6 +13752,8 @@ snapshots: toidentifier@1.0.1: {} + touch@3.1.1: {} + tr46@0.0.3: {} tree-kill@1.2.2: {} @@ -13712,6 +13811,24 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + ts-node@10.9.2(@types/node@22.7.4)(typescript@5.4.5): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.7.4 + acorn: 8.12.1 + acorn-walk: 8.3.3 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.4.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + tsconfig-paths-webpack-plugin@4.1.0: dependencies: chalk: 4.1.2 @@ -13735,6 +13852,13 @@ snapshots: tslib@2.7.0: {} + tsx@4.19.1: + dependencies: + esbuild: 0.23.1 + get-tsconfig: 4.8.0 + optionalDependencies: + fsevents: 2.3.3 + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 @@ -13807,6 +13931,29 @@ snapshots: transitivePeerDependencies: - supports-color + typeorm@0.3.20(pg@8.12.0)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.4.5)): + dependencies: + '@sqltools/formatter': 1.2.5 + app-root-path: 3.1.0 + buffer: 6.0.3 + chalk: 4.1.2 + cli-highlight: 2.1.11 + dayjs: 1.11.13 + debug: 4.3.6(supports-color@5.5.0) + dotenv: 16.4.5 + glob: 10.4.5 + mkdirp: 2.1.6 + reflect-metadata: 0.2.2 + sha.js: 2.4.11 + tslib: 2.7.0 + uuid: 9.0.1 + yargs: 17.7.2 + optionalDependencies: + pg: 8.12.0 + ts-node: 10.9.2(@types/node@22.7.4)(typescript@5.4.5) + transitivePeerDependencies: + - supports-color + typescript@5.3.3: {} typescript@5.4.5: {} @@ -13828,8 +13975,12 @@ snapshots: has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 + undefsafe@2.0.5: {} + undici-types@5.26.5: {} + undici-types@6.19.8: {} + unicode-canonical-property-names-ecmascript@2.0.1: {} unicode-match-property-ecmascript@2.0.0: diff --git a/tsconfig.json b/tsconfig.json index 46b107e8..8fcbed30 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,8 @@ "@api/*": ["./api/src/*"], "@client/*": ["./client/*"], "@shared/*": ["./shared/*"], - "@data/*": ["./data/*"], - } + "@data/*": ["./data/*"] + }, + "allowSyntheticDefaultImports": true } } \ No newline at end of file