mirror of
https://github.com/theoleuthardt/werkzeugkiste.git
synced 2026-06-13 09:37:53 +00:00
Merge branch 'main' into deployment
This commit is contained in:
commit
cffc5ba3f1
16 changed files with 1067 additions and 5 deletions
319
backend/package-lock.json
generated
319
backend/package-lock.json
generated
|
|
@ -16,11 +16,13 @@
|
||||||
"fastify-cors": "^6.0.3",
|
"fastify-cors": "^6.0.3",
|
||||||
"fastify-multipart": "^5.3.1",
|
"fastify-multipart": "^5.3.1",
|
||||||
"libreoffice-convert": "^1.6.0",
|
"libreoffice-convert": "^1.6.0",
|
||||||
"luxon": "^3.5.0"
|
"luxon": "^3.5.0",
|
||||||
|
"qrcode": "^1.5.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"@types/node": "^22.13.4",
|
"@types/node": "^22.13.4",
|
||||||
|
"@types/qrcode": "^1.5.5",
|
||||||
"prettier": "3.5.1",
|
"prettier": "3.5.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.7.3"
|
||||||
|
|
@ -282,6 +284,16 @@
|
||||||
"undici-types": "~6.20.0"
|
"undici-types": "~6.20.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/qrcode": {
|
||||||
|
"version": "1.5.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.5.tgz",
|
||||||
|
"integrity": "sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/abstract-logging": {
|
"node_modules/abstract-logging": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz",
|
||||||
|
|
@ -347,6 +359,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ansi-styles": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"color-convert": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/arg": {
|
"node_modules/arg": {
|
||||||
"version": "4.1.3",
|
"version": "4.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||||
|
|
@ -379,6 +415,44 @@
|
||||||
"fastq": "^1.17.1"
|
"fastq": "^1.17.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/camelcase": {
|
||||||
|
"version": "5.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||||
|
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cliui": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"strip-ansi": "^6.0.0",
|
||||||
|
"wrap-ansi": "^6.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/color-convert": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"color-name": "~1.1.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/color-name": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/cookie": {
|
"node_modules/cookie": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
|
||||||
|
|
@ -395,6 +469,15 @@
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/decamelize": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/deepmerge": {
|
"node_modules/deepmerge": {
|
||||||
"version": "4.3.1",
|
"version": "4.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||||
|
|
@ -423,6 +506,12 @@
|
||||||
"node": ">=0.3.1"
|
"node": ">=0.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dijkstrajs": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/dotenv": {
|
"node_modules/dotenv": {
|
||||||
"version": "16.4.7",
|
"version": "16.4.7",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
||||||
|
|
@ -435,6 +524,12 @@
|
||||||
"url": "https://dotenvx.com"
|
"url": "https://dotenvx.com"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/end-of-stream": {
|
"node_modules/end-of-stream": {
|
||||||
"version": "1.4.4",
|
"version": "1.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
||||||
|
|
@ -614,6 +709,28 @@
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/find-up": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"locate-path": "^5.0.0",
|
||||||
|
"path-exists": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/get-caller-file": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||||
|
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": "6.* || 8.* || >= 10.*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/hexoid": {
|
"node_modules/hexoid": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz",
|
||||||
|
|
@ -632,6 +749,15 @@
|
||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-fullwidth-code-point": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/json-schema-ref-resolver": {
|
"node_modules/json-schema-ref-resolver": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-2.0.1.tgz",
|
||||||
|
|
@ -691,6 +817,18 @@
|
||||||
"set-cookie-parser": "^2.6.0"
|
"set-cookie-parser": "^2.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/locate-path": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-locate": "^4.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/luxon": {
|
"node_modules/luxon": {
|
||||||
"version": "3.5.0",
|
"version": "3.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz",
|
||||||
|
|
@ -740,6 +878,51 @@
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/p-limit": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-try": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-locate": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"p-limit": "^2.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/p-try": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-exists": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pino": {
|
"node_modules/pino": {
|
||||||
"version": "9.6.0",
|
"version": "9.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/pino/-/pino-9.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/pino/-/pino-9.6.0.tgz",
|
||||||
|
|
@ -777,6 +960,15 @@
|
||||||
"integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==",
|
"integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/pngjs": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "3.5.1",
|
"version": "3.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.1.tgz",
|
||||||
|
|
@ -809,6 +1001,23 @@
|
||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/qrcode": {
|
||||||
|
"version": "1.5.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
|
||||||
|
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dijkstrajs": "^1.0.1",
|
||||||
|
"pngjs": "^5.0.0",
|
||||||
|
"yargs": "^15.3.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"qrcode": "bin/qrcode"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/quick-format-unescaped": {
|
"node_modules/quick-format-unescaped": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
|
||||||
|
|
@ -824,6 +1033,15 @@
|
||||||
"node": ">= 12.13.0"
|
"node": ">= 12.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/require-directory": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/require-from-string": {
|
"node_modules/require-from-string": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||||
|
|
@ -833,6 +1051,12 @@
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/require-main-filename": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/ret": {
|
"node_modules/ret": {
|
||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz",
|
||||||
|
|
@ -914,6 +1138,12 @@
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/set-blocking": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/set-cookie-parser": {
|
"node_modules/set-cookie-parser": {
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
|
||||||
|
|
@ -947,6 +1177,32 @@
|
||||||
"node": ">=4.0.0"
|
"node": ">=4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/string-width": {
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/text-decoding": {
|
"node_modules/text-decoding": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz",
|
||||||
|
|
@ -1061,12 +1317,73 @@
|
||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which-module": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/wrap-ansi": {
|
||||||
|
"version": "6.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
||||||
|
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.0.0",
|
||||||
|
"string-width": "^4.1.0",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wrappy": {
|
"node_modules/wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/y18n": {
|
||||||
|
"version": "4.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
|
||||||
|
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/yargs": {
|
||||||
|
"version": "15.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
|
||||||
|
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"cliui": "^6.0.0",
|
||||||
|
"decamelize": "^1.2.0",
|
||||||
|
"find-up": "^4.1.0",
|
||||||
|
"get-caller-file": "^2.0.1",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"require-main-filename": "^2.0.0",
|
||||||
|
"set-blocking": "^2.0.0",
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"which-module": "^2.0.0",
|
||||||
|
"y18n": "^4.0.0",
|
||||||
|
"yargs-parser": "^18.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yargs-parser": {
|
||||||
|
"version": "18.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
|
||||||
|
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": "^5.0.0",
|
||||||
|
"decamelize": "^1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/yn": {
|
"node_modules/yn": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,13 @@
|
||||||
"fastify-cors": "^6.0.3",
|
"fastify-cors": "^6.0.3",
|
||||||
"fastify-multipart": "^5.3.1",
|
"fastify-multipart": "^5.3.1",
|
||||||
"libreoffice-convert": "^1.6.0",
|
"libreoffice-convert": "^1.6.0",
|
||||||
"luxon": "^3.5.0"
|
"luxon": "^3.5.0",
|
||||||
|
"qrcode": "^1.5.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"@types/node": "^22.13.4",
|
"@types/node": "^22.13.4",
|
||||||
|
"@types/qrcode": "^1.5.5",
|
||||||
"prettier": "3.5.1",
|
"prettier": "3.5.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.7.3"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ import { colorConvert } from "./src/routes/colorconvert.route";
|
||||||
import { passwordGenerate } from "./src/routes/passwordgenerate.route";
|
import { passwordGenerate } from "./src/routes/passwordgenerate.route";
|
||||||
import { regexTest } from "./src/routes/regextest.route";
|
import { regexTest } from "./src/routes/regextest.route";
|
||||||
import { tmzConvert } from "./src/routes/tmzconvert.route";
|
import { tmzConvert } from "./src/routes/tmzconvert.route";
|
||||||
|
import { generateQRCode } from "./src/routes/generateqrcode.route";
|
||||||
import { wordCounter } from "./src/routes/wordcounter.route";
|
import { wordCounter } from "./src/routes/wordcounter.route";
|
||||||
|
import { videoToAudio } from "./src/routes/videotoaudio.route";
|
||||||
|
import { removeBG } from "./src/routes/removebg.route";
|
||||||
|
|
||||||
const app = Fastify({ logger: true });
|
const app = Fastify({ logger: true });
|
||||||
|
|
||||||
|
|
@ -22,7 +25,10 @@ app.register(colorConvert);
|
||||||
app.register(passwordGenerate);
|
app.register(passwordGenerate);
|
||||||
app.register(regexTest);
|
app.register(regexTest);
|
||||||
app.register(tmzConvert);
|
app.register(tmzConvert);
|
||||||
|
app.register(generateQRCode);
|
||||||
app.register(wordCounter);
|
app.register(wordCounter);
|
||||||
|
app.register(videoToAudio);
|
||||||
|
app.register(removeBG);
|
||||||
|
|
||||||
const PORT = process.env.PORT || 4000;
|
const PORT = process.env.PORT || 4000;
|
||||||
app.listen({ port: Number(PORT), host: "0.0.0.0" }, () => {
|
app.listen({ port: Number(PORT), host: "0.0.0.0" }, () => {
|
||||||
|
|
|
||||||
39
backend/src/routes/generateqrcode.route.ts
Normal file
39
backend/src/routes/generateqrcode.route.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
||||||
|
import * as QRCode from "qrcode";
|
||||||
|
|
||||||
|
interface RequestBody {
|
||||||
|
qrcodeContent: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function generateQRCode(app: FastifyInstance) {
|
||||||
|
app.post(
|
||||||
|
"/api/generate-qrcode",
|
||||||
|
async (
|
||||||
|
request: FastifyRequest<{ Body: RequestBody }>,
|
||||||
|
reply: FastifyReply,
|
||||||
|
) => {
|
||||||
|
const data = request.body;
|
||||||
|
|
||||||
|
if (!data.qrcodeContent) {
|
||||||
|
return reply.status(400).send({ error: "Missing text parameter" });
|
||||||
|
} else if (data.qrcodeContent === "") {
|
||||||
|
return reply
|
||||||
|
.status(400)
|
||||||
|
.send({ error: "Text parameter cannot be empty" });
|
||||||
|
} else if (data.qrcodeContent.length > 1000) {
|
||||||
|
return reply.status(400).send({ error: "Text parameter too long" });
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const qrCodeUrl = await QRCode.toDataURL(data.qrcodeContent);
|
||||||
|
return reply
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
|
.status(200)
|
||||||
|
.send({ qrCode: qrCodeUrl });
|
||||||
|
} catch (error) {
|
||||||
|
console.error("QR Code generation error:", error);
|
||||||
|
return reply.status(500).send({ error: "Error generating QR code!" });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
78
backend/src/routes/removebg.route.ts
Normal file
78
backend/src/routes/removebg.route.ts
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
||||||
|
import { promises as fs } from "fs";
|
||||||
|
import * as path from "path";
|
||||||
|
import { randomUUID } from "crypto";
|
||||||
|
import { spawn } from "child_process";
|
||||||
|
|
||||||
|
export async function removeBG(app: FastifyInstance) {
|
||||||
|
app.post(
|
||||||
|
"/api/remove-bg",
|
||||||
|
async (request: FastifyRequest, reply: FastifyReply) => {
|
||||||
|
const tmpDir = path.join(process.cwd(), "tmp");
|
||||||
|
const sessionId = randomUUID();
|
||||||
|
const inputPath = path.join(tmpDir, `input-${sessionId}.png`);
|
||||||
|
const outputPath = path.join(tmpDir, `output-${sessionId}.png`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const parts = request.parts();
|
||||||
|
await fs.mkdir(tmpDir, { recursive: true });
|
||||||
|
|
||||||
|
let fileBuffer: Buffer | null = null;
|
||||||
|
|
||||||
|
for await (const part of parts) {
|
||||||
|
if (part.type === "file") {
|
||||||
|
fileBuffer = await part.toBuffer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fileBuffer) {
|
||||||
|
return reply.status(400).send({ error: "No file uploaded!" });
|
||||||
|
}
|
||||||
|
|
||||||
|
await fs.writeFile(inputPath, fileBuffer);
|
||||||
|
console.log("Received file, buffer length:", fileBuffer.length);
|
||||||
|
|
||||||
|
await new Promise<void>((resolve, reject) => {
|
||||||
|
const pythonProcess = spawn("rembg", ["i", inputPath, outputPath]);
|
||||||
|
|
||||||
|
pythonProcess.stderr.on("data", (data) => {
|
||||||
|
console.log(`ffmpeg stderr: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
pythonProcess.on("close", (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
reject(new Error(`rembg process exited with code ${code}`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
pythonProcess.on("error", (err) => {
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const outputImageBuffer = await fs.readFile(outputPath);
|
||||||
|
await Promise.all([fs.unlink(inputPath), fs.unlink(outputPath)]);
|
||||||
|
|
||||||
|
reply
|
||||||
|
.header("Content-Type", "image/png")
|
||||||
|
.header("Content-Disposition", `attachment; filename="converted.png"`)
|
||||||
|
.status(200)
|
||||||
|
.send(outputImageBuffer);
|
||||||
|
} catch (error) {
|
||||||
|
try {
|
||||||
|
await Promise.all([
|
||||||
|
fs.unlink(inputPath).catch(() => {}),
|
||||||
|
fs.unlink(outputPath).catch(() => {}),
|
||||||
|
]);
|
||||||
|
} catch (cleanupError) {
|
||||||
|
console.error("Cleanup error:", cleanupError);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error("Convert error:", error);
|
||||||
|
reply.status(500).send({ error: "Error while converting!" });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
148
backend/src/routes/videotoaudio.route.ts
Normal file
148
backend/src/routes/videotoaudio.route.ts
Normal file
|
|
@ -0,0 +1,148 @@
|
||||||
|
import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
||||||
|
import { MultipartValue } from "@fastify/multipart";
|
||||||
|
import { spawn } from "child_process";
|
||||||
|
import { promises as fs } from "fs";
|
||||||
|
import * as path from "path";
|
||||||
|
import { randomUUID } from "crypto";
|
||||||
|
|
||||||
|
interface ConversionOptions {
|
||||||
|
format: string;
|
||||||
|
bitrate?: string;
|
||||||
|
channels?: number;
|
||||||
|
sampleRate?: number;
|
||||||
|
}
|
||||||
|
let options: ConversionOptions;
|
||||||
|
|
||||||
|
const ffmpegEncoder: { [key: string]: string } = {
|
||||||
|
".mp3": "libmp3lame",
|
||||||
|
".wav": "pcm_s16le",
|
||||||
|
".aac": "aac",
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function videoToAudio(app: FastifyInstance) {
|
||||||
|
app.post(
|
||||||
|
"/api/video-to-audio",
|
||||||
|
async (request: FastifyRequest, reply: FastifyReply) => {
|
||||||
|
const tmpDir = path.join(process.cwd(), "tmp");
|
||||||
|
const sessionId = randomUUID();
|
||||||
|
const inputPath = path.join(tmpDir, `input-${sessionId}`);
|
||||||
|
const outputPath = path.join(tmpDir, `output-${sessionId}`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await fs.mkdir(tmpDir, { recursive: true });
|
||||||
|
|
||||||
|
const parts = request.parts();
|
||||||
|
|
||||||
|
let fileBuffer: Buffer | null = null;
|
||||||
|
options = {
|
||||||
|
format: "",
|
||||||
|
bitrate: "192k",
|
||||||
|
channels: 2,
|
||||||
|
sampleRate: 44100,
|
||||||
|
};
|
||||||
|
|
||||||
|
for await (const part of parts) {
|
||||||
|
if (part.type === "file") {
|
||||||
|
fileBuffer = await part.toBuffer();
|
||||||
|
} else if (part.type === "field") {
|
||||||
|
const field = part as MultipartValue<string>;
|
||||||
|
switch (field.fieldname) {
|
||||||
|
case "outputFormat":
|
||||||
|
const format = field.value.toLowerCase();
|
||||||
|
options.format = format;
|
||||||
|
break;
|
||||||
|
case "bitrate":
|
||||||
|
options.bitrate = field.value;
|
||||||
|
break;
|
||||||
|
case "channels":
|
||||||
|
options.channels = parseInt(field.value, 10);
|
||||||
|
break;
|
||||||
|
case "sampleRate":
|
||||||
|
options.sampleRate = parseInt(field.value, 10);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fileBuffer) {
|
||||||
|
return reply.status(400).send({ error: "No file uploaded!" });
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("options", options);
|
||||||
|
|
||||||
|
await fs.writeFile(inputPath, fileBuffer);
|
||||||
|
|
||||||
|
await new Promise<void>((resolve, reject) => {
|
||||||
|
const args = [
|
||||||
|
"-i",
|
||||||
|
inputPath,
|
||||||
|
"-vn",
|
||||||
|
"-acodec",
|
||||||
|
ffmpegEncoder[options.format],
|
||||||
|
"-ab",
|
||||||
|
options.bitrate || "192k",
|
||||||
|
"-ac",
|
||||||
|
String(options.channels || 2),
|
||||||
|
"-ar",
|
||||||
|
String(options.sampleRate || 44100),
|
||||||
|
outputPath + "." + options.format,
|
||||||
|
];
|
||||||
|
|
||||||
|
const ffmpeg = spawn("ffmpeg", args);
|
||||||
|
|
||||||
|
ffmpeg.stdout.on("data", (data) => {
|
||||||
|
console.log(`ffmpeg stdout: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
ffmpeg.stderr.on("data", (data) => {
|
||||||
|
console.error(`ffmpeg stderr: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
ffmpeg.on("close", (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
reject(new Error(`ffmpeg process exited with code ${code}`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ffmpeg.on("error", (err) => {
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const outputFile = await fs.readFile(outputPath + "." + options.format);
|
||||||
|
|
||||||
|
await Promise.all([
|
||||||
|
fs.unlink(inputPath),
|
||||||
|
fs.unlink(outputPath + "." + options.format),
|
||||||
|
]);
|
||||||
|
|
||||||
|
reply
|
||||||
|
.header("Content-Type", `audio/${options.format}`)
|
||||||
|
.header(
|
||||||
|
"Content-Disposition",
|
||||||
|
`attachment; filename="converted.${options.format}"`,
|
||||||
|
)
|
||||||
|
.send(outputFile);
|
||||||
|
} catch (error) {
|
||||||
|
try {
|
||||||
|
await Promise.all([
|
||||||
|
fs.unlink(inputPath).catch(() => {}),
|
||||||
|
fs
|
||||||
|
.unlink(outputPath + "." + (options?.format || "mp3"))
|
||||||
|
.catch(() => {}),
|
||||||
|
]);
|
||||||
|
} catch (cleanupError) {
|
||||||
|
console.error("Cleanup error:", cleanupError);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error("Conversion error:", error);
|
||||||
|
reply.status(500).send({
|
||||||
|
error: "Error during conversion process",
|
||||||
|
details: error instanceof Error ? error.message : "Unknown error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"allowSyntheticDefaultImports": true
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
frontend/src/app/bg-remover/layout.tsx
Normal file
20
frontend/src/app/bg-remover/layout.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import React from "react";
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
import { toolLinks } from "@/constants";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: toolLinks[6].title,
|
||||||
|
description: "Remove backgrounds from your images!",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body className={`antialiased`}>{children}</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
96
frontend/src/app/bg-remover/page.tsx
Normal file
96
frontend/src/app/bg-remover/page.tsx
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
"use client";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import Navbar from "../../components/Navbar";
|
||||||
|
import Footer from "../../components/Footer";
|
||||||
|
import Button from "../../components/Button";
|
||||||
|
|
||||||
|
export default function BGRemover() {
|
||||||
|
const [file, setFile] = useState<File | null>(null);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (event.target.files && event.target.files.length > 0) {
|
||||||
|
const selectedFile = event.target.files[0];
|
||||||
|
setFile(selectedFile);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeBG = async () => {
|
||||||
|
if (!file) {
|
||||||
|
alert("No file selected");
|
||||||
|
return;
|
||||||
|
} else if (file.size > 5 * 1024 * 1024) {
|
||||||
|
alert("File size should be less than 5MB");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("file", file);
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(process.env.backend_url + "/api/remove-bg", {
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
console.error(`Error: ${response.statusText}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = await response.blob();
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const filename = file.name.split(".")[0];
|
||||||
|
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = `${filename}.png`;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}, 5000);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error while converting:", error);
|
||||||
|
alert("Error while converting!");
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-screen h-auto min-h-screen bg-black text-white font-noto flex flex-col items-center">
|
||||||
|
<Navbar renderHomeLink={true} />
|
||||||
|
<div className="w-screen h-auto min-h-[calc(100vh-80px-60px)] flex flex-1 flex-col items-center justify-center">
|
||||||
|
<h2 className="text-5xl font-bold text-white mb-16">bg-remover</h2>
|
||||||
|
<div className="h-36 flex flex-row items-center justify-center gap-4">
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
className="h-16 border-2 border-white p-3 rounded-xl text-2xl text-center text-white"
|
||||||
|
id="documentUpload"
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={"flex flex-row items-center gap-4 mt-4 mb-16"}>
|
||||||
|
<Button
|
||||||
|
content={
|
||||||
|
loading ? (
|
||||||
|
<div className="h-10 w-10 border-8 border-blue-100 border-t-blue-500 rounded-full animate-spin" />
|
||||||
|
) : (
|
||||||
|
"remove background"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClick={removeBG}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Footer className="flex justify-center items-end" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
20
frontend/src/app/qr-code-generator/layout.tsx
Normal file
20
frontend/src/app/qr-code-generator/layout.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import React from "react";
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
import { toolLinks } from "@/constants";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: toolLinks[4].title,
|
||||||
|
description: "Generator for QR Codes!",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body className={`antialiased`}>{children}</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
107
frontend/src/app/qr-code-generator/page.tsx
Normal file
107
frontend/src/app/qr-code-generator/page.tsx
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
"use client";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import Navbar from "../../components/Navbar";
|
||||||
|
import Footer from "../../components/Footer";
|
||||||
|
import Button from "../../components/Button";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
|
export default function QrCodeGenerator() {
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [QRCodeURL, setQRCodeURL] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const downloadImage = (dataUrl: string) => {
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = dataUrl;
|
||||||
|
link.download = "qrcode.png";
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
};
|
||||||
|
|
||||||
|
const generateQRCode = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
const textInput = (document.getElementById("data") as HTMLInputElement)
|
||||||
|
.value;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(
|
||||||
|
process.env.backend_url + "/api/generate-qrcode",
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
qrcodeContent: textInput,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
console.error("Error while converting");
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
if (data.qrCode) {
|
||||||
|
setQRCodeURL(data.qrCode);
|
||||||
|
downloadImage(data.qrCode);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error while converting:", error);
|
||||||
|
alert("Error while converting");
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function clearInputAndQRCode() {
|
||||||
|
setQRCodeURL("");
|
||||||
|
const data = document.getElementById("data") as HTMLInputElement;
|
||||||
|
data.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-screen h-auto min-h-screen bg-black text-white font-noto flex flex-col items-center">
|
||||||
|
<Navbar renderHomeLink={true} />
|
||||||
|
<div className="w-screen h-auto min-h-[calc(100vh-80px-60px)] flex flex-1 flex-col items-center justify-center">
|
||||||
|
<h2 className="text-5xl font-bold text-white mb-16">
|
||||||
|
qr-code-generator
|
||||||
|
</h2>
|
||||||
|
<div className="flex flex-row items-center justify-center gap-4 mb-6">
|
||||||
|
<input
|
||||||
|
className="h-20 w-64 p-2 rounded-xl text-white bg-black border-2 border-white text-center"
|
||||||
|
type="text"
|
||||||
|
id="data"
|
||||||
|
placeholder="Enter some data to convert!"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={"flex flex-row items-center gap-4 mt-1 mb-10"}>
|
||||||
|
<Button
|
||||||
|
content={
|
||||||
|
loading ? (
|
||||||
|
<div className="h-10 w-10 border-8 border-blue-100 border-t-blue-500 rounded-full animate-spin" />
|
||||||
|
) : (
|
||||||
|
"convert"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClick={generateQRCode}
|
||||||
|
/>
|
||||||
|
<Button content="clear" onClick={clearInputAndQRCode} />
|
||||||
|
</div>
|
||||||
|
<div className="p-3 rounded-xl text-center">
|
||||||
|
{QRCodeURL && (
|
||||||
|
<Image
|
||||||
|
id="output"
|
||||||
|
src={QRCodeURL}
|
||||||
|
alt="QR Code"
|
||||||
|
width={128}
|
||||||
|
height={128}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Footer className="flex justify-center items-end" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ import Navbar from "../../components/Navbar";
|
||||||
import Footer from "../../components/Footer";
|
import Footer from "../../components/Footer";
|
||||||
import Button from "../../components/Button";
|
import Button from "../../components/Button";
|
||||||
|
|
||||||
export default function RgbToHex() {
|
export default function RegexTester() {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [output, setOutput] = useState("");
|
const [output, setOutput] = useState("");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Navbar from "../../components/Navbar";
|
||||||
import Footer from "../../components/Footer";
|
import Footer from "../../components/Footer";
|
||||||
import Button from "../../components/Button";
|
import Button from "../../components/Button";
|
||||||
|
|
||||||
export default function DocConverter() {
|
export default function TMZConverter() {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [convertedTMZ, setConvertedTMZ] = useState("");
|
const [convertedTMZ, setConvertedTMZ] = useState("");
|
||||||
|
|
||||||
|
|
|
||||||
20
frontend/src/app/video-to-audio/layout.tsx
Normal file
20
frontend/src/app/video-to-audio/layout.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import React from "react";
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
import { toolLinks } from "@/constants";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: toolLinks[8].title,
|
||||||
|
description: "Video to audio converter!",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body className={`antialiased`}>{children}</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
178
frontend/src/app/video-to-audio/page.tsx
Normal file
178
frontend/src/app/video-to-audio/page.tsx
Normal file
|
|
@ -0,0 +1,178 @@
|
||||||
|
"use client";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import Navbar from "../../components/Navbar";
|
||||||
|
import Footer from "../../components/Footer";
|
||||||
|
import Button from "../../components/Button";
|
||||||
|
import { ChevronDown, ChevronUp } from "lucide-react";
|
||||||
|
import Dropdown from "@/components/Dropdown";
|
||||||
|
import { videoAudioFormats, videoAudioFormatsTable } from "@/constants";
|
||||||
|
|
||||||
|
export default function DocConverter() {
|
||||||
|
const [file, setFile] = useState<File | null>(null);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [tableOpen, setTableOpen] = useState(false);
|
||||||
|
const [filteredOptions, setFilteredOptions] = useState<string[]>([]);
|
||||||
|
const [selectedOutputFormat, setSelectedOutputFormat] = useState<string | "">(
|
||||||
|
"",
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (event.target.files && event.target.files.length > 0) {
|
||||||
|
const selectedFile = event.target.files[0];
|
||||||
|
const fileExtension = selectedFile.name.split(".").pop()?.toLowerCase();
|
||||||
|
|
||||||
|
const isSupported = videoAudioFormats.some((format) =>
|
||||||
|
format.input.toLowerCase().includes(fileExtension || ""),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!isSupported) {
|
||||||
|
alert("File format not supported!");
|
||||||
|
event.target.value = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setFile(selectedFile);
|
||||||
|
setSelectedOutputFormat("");
|
||||||
|
|
||||||
|
const matchedFormat = videoAudioFormats.find((format) =>
|
||||||
|
format.input.toLowerCase().includes(fileExtension || ""),
|
||||||
|
);
|
||||||
|
setFilteredOptions(matchedFormat ? matchedFormat.output : []);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const convertVideo = async () => {
|
||||||
|
if (!file) {
|
||||||
|
alert("No file selected");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("file", file);
|
||||||
|
formData.append("outputFormat", selectedOutputFormat);
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(
|
||||||
|
process.env.backend_url + "/api/video-to-audio",
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
console.error(`Error: ${response.statusText}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = await response.blob();
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const filename = file.name.split(".")[0];
|
||||||
|
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = `${filename}${selectedOutputFormat}`;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}, 5000);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error while converting:", error);
|
||||||
|
alert("Error while converting!");
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-screen h-auto min-h-screen bg-black text-white font-noto flex flex-col items-center">
|
||||||
|
<Navbar renderHomeLink={true} />
|
||||||
|
<div className="w-screen h-auto min-h-[calc(100vh-80px-60px)] flex flex-1 flex-col items-center justify-center">
|
||||||
|
<h2 className="text-5xl font-bold text-white mb-16">video-to-audio</h2>
|
||||||
|
<div className="h-36 flex flex-row items-center justify-center gap-4">
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
className="h-16 border-2 border-white p-3 rounded-xl text-2xl text-center text-white"
|
||||||
|
id="audioUpload"
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
<Dropdown
|
||||||
|
content={
|
||||||
|
file
|
||||||
|
? `Convert to: ${selectedOutputFormat}`
|
||||||
|
: "output file format"
|
||||||
|
}
|
||||||
|
options={filteredOptions.length > 0 ? filteredOptions : [""]}
|
||||||
|
onClick={(event) => {
|
||||||
|
const selectedFormat =
|
||||||
|
event.currentTarget.textContent?.trim() || "";
|
||||||
|
setSelectedOutputFormat(selectedFormat);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={"flex flex-row items-center gap-4 mt-4 mb-16"}>
|
||||||
|
<Button
|
||||||
|
content={
|
||||||
|
loading ? (
|
||||||
|
<div className="h-10 w-10 border-8 border-blue-100 border-t-blue-500 rounded-full animate-spin" />
|
||||||
|
) : (
|
||||||
|
"convert"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClick={convertVideo}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="overflow-hidden text-xl rounded-lg border border-white mb-16 transition-all duration-300 ease-in-out hover:border-blue-400">
|
||||||
|
<div
|
||||||
|
className="cursor-pointer flex justify-between items-center"
|
||||||
|
onClick={() => setTableOpen(!tableOpen)}
|
||||||
|
>
|
||||||
|
<table className="px-6 py-4 border-b">
|
||||||
|
<thead>
|
||||||
|
<tr className="border-b border-white">
|
||||||
|
<th className="min-w-96 px-6 py-4 border-r border-white">
|
||||||
|
📥 Input Format
|
||||||
|
</th>
|
||||||
|
<th className="min-w-[398px] px-6 py-4 flex flex-row justify-between items-center">
|
||||||
|
<p className="pr-4 mx-auto">📤 Output Format</p>
|
||||||
|
<div className="flex items-end justify-end place-content-end">
|
||||||
|
{tableOpen ? (
|
||||||
|
<ChevronUp className="h-6 w-6" />
|
||||||
|
) : (
|
||||||
|
<ChevronDown className="h-6 w-6" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={`
|
||||||
|
}overflow-hidden transition-all duration-700 ease-in-out ${tableOpen ? "max-h-[900px]" : "max-h-0"}`}
|
||||||
|
>
|
||||||
|
<table className="w-full h-auto text-left border-collapse border-white">
|
||||||
|
<tbody>
|
||||||
|
{videoAudioFormatsTable.map((format) => (
|
||||||
|
<tr key={format.input} className="border-b">
|
||||||
|
<td className="w-96 px-6 py-4 border-r">{format.input}</td>
|
||||||
|
<td className="px-6 py-4">{format.output.join(", ")}</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Footer className="flex justify-center items-end" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -154,3 +154,33 @@ export const FileFormatsTable = [
|
||||||
output: [".pdf", ".ppt", ".pptx"],
|
output: [".pdf", ".ppt", ".pptx"],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const videoAudioFormats = [
|
||||||
|
{
|
||||||
|
input: ".mp4",
|
||||||
|
output: [".mp3", ".wav", ".aac"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: ".avi",
|
||||||
|
output: [".mp3", ".wav", ".aac"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: ".mov",
|
||||||
|
output: [".mp3", ".wav", ".aac"],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const videoAudioFormatsTable = [
|
||||||
|
{
|
||||||
|
input: ".mp4 (MPEG-4)",
|
||||||
|
output: [".mp3", ".wav", ".aac"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: ".avi (Audio Video Interleave)",
|
||||||
|
output: [".mp3", ".wav", ".aac"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: ".mov (Apple QuickTime Movie)",
|
||||||
|
output: [".mp3", ".wav", ".aac"],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue