mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-29 13:48:46 +02:00
Updated Dependencies, Makefiles for build process, Docker Images for Front & Backend
This commit is contained in:
parent
734c871666
commit
f3697a18e3
@ -3,10 +3,13 @@ FROM node:22.2.0-alpine
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --legacy-peer-deps
|
||||||
|
|
||||||
RUN npm i -g serve
|
RUN npm i -g serve
|
||||||
|
|
||||||
COPY ./dist ./dist
|
COPY ./dist ./dist
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD [ "serve", "-s", "dist" ]
|
CMD [ "serve", "-s", "dist", "-p", "3000" ]
|
13
client-tauri/Makefile
Normal file
13
client-tauri/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
vite-build:
|
||||||
|
npx tsc
|
||||||
|
npx vite build
|
||||||
|
|
||||||
|
vite-dockerize:
|
||||||
|
make vite-build
|
||||||
|
bash -c "cp ../package-lock.json ./"
|
||||||
|
docker build . -t stirling-pdf:latest
|
||||||
|
bash -c "rm ./package-lock.json"
|
||||||
|
docker image prune
|
||||||
|
|
||||||
|
tauri-build:
|
||||||
|
npx tauri build
|
@ -1,3 +1,11 @@
|
|||||||
# Stirling-PDF frontend
|
# Stirling-PDF frontend
|
||||||
|
|
||||||
Tauri + Vite + React + Typescript
|
Tauri + Vite + React + Typescript
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Use the package scripts to start developement
|
||||||
|
|
||||||
|
## Production
|
||||||
|
|
||||||
|
Use the make file to build for the correct platform
|
@ -5,16 +5,14 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"vite:dev": "vite",
|
"vite:dev": "vite",
|
||||||
"vite:build": "tsc && vite build",
|
"vite:preview-prod": "make vite-build && vite preview",
|
||||||
"vite:preview-build": "vite preview",
|
"tauri:build-debug": "npx tauri build --debug",
|
||||||
"vite:dockerize-build": "docker build . -t stirling-pdf:latest",
|
"tauri:dev": "tauri dev"
|
||||||
"tauri:dev (currently broken)": "tauri dev",
|
|
||||||
"tauri:build-debug": "tauri build --debug",
|
|
||||||
"tauri:build": "tauri build"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@stirling-pdf/shared-operations": "^0.0.0",
|
"@stirling-pdf/shared-operations": "^0.0.0",
|
||||||
"@tauri-apps/api": "^1.5.1",
|
"@tauri-apps/api": "^1.5.1",
|
||||||
|
"@types/semver": "^7.5.8",
|
||||||
"archiver": "^6.0.1",
|
"archiver": "^6.0.1",
|
||||||
"i18next": "^23.6.0",
|
"i18next": "^23.6.0",
|
||||||
"i18next-browser-languagedetector": "^7.1.0",
|
"i18next-browser-languagedetector": "^7.1.0",
|
||||||
@ -22,23 +20,23 @@
|
|||||||
"pdfjs-dist": "^4.0.189",
|
"pdfjs-dist": "^4.0.189",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-i18next": "^13.3.1",
|
"react-i18next": "^15.0.1",
|
||||||
"react-icons": "^4.11.0",
|
"react-icons": "^4.11.0",
|
||||||
"react-material-symbols": "^4.4.0",
|
"react-material-symbols": "^4.4.0",
|
||||||
"react-router-bootstrap": "^0.26.2",
|
"react-router-bootstrap": "^0.26.2",
|
||||||
"react-router-dom": "^6.18.0",
|
"react-router-dom": "^6.18.0",
|
||||||
"vite-plugin-node-polyfills": "^0.21.0",
|
"vite": "^5.4.2",
|
||||||
|
"vite-plugin-node-polyfills": "^0.22.0",
|
||||||
"vite-plugin-top-level-await": "^1.3.1"
|
"vite-plugin-top-level-await": "^1.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^1.5.0",
|
"@tauri-apps/cli": "^1.5.0",
|
||||||
"@types/archiver": "^5.3.4",
|
"@types/archiver": "^6.0.2",
|
||||||
"@types/react": "^18.2.15",
|
"@types/react": "^18.2.15",
|
||||||
"@types/react-dom": "^18.2.7",
|
"@types/react-dom": "^18.2.7",
|
||||||
"@types/react-router-bootstrap": "^0.26.5",
|
"@types/react-router-bootstrap": "^0.26.5",
|
||||||
"@vitejs/plugin-react": "^4.0.3",
|
"@vitejs/plugin-react": "^4.3.1",
|
||||||
"typescript": "^5.0.2",
|
"typescript": "^5.0.2",
|
||||||
"vite": "^4.4.4",
|
|
||||||
"vite-plugin-compile-time": "^0.2.1",
|
"vite-plugin-compile-time": "^0.2.1",
|
||||||
"vite-plugin-dynamic-import": "^1.5.0"
|
"vite-plugin-dynamic-import": "^1.5.0"
|
||||||
}
|
}
|
||||||
|
2
client-tauri/src-tauri/Cargo.lock
generated
2
client-tauri/src-tauri/Cargo.lock
generated
@ -4,7 +4,7 @@ version = 3
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "StirlingPDF"
|
name = "StirlingPDF"
|
||||||
version = "0.0.1"
|
version = "2.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "StirlingPDF"
|
name = "StirlingPDF"
|
||||||
# version = "2.0.0"
|
version = "2.0.0" # needed for dev build?
|
||||||
description = "Selfhosted PDF processing"
|
description = "Selfhosted PDF processing"
|
||||||
authors = ["LaserKaspar, SaudF"]
|
authors = ["LaserKaspar, SaudF"]
|
||||||
license = ""
|
license = ""
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run vite:dev",
|
||||||
"beforeBuildCommand": "npm run build",
|
"beforeBuildCommand": "make vite-build",
|
||||||
"devPath": "http://localhost:1420",
|
"devPath": "http://localhost:1420",
|
||||||
"distDir": "../dist",
|
"distDir": "../dist",
|
||||||
"withGlobalTauri": false
|
"withGlobalTauri": false
|
||||||
|
1728
package-lock.json
generated
1728
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
server-node/Dockerfile
Normal file
19
server-node/Dockerfile
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Use an existing image as a base
|
||||||
|
FROM node:22.2.0-alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --legacy-peer-deps
|
||||||
|
|
||||||
|
COPY ./dist ./dist
|
||||||
|
|
||||||
|
RUN apk del git
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
CMD [ "node", "./dist/index.js" ]
|
10
server-node/Makefile
Normal file
10
server-node/Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
vite-build:
|
||||||
|
npx tsc
|
||||||
|
npx vite build
|
||||||
|
|
||||||
|
vite-dockerize:
|
||||||
|
make vite-build
|
||||||
|
bash -c "cp ../package-lock.json ./"
|
||||||
|
docker build . -t stirling-pdf-backend:latest
|
||||||
|
bash -c "rm ./package-lock.json"
|
||||||
|
docker image prune
|
@ -11,19 +11,17 @@
|
|||||||
"canvas": "^2.11.2"
|
"canvas": "^2.11.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"vite:dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"vite:preview-prod": "make vite-build && node ./dist/index.js"
|
||||||
"start": "node ./dist/index.js"
|
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@esbuild/win32-x64": "^0.19.10",
|
|
||||||
"@rollup/plugin-alias": "^5.1.0",
|
"@rollup/plugin-alias": "^5.1.0",
|
||||||
"@rollup/plugin-commonjs": "^25.0.7",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@types/archiver": "^6.0.1",
|
"@stirling-tools/joi": "github:stirling-tools/joi",
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
"@types/multer": "^1.4.10",
|
"@types/multer": "^1.4.10",
|
||||||
"@wasmer/wasmfs": "^0.12.0",
|
"@wasmer/wasmfs": "^0.12.0",
|
||||||
@ -32,6 +30,8 @@
|
|||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-fileupload": "^1.4.2",
|
"express-fileupload": "^1.4.2",
|
||||||
"express-session": "^1.18.0",
|
"express-session": "^1.18.0",
|
||||||
|
"i18next": "^23.14.0",
|
||||||
|
"i18next-resources-to-backend": "^1.2.1",
|
||||||
"joi": "^17.11.0",
|
"joi": "^17.11.0",
|
||||||
"jsqr": "^1.4.0",
|
"jsqr": "^1.4.0",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
@ -39,30 +39,32 @@
|
|||||||
"passport-headerapikey": "^1.2.2",
|
"passport-headerapikey": "^1.2.2",
|
||||||
"passport-local": "^1.0.0",
|
"passport-local": "^1.0.0",
|
||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
|
"pdfjs-dist": "^4.5.136",
|
||||||
|
"react-material-symbols": "^4.4.0",
|
||||||
"rollup-plugin-copy": "^3.5.0",
|
"rollup-plugin-copy": "^3.5.0",
|
||||||
"rollup-plugin-dynamic-import-variables": "^1.1.0",
|
"rollup-plugin-dynamic-import-variables": "^1.1.0",
|
||||||
"sequelize": "^6.37.3",
|
"sequelize": "^6.37.3",
|
||||||
"sqlite3": "^5.1.7",
|
"sqlite3": "^5.1.7",
|
||||||
"toml": "^3.0.0",
|
"toml": "^3.0.0",
|
||||||
"tsconfig-paths": "^4.2.0",
|
"tsconfig-paths": "^4.2.0",
|
||||||
|
"vite": "^5.4.2",
|
||||||
"vite-plugin-compile-time": "^0.2.1",
|
"vite-plugin-compile-time": "^0.2.1",
|
||||||
"vite-plugin-dynamic-import": "^1.5.0",
|
"vite-plugin-dynamic-import": "^1.5.0",
|
||||||
"vite-plugin-node-polyfills": "^0.19.0",
|
"vite-plugin-node-polyfills": "^0.22.0",
|
||||||
"vite-plugin-top-level-await": "^1.4.1"
|
"vite-plugin-top-level-await": "^1.4.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
||||||
"@rollup/plugin-run": "^3.0.2",
|
"@rollup/plugin-run": "^3.0.2",
|
||||||
"@rollup/plugin-typescript": "^11.1.6",
|
"@rollup/plugin-typescript": "^11.1.6",
|
||||||
|
"@types/archiver": "^6.0.2",
|
||||||
"@types/express-session": "^1.18.0",
|
"@types/express-session": "^1.18.0",
|
||||||
"@types/passport-local": "^1.0.38",
|
"@types/passport-local": "^1.0.38",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"pkgroll": "^2.0.1",
|
"pkgroll": "^2.0.1",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"rollup": "^4.9.6",
|
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.5.4",
|
||||||
"vite": "^5.2.11",
|
|
||||||
"vite-plugin-node": "^3.1.0"
|
"vite-plugin-node": "^3.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// viteNode
|
// viteNode
|
||||||
if (import.meta.env.VITE_PROD) {
|
if (import.meta.env.PROD) {
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
console.log(`http://localhost:${PORT}`);
|
console.log(`http://localhost:${PORT}`);
|
||||||
});
|
});
|
||||||
|
@ -19,8 +19,8 @@ export async function validateOperations(actions: Action[]): Promise<{ valid: bo
|
|||||||
return { valid: false, reason: `action.type ${action.type} does not exist` };
|
return { valid: false, reason: `action.type ${action.type} does not exist` };
|
||||||
}
|
}
|
||||||
const schema = await getSchemaByName(action.type);
|
const schema = await getSchemaByName(action.type);
|
||||||
if(!operator) {
|
if(!schema) {
|
||||||
return { valid: false, reason: `action.type ${action.type} does not exist` };
|
return { valid: false, reason: `schema for action.type ${action.type} does not exist` };
|
||||||
}
|
}
|
||||||
const validationResult = schema.schema.validate({values: action.values});
|
const validationResult = schema.schema.validate({values: action.values});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user