Datei-Struktur ordentlich bereinigt

This commit is contained in:
2025-09-24 19:29:16 +00:00
parent fbed816204
commit ef4ab9e800
98 changed files with 247 additions and 1024 deletions

View File

@@ -57,7 +57,7 @@ jobs:
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: ./nodejs-version/backend
context: ./backend
push: true
tags: ${{ steps.meta-backend.outputs.tags }}
labels: ${{ steps.meta-backend.outputs.labels }}
@@ -65,7 +65,7 @@ jobs:
- name: Build and push frontend image
uses: docker/build-push-action@v5
with:
context: ./nodejs-version/frontend
context: ./frontend
build-args: |
VITE_API_BASE_URL=${{ secrets.PRODUCTION_API_URL || 'https://yourdomain.com/api' }}
push: true

4
.gitignore vendored
View File

@@ -1,3 +1,3 @@
JS/node_modules/
nodejs-version/backend/node_modules
nodejs-version/frontend/node_modules
backend/node_modules
frontend/node_modules

View File

@@ -72,7 +72,7 @@ services:
backend:
build:
context: ./nodejs-version/backend
context: ./backend
dockerfile: Dockerfile
container_name: rezepte-backend-prod
restart: unless-stopped
@@ -98,7 +98,7 @@ services:
frontend:
build:
context: ./nodejs-version/frontend
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_BASE_URL=https://yourdomain.com/api

View File

@@ -10,8 +10,8 @@
echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_USERNAME --password-stdin
# Images taggen und pushen
docker build -t ghcr.io/YOUR_USERNAME/rezepte-backend:latest ./nodejs-version/backend
docker build -t ghcr.io/YOUR_USERNAME/rezepte-frontend:latest ./nodejs-version/frontend
docker build -t ghcr.io/YOUR_USERNAME/rezepte-backend:latest ./backend
docker build -t ghcr.io/YOUR_USERNAME/rezepte-frontend:latest ./frontend
docker push ghcr.io/YOUR_USERNAME/rezepte-backend:latest
docker push ghcr.io/YOUR_USERNAME/rezepte-frontend:latest
@@ -23,8 +23,8 @@ docker push ghcr.io/YOUR_USERNAME/rezepte-frontend:latest
docker login
# Images taggen und pushen
docker build -t YOUR_USERNAME/rezepte-backend:latest ./nodejs-version/backend
docker build -t YOUR_USERNAME/rezepte-frontend:latest ./nodejs-version/frontend
docker build -t YOUR_USERNAME/rezepte-backend:latest ./backend
docker build -t YOUR_USERNAME/rezepte-frontend:latest ./frontend
docker push YOUR_USERNAME/rezepte-backend:latest
docker push YOUR_USERNAME/rezepte-frontend:latest
@@ -36,8 +36,8 @@ docker push YOUR_USERNAME/rezepte-frontend:latest
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com
# Images taggen und pushen
docker build -t YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com/rezepte-backend:latest ./nodejs-version/backend
docker build -t YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com/rezepte-frontend:latest ./nodejs-version/frontend
docker build -t YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com/rezepte-backend:latest ./backend
docker build -t YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com/rezepte-frontend:latest ./frontend
docker push YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com/rezepte-backend:latest
docker push YOUR_ACCOUNT.dkr.ecr.eu-central-1.amazonaws.com/rezepte-frontend:latest
@@ -90,14 +90,14 @@ jobs:
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: ./nodejs-version/backend
context: ./backend
push: true
tags: ghcr.io/${{ github.repository }}/backend:${{ github.sha }},ghcr.io/${{ github.repository }}/backend:latest
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: ./nodejs-version/frontend
context: ./frontend
push: true
tags: ghcr.io/${{ github.repository }}/frontend:${{ github.sha }},ghcr.io/${{ github.repository }}/frontend:latest

View File

@@ -109,7 +109,7 @@ Für lokale Entwicklung:
cp .env.development .env
# Backend starten
cd nodejs-version/backend
cd backend
npm install
npm run dev

832
JS/package-lock.json generated
View File

