Compare commits

..

10 Commits
v0.5.0 ... main

Author SHA1 Message Date
478578308d changed noting 2025-10-26 17:15:08 +01:00
93a52aa196 changed production routing for frontend build 2025-10-26 16:56:50 +01:00
donpat1to
b11c55c1d9 Update docker.yml 2025-10-26 16:13:43 +01:00
16302f2105 changed tagging logic for latest versions 2025-10-26 16:09:02 +01:00
57aff5c858 changed tagging logic for latest versions 2025-10-26 16:07:52 +01:00
b4abe459c2 changed tagging logic for latest versions 2025-10-26 15:35:07 +01:00
06bc27a6ce Merge branch 'main' of https://github.com/donpat1to/Schichtenplaner 2025-10-26 12:53:52 +01:00
0aad8f0a56 fixed footer 2025-10-26 12:40:16 +01:00
b52e9d57c7 new package lock generated 2025-10-26 12:24:20 +01:00
donpat1to
308ae74e37 Update LICENSE-COMMERCIAL 2025-10-26 10:27:11 +01:00
9 changed files with 135 additions and 53 deletions

View File

@@ -21,15 +21,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tags
fetch-depth: 0
- name: Check if main branch
id: branch_check
run: |
if [[ "${GITHUB_REF}" == "refs/heads/main" || "${GITHUB_REF}" == "refs/heads/master" ]]; then
echo "is_main_branch=true" >> $GITHUB_OUTPUT
if [[ "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "is_main=true" >> $GITHUB_OUTPUT
else
echo "is_main_branch=false" >> $GITHUB_OUTPUT
echo "is_main=false" >> $GITHUB_OUTPUT
fi
- name: Determine next semantic version tag
@@ -39,24 +39,31 @@ jobs:
# Find latest tag matching vX.Y.Z
latest_tag=$(git tag --list 'v*.*.*' --sort=-v:refname | head -n 1)
echo "Latest tag found: $latest_tag"
if [[ -z "$latest_tag" ]]; then
major=0
minor=0
patch=0
echo "No existing tags found, starting from v0.0.0"
else
version="${latest_tag#v}"
IFS='.' read -r major minor patch <<< "$version"
echo "Parsed version: major=$major, minor=$minor, patch=$patch"
fi
if [[ "${GITHUB_REF}" == "refs/heads/main" || "${GITHUB_REF}" == "refs/heads/master" ]]; then
if [[ "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/master" ]]; then
major=$((major + 1))
minor=0
patch=0
elif [[ "${GITHUB_REF}" == "refs/heads/development" ]]; then
echo "Main branch - major version bump"
elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then
minor=$((minor + 1))
patch=0
echo "Development branch - minor version bump"
else
patch=$((patch + 1))
echo "Other branch - patch version bump"
fi
new_tag="v${major}.${minor}.${patch}"
@@ -87,7 +94,6 @@ jobs:
- name: Run backend tests
working-directory: ./backend
run: |
# Skip tests if jest is not installed
if [ -f "node_modules/.bin/jest" ]; then
npm test
else
@@ -140,13 +146,8 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
# Add the dynamically generated semantic version
${{ needs.set-tag.outputs.tag_name }}
# Add latest tag for main branch
${{ needs.set-tag.outputs.is_main_branch == 'true' && 'latest' }}
type=raw,value=${{ needs.set-tag.outputs.tag_name }}
type=raw,value=latest,enable=${{ fromJSON(needs.set-tag.outputs.is_main_branch) }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
@@ -176,4 +177,4 @@ jobs:
echo "- Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
echo "- Tags: ${{ steps.meta.outputs.tags }}"
echo "- New version: ${{ needs.set-tag.outputs.tag_name }}"
echo "- Is main branch: ${{ needs.set-tag.outputs.is_main_branch }}"
echo "- Is main branch: ${{ needs.set-tag.outputs.is_main_branch }}"

View File

@@ -15,7 +15,7 @@ This software, "Schichtenplaner", is offered under a dual licensing model.
- Integration into commercial software or distributions
To obtain a commercial license, please contact:
📧 patrick@mahnke-hartmann.dev
📧 dev.patrick@mahnke-hartmann.de
or open an inquiry via GitHub: https://github.com/donpat1to/Schichtenplaner
Without a valid commercial license, all commercial rights are reserved.

View File

@@ -39,26 +39,55 @@ app.get('/api/health', (req: any, res: any) => {
});
});
// 🆕 STATIC FILE SERVING FÜR FRONTEND
const frontendBuildPath = process.env.FRONTEND_BUILD_PATH || '../frontend-build';
// 🆕 FIXED STATIC FILE SERVING
// Use absolute path that matches Docker container structure
const frontendBuildPathEnv = process.env.FRONTEND_BUILD_PATH;
console.log('📁 Frontend build path from the env', frontendBuildPathEnv);
const frontendBuildPath = path.resolve('/app/frontend-build');
console.log('📁 Frontend build path:', frontendBuildPath);
console.log('📁 Current __dirname:', __dirname);
// Überprüfe ob das Verzeichnis existiert
if (fs.existsSync(frontendBuildPath)) {
console.log('✅ Frontend build directory exists');
const files = fs.readdirSync(frontendBuildPath);
console.log('📄 Files in frontend-build:', files);
// Check multiple possible locations for frontend build
const possiblePaths = [
'/app/frontend-build', // Docker production path
path.join(__dirname, '../../frontend-build'), // Relative from dist
path.join(process.cwd(), 'frontend-build'), // From current working directory
];
let actualFrontendPath = null;
for (const testPath of possiblePaths) {
if (fs.existsSync(testPath)) {
actualFrontendPath = testPath;
console.log('✅ Found frontend build at:', testPath);
break;
}
}
if (actualFrontendPath) {
// Serviere statische Dateien
app.use(express.static(frontendBuildPath));
app.use(express.static(actualFrontendPath));
// List files for debugging
try {
const files = fs.readdirSync(actualFrontendPath);
console.log('📄 Files in frontend-build:', files);
} catch (err) {
console.log('❌ Could not read frontend-build directory:', err);
}
console.log('✅ Static file serving configured');
} else {
console.log('❌ Frontend build directory NOT FOUND:', frontendBuildPath);
console.log('❌ Frontend build directory NOT FOUND in any location');
console.log('❌ Checked paths:', possiblePaths);
}
// Root route
app.get('/', (req, res) => {
const indexPath = path.join(frontendBuildPath, 'index.html');
if (!actualFrontendPath) {
return res.status(500).send('Frontend build not found');
}
const indexPath = path.join(actualFrontendPath, 'index.html');
console.log('📄 Serving index.html from:', indexPath);
if (fs.existsSync(indexPath)) {
@@ -69,19 +98,30 @@ app.get('/', (req, res) => {
}
});
// Client-side routing fallback
app.get('*', (req, res) => {
// Ignoriere API Routes
if (req.path.startsWith('/api/')) {
return res.status(404).json({ error: 'API endpoint not found' });
}
const indexPath = path.join(frontendBuildPath, 'index.html');
console.log('🔄 Client-side routing for:', req.path, '-> index.html');
if (!actualFrontendPath) {
return res.status(500).json({ error: 'Frontend application not available' });
}
const indexPath = path.join(actualFrontendPath, 'index.html');
console.log('🔄 Client-side routing for:', req.path, '->', indexPath);
if (fs.existsSync(indexPath)) {
res.sendFile(indexPath);
// Use absolute path with res.sendFile
res.sendFile(indexPath, (err) => {
if (err) {
console.error('Error sending index.html:', err);
res.status(500).send('Error loading application');
}
});
} else {
console.error('❌ index.html not found for client-side routing');
console.error('❌ index.html not found for client-side routing at:', indexPath);
res.status(404).json({ error: 'Frontend application not found' });
}
});

View File

@@ -1,26 +1,14 @@
version: '3.8'
services:
schichtplan:
build:
context: .
dockerfile: backend/Dockerfile
schichtplaner:
container_name: schichtplaner
image: ghcr.io/donpat1to/schichtenplaner:v1.0.0
ports:
- "3001:3001"
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=file:./prod.db
- JWT_SECRET=your-production-secret-key-change-this
- PYTHON_PATH=/usr/bin/python3
- "3002:3002"
volumes:
- app_data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
app_data:

View File

@@ -10,12 +10,12 @@ const Footer: React.FC = () => {
borderTop: '1px solid rgba(251, 250, 246, 0.1)',
},
footerContent: {
maxWidth: '1200px',
maxWidth: '1500px',
margin: '0 auto',
padding: '3rem 2rem 2rem',
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))',
gap: '3rem',
gridTemplateColumns: 'repeat(auto-fit, minmax(100px, 1fr))',
gap: '1rem',
},
footerSection: {
display: 'flex',

View File

@@ -35,7 +35,7 @@ const FAQ: React.FC = () => {
},
{
question: "Wie lange dauert die Planungserstellung?",
answer: "Typischerweise 30-105 Sekunden, abhängig von der Anzahl der Mitarbeiter und Schichten."
answer: "Typischerweise maximal 105 Sekunden, abhängig von der Anzahl der Mitarbeiter und Schichten."
}
];

View File

@@ -11,7 +11,7 @@ const Features: React.FC = () => {
{
icon: "⚡",
title: "Schnelle Berechnung",
description: "Google OR-Tools CP-SAT Solver findet Lösungen in 30-105 Sekunden"
description: "Google OR-Tools CP-SAT Solver findet Lösungen in maximal 105 Sekunden"
},
{
icon: "👥",

View File

@@ -151,7 +151,7 @@
margin: 0 auto;
padding: 2rem 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 2rem;
}

53
package-lock.json generated
View File

@@ -2799,6 +2799,7 @@
"@types/react-dom": "^19.0.0",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.3.3",
"esbuild": "^0.21.0",
"typescript": "^5.7.3",
"vite": "^6.0.7"
}
@@ -3047,6 +3048,21 @@
"node": ">=6.9.0"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.21.5",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"dev": true,
@@ -3326,6 +3342,43 @@
"dev": true,
"license": "ISC"
},
"node_modules/esbuild": {
"version": "0.21.5",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.21.5",
"@esbuild/android-arm": "0.21.5",
"@esbuild/android-arm64": "0.21.5",
"@esbuild/android-x64": "0.21.5",
"@esbuild/darwin-arm64": "0.21.5",
"@esbuild/darwin-x64": "0.21.5",
"@esbuild/freebsd-arm64": "0.21.5",
"@esbuild/freebsd-x64": "0.21.5",
"@esbuild/linux-arm": "0.21.5",
"@esbuild/linux-arm64": "0.21.5",
"@esbuild/linux-ia32": "0.21.5",
"@esbuild/linux-loong64": "0.21.5",
"@esbuild/linux-mips64el": "0.21.5",
"@esbuild/linux-ppc64": "0.21.5",
"@esbuild/linux-riscv64": "0.21.5",
"@esbuild/linux-s390x": "0.21.5",
"@esbuild/linux-x64": "0.21.5",
"@esbuild/netbsd-x64": "0.21.5",
"@esbuild/openbsd-x64": "0.21.5",
"@esbuild/sunos-x64": "0.21.5",
"@esbuild/win32-arm64": "0.21.5",
"@esbuild/win32-ia32": "0.21.5",
"@esbuild/win32-x64": "0.21.5"
}
},
"node_modules/escalade": {
"version": "3.2.0",
"dev": true,