@@ -1,832 +0,0 @@
{
"name": "observatory-sim",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "observatory-sim",
"version": "1.0.0",
"dependencies": {
"express": "^4.18.2"
}
},
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
"license": "MIT",
"dependencies": {
"mime-types": "~2.1.34",
"negotiator": "0.6.3"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
"license": "MIT"
},
"node_modules/body-parser": {
"version": "1.20.3",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
"integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
"license": "MIT",
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.5",
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
"qs": "6.13.0",
"raw-body": "2.5.2",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
},
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/call-bind-apply-helpers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/call-bound": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
"get-intrinsic": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"license": "MIT",
"dependencies": {
"safe-buffer": "5.2.1"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/content-type": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==",
"license": "MIT"
},
"node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"license": "MIT",
"dependencies": {
"ms": "2.0.0"
}
},
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/destroy": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
"license": "MIT",
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
"license": "MIT"
},
"node_modules/encodeurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/es-define-property": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-object-atoms": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
"license": "MIT"
},
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/express": {
"version": "4.21.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.7.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.3.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
"merge-descriptors": "1.0.3",
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.12",
"proxy-addr": "~2.0.7",
"qs": "6.13.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
"send": "0.19.0",
"serve-static": "1.16.2",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"engines": {
"node": ">= 0.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/finalhandler": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
"integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
"license": "MIT",
"dependencies": {
"debug": "2.6.9",
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"statuses": "2.0.1",
"unpipe": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
"es-define-property": "^1.0.1",
"es-errors": "^1.3.0",
"es-object-atoms": "^1.1.1",
"function-bind": "^1.1.2",
"get-proto": "^1.0.1",
"gopd": "^1.2.0",
"has-symbols": "^1.1.0",
"hasown": "^2.0.2",
"math-intrinsics": "^1.1.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
"license": "MIT",
"dependencies": {
"dunder-proto": "^1.0.1",
"es-object-atoms": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
"license": "MIT",
"dependencies": {
"depd": "2.0.0",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"toidentifier": "1.0.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"license": "ISC"
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
"license": "MIT",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/merge-descriptors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
"integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"license": "MIT",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT"
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/object-inspect": {
"version": "1.13.4",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"license": "MIT",
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/path-to-regexp": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
"license": "MIT"
},
"node_modules/proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
"license": "MIT",
"dependencies": {
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/qs": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
"integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
"license": "BSD-3-Clause",
"dependencies": {
"side-channel": "^1.0.6"
},
"engines": {
"node": ">=0.6"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/raw-body": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
"integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
"license": "MIT",
"dependencies": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
"node_modules/send": {
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
"integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
"license": "MIT",
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
"mime": "1.6.0",
"ms": "2.1.3",
"on-finished": "2.4.1",
"range-parser": "~1.2.1",
"statuses": "2.0.1"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/send/node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
"node_modules/serve-static": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
"integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
"license": "MIT",
"dependencies": {
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.19.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
"license": "ISC"
},
"node_modules/side-channel": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.3",
"side-channel-list": "^1.0.0",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/side-channel-list": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/side-channel-map": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
"license": "MIT",
"dependencies": {
"call-bound": "^1.0.2",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.5",
"object-inspect": "^1.13.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/side-channel-weakmap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
"license": "MIT",
"dependencies": {
"call-bound": "^1.0.2",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.5",
"object-inspect": "^1.13.3",
"side-channel-map": "^1.0.1"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
"license": "MIT",
"engines": {
"node": ">=0.6"
}
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"license": "MIT",
"dependencies": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
"license": "MIT",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
}
}
}

View File

@@ -1,11 +0,0 @@
{
"name": "observatory-sim",
"version": "1.0.0",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.18.2"
}
}

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<title>Kuppel-Simulation (JS)</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h2>Kuppel-Simulation mit NFC-Tags (JavaScript)</h2>
<canvas id="simCanvas" width="700" height="700"></canvas>
<pre id="debug"></pre>
<script src="script.js"></script>
</body>
</html>

View File

@@ -1,120 +0,0 @@
const canvas = document.getElementById("simCanvas");
const ctx = canvas.getContext("2d");
const WIDTH = 700;
const HEIGHT = 700;
const CENTER = { x: WIDTH / 2, y: HEIGHT / 2 };
const RADIUS = 260;
let TAG_COUNT = 36;
let TAG_STEP = 360 / TAG_COUNT;
let telescopeAngle = 0.0;
let domeAngle = TAG_STEP / 2; // aktuelle Position
let targetDomeAngle = domeAngle;
let slotWidth = 20.0;
let domeSpeed = 1.0; // ° pro Frame
let state = "IDLE"; // "IDLE" oder "MOVING"
function angleDiff(target, source) {
let d = (target - source + 180) % 360 - 180;
return d;
}
function getTagIndex(angle) {
return Math.floor((angle % 360) / TAG_STEP);
}
function tagToAngle(idx) {
return idx * TAG_STEP + TAG_STEP / 2;
}
// Tastatursteuerung
document.addEventListener("keydown", (e) => {
if (e.key === "ArrowLeft") telescopeAngle = (telescopeAngle - 2.5 + 360) % 360;
if (e.key === "ArrowRight") telescopeAngle = (telescopeAngle + 2.5) % 360;
});
function update() {
let diff = angleDiff(telescopeAngle, domeAngle);
let halfSlot = slotWidth / 2;
let moveDir = "STOP";
if (state === "IDLE") {
// Prüfen, ob Teleskop aus Schlitz läuft
if (diff > halfSlot) {
// CW-Bewegung → Kuppel muss eine Spaltbreite weiter drehen
targetDomeAngle = (domeAngle + slotWidth) % 360;
state = "MOVING";
} else if (diff < -halfSlot) {
// CCW-Bewegung → Kuppel muss eine Spaltbreite zurück
targetDomeAngle = (domeAngle - slotWidth + 360) % 360;
state = "MOVING";
}
}
if (state === "MOVING") {
let delta = angleDiff(targetDomeAngle, domeAngle);
if (Math.abs(delta) > domeSpeed) {
domeAngle = (domeAngle + Math.sign(delta) * domeSpeed + 360) % 360;
moveDir = Math.sign(delta) > 0 ? "+" : "-";
} else {
domeAngle = targetDomeAngle;
state = "IDLE";
}
}
let activeTag = getTagIndex(domeAngle);
draw(activeTag, diff, moveDir);
requestAnimationFrame(update);
}
function draw(activeTag, diff, moveDir) {
ctx.clearRect(0, 0, WIDTH, HEIGHT);
// Tags
for (let i = 0; i < TAG_COUNT; i++) {
let a = (-2 * Math.PI * i) / TAG_COUNT;
let x = CENTER.x + Math.cos(a) * RADIUS;
let y = CENTER.y + Math.sin(a) * RADIUS;
ctx.beginPath();
ctx.arc(x, y, i === activeTag ? 6 : 3, 0, 2 * Math.PI);
ctx.fillStyle = i === activeTag ? "green" : "black";
ctx.fill();
}
// Spaltbogen
let midAngle = -domeAngle * (Math.PI / 180);
let half = (slotWidth / 2) * (Math.PI / 180);
ctx.beginPath();
ctx.strokeStyle = "blue";
ctx.lineWidth = 12;
ctx.arc(CENTER.x, CENTER.y, RADIUS, midAngle - half, midAngle + half);
ctx.stroke();
// Teleskop
let tx = CENTER.x + Math.cos((-telescopeAngle * Math.PI) / 180) * (RADIUS - 60);
let ty = CENTER.y + Math.sin((-telescopeAngle * Math.PI) / 180) * (RADIUS - 60);
ctx.beginPath();
ctx.moveTo(CENTER.x, CENTER.y);
ctx.lineTo(tx, ty);
ctx.strokeStyle = "red";
ctx.lineWidth = 6;
ctx.stroke();
ctx.beginPath();
ctx.arc(tx, ty, 8, 0, 2 * Math.PI);
ctx.fillStyle = "red";
ctx.fill();
// Debug
document.getElementById("debug").textContent =
`Telescope: ${telescopeAngle.toFixed(1)}°\n` +
`Dome: ${domeAngle.toFixed(1)}°\n` +
`Target: ${targetDomeAngle.toFixed(1)}°\n` +
`Diff: ${diff.toFixed(2)}°\n` +
`Active Tag: ${activeTag}\n` +
`Move: ${moveDir}\n` +
`State: ${state}`;
}
// Start
update();

View File

@@ -1,9 +0,0 @@
const express = require("express");
const app = express();
const port = 3000;
app.use(express.static("public"));
app.listen(port, () => {
console.log(`Observatory simulation running at http://localhost:${port}`);
});

209
NODEJS_README.md Normal file
View File

@@ -0,0 +1,209 @@
# Modern Recipe Management System
A complete modern web application built with Node.js, TypeScript, React, and MySQL - a modern alternative to the existing PHP application.
## 🚀 Architecture Overview
### Backend (Node.js + TypeScript)
- **Express.js** REST API server
- **Prisma ORM** for type-safe database access
- **TypeScript** for development safety
- **MySQL** database (shared with PHP version)
- **Security** middleware (Helmet, CORS, rate limiting)
### Frontend (React + TypeScript)
- **React 18** with functional components and hooks
- **TypeScript** for type safety
- **Vite** for fast development and building
- **React Router** for client-side routing
- **Axios** for API communication
- **Modern CSS** with responsive design
### Database
- **MySQL 8.0** (same database as PHP version)
- **Prisma** schema mapped to existing tables
- **Compatible** with current PHP application
## 🌐 Live URLs
- **React Frontend**: http://localhost:5173
- **Node.js API**: http://localhost:3001
- **PHP Application**: http://localhost:8082 (when Docker is running)
- **phpMyAdmin**: http://localhost:8083 (when Docker is running)
## <20> Quick Start
### 1. Start the Database (existing Docker setup)
```bash
# From main project directory
docker-compose up -d
```
### 2. Start the Node.js Backend
```bash
cd backend
npm install
npm run build
node dist/app.js
```
### 3. Start the React Frontend
```bash
cd frontend
npm install
npm run dev
```
## 📱 Features Implemented
### ✅ Backend API
- **Health Check** - Server status endpoint
- **Recipe Management** - Full CRUD operations with search/pagination
- **Ingredient Management** - CRUD operations for recipe ingredients
- **Image Serving** - Static file serving for recipe images
- **Input Validation** - Joi schema validation
- **Error Handling** - Centralized error management
- **Security** - CORS, Helmet, rate limiting, input sanitization
### ✅ Frontend Application
- **Recipe List** - Grid view with search, filtering, pagination
- **Responsive Design** - Mobile-first CSS design
- **Image Display** - Recipe images with fallback handling
- **Navigation** - Clean header with route navigation
- **Search & Filter** - Real-time search and category filtering
- **Error Handling** - User-friendly error messages
- **Loading States** - Visual feedback for API calls
## 🎯 Current Status
### ✅ **COMPLETED**
- Node.js backend with TypeScript
- Prisma ORM with existing database schema
- Complete REST API for recipes, ingredients, images
- React frontend with modern UI
- Database integration working
- Both servers running successfully
- API endpoints tested and working
- Responsive design implemented
### 🔄 **Next Steps**
1. **Recipe Detail View** - Individual recipe pages
2. **Recipe Creation/Editing** - Forms for CRUD operations
3. **Image Upload** - File upload functionality
4. **Ingredient Management** - Dedicated ingredient pages
5. **Docker Configuration** - Containerize Node.js stack
6. **Performance Optimization** - Caching, lazy loading
7. **Testing** - Unit and integration tests
## 📊 API Endpoints
### Recipes
- `GET /api/recipes` - List recipes (pagination, search, filter)
- `GET /api/recipes/:id` - Get single recipe
- `POST /api/recipes` - Create recipe
- `PUT /api/recipes/:id` - Update recipe
- `DELETE /api/recipes/:id` - Delete recipe
### Ingredients
- `GET /api/ingredients` - List ingredients
- `GET /api/ingredients/:id` - Get single ingredient
- `POST /api/ingredients` - Create ingredient
- `PUT /api/ingredients/:id` - Update ingredient
- `DELETE /api/ingredients/:id` - Delete ingredient
### Images
- `GET /api/images/recipe/:recipeId` - Get recipe images
- `GET /api/images/serve/:imagePath` - Serve image file
- `GET /api/images/:id` - Get image metadata
### Health
- `GET /api/health` - Server health check
## 🔧 Development Commands
### Backend
```bash
cd backend
# Development
npm run dev # Start with hot reload (if ts-node configured)
npm run build # Build TypeScript
npm start # Start production server
node dist/app.js # Direct node execution
# Database
npm run db:generate # Generate Prisma client
npm run db:push # Push schema to database
npm run db:studio # Open Prisma Studio GUI
```
### Frontend
```bash
cd frontend
# Development
npm run dev # Start Vite dev server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
```
## <20> Technology Benefits
### vs. PHP Version
- **Type Safety** - TypeScript eliminates runtime type errors
- **Modern Tooling** - Better developer experience with Vite, ESLint, Prettier
- **API-First** - Clean separation enables mobile apps, integrations
- **Maintainability** - Modern patterns, better error handling
- **Performance** - React SPA, optimized builds, lazy loading
- **Security** - Modern security best practices built-in
### Architecture Advantages
- **Separation of Concerns** - API backend, UI frontend
- **Scalability** - Horizontal scaling, microservices ready
- **Testing** - Unit tests, integration tests, E2E tests possible
- **Deployment** - Modern CI/CD, containerization, cloud deployment
- **Extensibility** - Add mobile apps, integrations, webhooks
## <20> Integration Options
### 1. **Parallel Operation** (Current)
- PHP app on port 8082
- Node.js API on port 3001
- React app on port 5173
- Same MySQL database
### 2. **Gradual Migration**
- Move features one by one from PHP to Node.js
- Use API versioning for compatibility
- Migrate users gradually
### 3. **Complete Replacement**
- Full React frontend + Node.js backend
- Retire PHP application
- Modern deployment stack
## <20> UI/UX Features
- **Modern Design** - Clean, professional interface
- **Responsive** - Mobile, tablet, desktop optimized
- **Fast** - React SPA with instant navigation
- **Search** - Real-time recipe search
- **Filtering** - Category-based filtering
- **Pagination** - Efficient large dataset handling
- **Images** - Recipe photo display with fallbacks
- **Navigation** - Intuitive menu structure
- **Feedback** - Loading states, error messages
- **Accessibility** - Semantic HTML, keyboard navigation
## <20> Deployment Ready
The application is ready for production deployment with:
- **Environment Configuration** - .env files for different environments
- **Build Process** - Optimized production builds
- **Static Assets** - Vite optimization for frontend
- **Security** - Production-ready security headers
- **Error Handling** - Graceful error recovery
- **Monitoring** - Health checks, logging endpoints
This modern stack provides a solid foundation for scaling the recipe management system with contemporary web technologies while maintaining compatibility with your existing data and workflows.

View File

@@ -34,7 +34,7 @@ fi
# Build backend
echo "🔨 Building backend image..."
docker build -t "$BACKEND_IMAGE" ./nodejs-version/backend
docker build -t "$BACKEND_IMAGE" ./backend
# Build frontend (with production API URL)
echo "🔨 Building frontend image..."
@@ -42,12 +42,12 @@ if [ -n "$API_BASE_URL" ]; then
docker build \
--build-arg VITE_API_BASE_URL="$API_BASE_URL" \
-t "$FRONTEND_IMAGE" \
./nodejs-version/frontend
./frontend
else
docker build \
--build-arg VITE_API_BASE_URL="https://${DOMAIN:-yourdomain.com}/api" \
-t "$FRONTEND_IMAGE" \
./nodejs-version/frontend
./frontend
fi
# Push images

View File

@@ -27,7 +27,7 @@ services:
backend:
build:
context: ./nodejs-version/backend
context: ./backend
dockerfile: Dockerfile
container_name: rezepte-backend-dev
restart: unless-stopped
@@ -43,8 +43,8 @@ services:
# Mount existing uploads from host for development
- ./upload:/app/uploads:ro
# Development: Mount source code for hot reload
- ./nodejs-version/backend/src:/app/src:ro
- ./nodejs-version/backend/prisma:/app/prisma:ro
- ./backend/src:/app/src:ro
- ./backend/prisma:/app/prisma:ro
depends_on:
mysql:
condition: service_healthy
@@ -58,7 +58,7 @@ services:
frontend:
build:
context: ./nodejs-version/frontend
context: ./frontend
dockerfile: Dockerfile
container_name: rezepte-frontend-dev
restart: unless-stopped

View File

@@ -24,7 +24,7 @@ services:
# Backend API
backend:
build:
context: ./nodejs-version/backend
context: ./backend
dockerfile: Dockerfile
container_name: rezepte-backend
environment:
@@ -56,7 +56,7 @@ services:
# Frontend Application
frontend:
build:
context: ./nodejs-version/frontend
context: ./frontend
dockerfile: Dockerfile
args:
# Use host IP instead of localhost for API calls

View File

@@ -24,7 +24,7 @@ services:
# Backend API
backend:
build:
context: ./nodejs-version/backend
context: ./backend
dockerfile: Dockerfile
container_name: rezepte-backend
environment:
@@ -55,7 +55,7 @@ services:
# Frontend Application
frontend:
build:
context: ./nodejs-version/frontend
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: http://localhost:3001/api

View File

@@ -26,7 +26,7 @@ services:
backend:
build:
context: ./nodejs-version/backend
context: ./backend
dockerfile: Dockerfile
container_name: rezepte-backend-prod
restart: unless-stopped
@@ -55,7 +55,7 @@ services:
frontend:
build:
context: ./nodejs-version/frontend
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_BASE_URL=${API_BASE_URL:-http://localhost:3001/api}

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -41,7 +41,7 @@ docker-compose up -d
### 2. Start the Node.js Backend
```bash
cd nodejs-version/backend
cd backend
npm install
npm run build
node dist/app.js
@@ -49,7 +49,7 @@ node dist/app.js
### 3. Start the React Frontend
```bash
cd nodejs-version/frontend
cd frontend
npm install
npm run dev
```
@@ -123,7 +123,7 @@ npm run dev
### Backend
```bash
cd nodejs-version/backend
cd backend
# Development
npm run dev # Start with hot reload (if ts-node configured)
@@ -139,7 +139,7 @@ npm run db:studio # Open Prisma Studio GUI
### Frontend
```bash
cd nodejs-version/frontend
cd frontend
# Development
npm run dev # Start Vite dev server

View File

@@ -41,7 +41,7 @@ fi
# Backend Setup
echo -e "${BLUE}🔧 Backend Setup...${NC}"
cd nodejs-version/backend
cd backend
if [ ! -d node_modules ]; then
echo -e "${YELLOW}📦 Installiere Backend Dependencies...${NC}"
@@ -82,7 +82,7 @@ echo ""
echo -e "${BLUE}Development Server starten:${NC}"
echo ""
echo -e "${YELLOW}Backend (Terminal 1):${NC}"
echo " cd nodejs-version/backend"
echo " cd backend"
echo " npm run dev"
echo ""
echo -e "${YELLOW}Frontend (Terminal 2):${NC}"

View File

@@ -113,7 +113,7 @@ services:
backend:
build:
context: ./nodejs-version/backend
context: ./backend
dockerfile: Dockerfile
container_name: rezepte-backend-dev
restart: unless-stopped
@@ -129,8 +129,8 @@ services:
# Mount existing uploads from host for development
- ./uploads:/app/uploads:ro
# Development: Mount source code for hot reload
- ./nodejs-version/backend/src:/app/src:ro
- ./nodejs-version/backend/prisma:/app/prisma:ro
- ./backend/src:/app/src:ro
- ./backend/prisma:/app/prisma:ro
depends_on:
mysql:
condition: service_healthy
@@ -144,7 +144,7 @@ services:
frontend:
build:
context: ./nodejs-version/frontend
context: ./frontend
dockerfile: Dockerfile
container_name: rezepte-frontend-dev
restart: unless-stopped