mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-11-30 22:45:46 +01:00
Compare commits
28 Commits
308ae74e37
...
478578308d
| Author | SHA1 | Date | |
|---|---|---|---|
| 478578308d | |||
| 93a52aa196 | |||
|
|
b11c55c1d9 | ||
| 16302f2105 | |||
| 57aff5c858 | |||
| b4abe459c2 | |||
| 06bc27a6ce | |||
| 0aad8f0a56 | |||
| b52e9d57c7 | |||
| 15f3183bc0 | |||
| ca3a5d1c0e | |||
| 6a1509d807 | |||
| e876f5eb02 | |||
| dabd2dff3b | |||
| 84d7be052d | |||
| 9460f10278 | |||
| 6e1927fe2f | |||
| e5a6fc73fe | |||
| c773740634 | |||
| 23acd88ced | |||
| aa1a2d4d72 | |||
| cf3866ee21 | |||
| 7ab3e0a5fb | |||
| 41aa77e45d | |||
| 8e782a5290 | |||
| 3856f93484 | |||
| dae255e2c1 | |||
| 8f96368f5a |
38
.github/workflows/docker.yml
vendored
38
.github/workflows/docker.yml
vendored
@@ -16,11 +16,21 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag_name: ${{ steps.set_tag.outputs.tag_name }}
|
||||
is_main_branch: ${{ steps.branch_check.outputs.is_main }}
|
||||
steps:
|
||||
- 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=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "is_main=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Determine next semantic version tag
|
||||
id: set_tag
|
||||
@@ -29,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}"
|
||||
@@ -65,14 +82,10 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: backend/package-lock.json
|
||||
|
||||
- name: Install backend dependencies
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
# Try npm ci first, if it fails use npm install
|
||||
npm ci || (echo "package-lock.json out of sync, using npm install..." && npm install)
|
||||
run: npm install
|
||||
|
||||
- name: Run TypeScript check
|
||||
working-directory: ./backend
|
||||
@@ -81,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
|
||||
@@ -134,11 +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 }}
|
||||
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
|
||||
@@ -168,3 +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 }}"
|
||||
|
||||
23
.gitignore
vendored
23
.gitignore
vendored
@@ -114,4 +114,25 @@ Thumbs.db
|
||||
# Ignore contents of premium folder in public repo
|
||||
premium/*
|
||||
!premium/README-PREMIUM.md
|
||||
!premium/.gitkeep
|
||||
!premium/.gitkeep
|
||||
|
||||
.git
|
||||
.gitignore
|
||||
node_modules
|
||||
npm-debug.log
|
||||
README.md
|
||||
.env
|
||||
.nyc_output
|
||||
coverage
|
||||
.cache
|
||||
dist
|
||||
build
|
||||
logs
|
||||
*.tsbuildinfo
|
||||
|
||||
# Frontend specific
|
||||
frontend/dist
|
||||
frontend/.vite
|
||||
|
||||
# Backend specific
|
||||
backend/dist
|
||||
78
Dockerfile
78
Dockerfile
@@ -1,5 +1,5 @@
|
||||
# Multi-stage build for combined frontend + backend
|
||||
FROM node:20-bullseye AS backend-builder
|
||||
# Single stage build for workspaces
|
||||
FROM node:20-bullseye AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -10,83 +10,61 @@ RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
||||
# Create symlink so python3 is callable as python
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
# Copy ALL package files (root + backend)
|
||||
# Copy root package files first
|
||||
COPY package*.json ./
|
||||
COPY backend/package.json ./backend/
|
||||
COPY tsconfig.base.json ./
|
||||
COPY ecosystem.config.cjs ./
|
||||
|
||||
# Install dependencies using workspaces
|
||||
RUN npm ci --workspace=backend
|
||||
# Install root dependencies
|
||||
RUN npm install --only=production
|
||||
|
||||
# Copy backend source
|
||||
COPY backend/src/ ./backend/src/
|
||||
COPY backend/tsconfig.json ./backend/
|
||||
# Copy workspace files
|
||||
COPY backend/ ./backend/
|
||||
COPY frontend/ ./frontend/
|
||||
|
||||
# Build backend
|
||||
RUN npm run build --workspace=backend
|
||||
# Install workspace dependencies individually
|
||||
RUN npm install --workspace=backend
|
||||
RUN npm install --workspace=frontend
|
||||
|
||||
# Copy database files manually
|
||||
RUN cp -r backend/src/database/ backend/dist/database/
|
||||
# Build backend first
|
||||
RUN npm run build --only=production --workspace=backend
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build --only=production --workspace=frontend
|
||||
|
||||
# Verify Python and OR-Tools installation
|
||||
RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
|
||||
|
||||
# Frontend build stage
|
||||
FROM node:20-bullseye AS frontend-builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy ALL package files (root + frontend)
|
||||
COPY package*.json ./
|
||||
COPY frontend/package.json ./frontend/
|
||||
|
||||
# Install dependencies using workspaces
|
||||
RUN npm ci --workspace=frontend
|
||||
|
||||
# Copy frontend source
|
||||
COPY frontend/src/ ./frontend/src/
|
||||
COPY frontend/public/ ./frontend/public/
|
||||
COPY frontend/tsconfig.json ./frontend/
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build --workspace=frontend
|
||||
|
||||
# Production stage
|
||||
# Production stage (same as above)
|
||||
FROM node:20-bookworm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install PM2 for process management
|
||||
RUN npm install -g pm2
|
||||
|
||||
# Create data directory for SQLite database with proper permissions
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Copy backend built files
|
||||
COPY --from=backend-builder /app/backend/dist/ ./dist/
|
||||
COPY --from=backend-builder /app/backend/node_modules/ ./node_modules/
|
||||
COPY --from=backend-builder /app/backend/package.json ./
|
||||
COPY --from=builder /app/backend/dist/ ./dist/
|
||||
COPY --from=builder /app/backend/package*.json ./
|
||||
|
||||
# Copy frontend built files
|
||||
COPY --from=frontend-builder /app/frontend/build/ ./frontend-build/
|
||||
COPY --from=builder /app/node_modules/ ./node_modules/
|
||||
COPY --from=builder /app/frontend/dist/ ./frontend-build/
|
||||
|
||||
# Copy PM2 configuration
|
||||
COPY ecosystem.config.cjs ./
|
||||
COPY --from=builder /app/ecosystem.config.cjs ./
|
||||
|
||||
COPY --from=builder /app/backend/src/database/ ./dist/database/
|
||||
COPY --from=builder /app/backend/src/database/ ./database/
|
||||
|
||||
# Create a non-root user and group - DEBIAN STYLE
|
||||
RUN groupadd -g 1001 nodejs && \
|
||||
useradd -m -u 1001 -s /bin/bash -g nodejs schichtplan && \
|
||||
chown -R schichtplan:nodejs /app && \
|
||||
chmod 755 /app && \
|
||||
chmod 775 /app/data
|
||||
|
||||
# Set PM2 to use app directory instead of home directory
|
||||
ENV PM2_HOME=/app/.pm2
|
||||
|
||||
USER schichtplan
|
||||
|
||||
EXPOSE 3002
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3002/api/health || exit 1
|
||||
|
||||
|
||||
CMD ["pm2-runtime", "ecosystem.config.cjs"]
|
||||
3893
backend/package-lock.json
generated
3893
backend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -39,26 +39,55 @@ app.get('/api/health', (req: any, res: any) => {
|
||||
});
|
||||
});
|
||||
|
||||
// 🆕 STATIC FILE SERVING FÜR FRONTEND
|
||||
const frontendBuildPath = path.join(__dirname, '../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' });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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:
|
||||
@@ -1,18 +1,17 @@
|
||||
// ecosystem.config.cjs
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'schichtplaner',
|
||||
script: './dist/server.js',
|
||||
instances: 1,
|
||||
exec_mode: 'fork',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: 3002
|
||||
},
|
||||
error_file: './logs/app-err.log',
|
||||
out_file: './logs/app-out.log',
|
||||
time: true
|
||||
}
|
||||
]
|
||||
apps: [{
|
||||
name: 'schichtplan-app',
|
||||
script: './dist/server.js',
|
||||
instances: 1,
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: 3002,
|
||||
FRONTEND_BUILD_PATH: './frontend-build'
|
||||
},
|
||||
error_file: './logs/err.log',
|
||||
out_file: './logs/out.log',
|
||||
log_file: './logs/combined.log',
|
||||
time: true
|
||||
}]
|
||||
};
|
||||
13
frontend/index.html
Normal file
13
frontend/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Shift Planning App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,44 +4,23 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^16.18.126",
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^6.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.19.23",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router-dom": "^7.9.3",
|
||||
"react-scripts": "5.0.1",
|
||||
"typescript": "^4.9.5",
|
||||
"web-vitals": "^2.1.4"
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.0.7",
|
||||
"esbuild": "^0.21.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
render(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
// frontend/src/App.tsx - ONE-REPO SAFE WITHOUT DYNAMIC IMPORTS
|
||||
// src/App.tsx - UPDATED FOR VITE
|
||||
import React from 'react';
|
||||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
||||
import { AuthProvider, useAuth } from './contexts/AuthContext';
|
||||
@@ -22,8 +22,8 @@ import About from './components/Layout/FooterLinks/About/About';
|
||||
import Features from './components/Layout/FooterLinks/Features/Features';
|
||||
import { CommunityContact, CommunityLegalPage } from './components/Layout/FooterLinks/CommunityLinks/communityLinks';
|
||||
|
||||
// Feature flag from environment
|
||||
const ENABLE_PRO = process.env.ENABLE_PRO === 'true';
|
||||
// Vite environment variables (use import.meta.env instead of process.env)
|
||||
const ENABLE_PRO = import.meta.env.ENABLE_PRO === 'true';
|
||||
|
||||
// Conditional Premium Components
|
||||
let PremiumContact: React.FC = CommunityContact;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -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: "👥",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/* Reset and base styles */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#root {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById('root') as HTMLElement
|
||||
);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
reportWebVitals();
|
||||
10
frontend/src/main.tsx
Normal file
10
frontend/src/main.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import App from './App.tsx'
|
||||
import './index.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
)
|
||||
@@ -129,7 +129,7 @@ const Login: React.FC = () => {
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
required
|
||||
style={{
|
||||
width: '94.5%',
|
||||
width: '100%',
|
||||
padding: '10px',
|
||||
border: '1px solid #ddd',
|
||||
borderRadius: '4px',
|
||||
@@ -151,7 +151,7 @@ const Login: React.FC = () => {
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
required
|
||||
style={{
|
||||
width: '94.5%',
|
||||
width: '100%',
|
||||
padding: '10px',
|
||||
paddingRight: '10px',
|
||||
border: '1px solid #ddd',
|
||||
|
||||
1
frontend/src/react-app-env.d.ts
vendored
1
frontend/src/react-app-env.d.ts
vendored
@@ -1 +0,0 @@
|
||||
/// <reference types="react-scripts" />
|
||||
@@ -1,15 +0,0 @@
|
||||
import { ReportHandler } from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
@@ -1,5 +0,0 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
12
frontend/src/vite-env.d.ts
vendored
Normal file
12
frontend/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
// Define types for environment variables
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_APP_TITLE: string
|
||||
readonly ENABLE_PRO: string
|
||||
// more env variables...
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
@@ -1,28 +1,38 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
//"ignoreDeprecations": "6.0",
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"ignoreDeprecations": "6.0",
|
||||
"jsx": "react-jsx",
|
||||
"downlevelIteration": true
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
/* Path mapping (modern approach) */
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@/components/*": ["./src/components/*"],
|
||||
"@/pages/*": ["./src/pages/*"],
|
||||
"@/contexts/*": ["./src/contexts/*"],
|
||||
"@/utils/*": ["./src/utils/*"],
|
||||
"@/services/*": ["./src/services/*"],
|
||||
"@/models/*": ["./src/models/*"],
|
||||
"@/design/*": ["./src/design/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
"include": ["src"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
10
frontend/tsconfig.node.json
Normal file
10
frontend/tsconfig.node.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
45
frontend/vite.config.ts
Normal file
45
frontend/vite.config.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { resolve } from 'path'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 3003,
|
||||
host: true,
|
||||
open: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3002',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve(__dirname, 'index.html')
|
||||
}
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, './src'),
|
||||
'@/components': resolve(__dirname, './src/components'),
|
||||
'@/pages': resolve(__dirname, './src/pages'),
|
||||
'@/contexts': resolve(__dirname, './src/contexts'),
|
||||
'@/models': resolve(__dirname, './src/models'),
|
||||
'@/utils': resolve(__dirname, './src/utils'),
|
||||
'@/services': resolve(__dirname, './src/services'),
|
||||
'@/design': resolve(__dirname, './src/design')
|
||||
}
|
||||
},
|
||||
// Define environment variables
|
||||
define: {
|
||||
'process.env': process.env
|
||||
}
|
||||
})
|
||||
19618
package-lock.json
generated
19618
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -7,15 +7,9 @@
|
||||
"premium"
|
||||
],
|
||||
"scripts": {
|
||||
"dev:frontend": "cd frontend && npm run dev",
|
||||
"dev:backend": "cd backend && npm run dev",
|
||||
"build:all": "npm run build:premium && npm run build:backend && npm run build:frontend",
|
||||
"build:premium": "cd premium && npm run build",
|
||||
"build:backend": "cd backend && npm run build",
|
||||
"build:frontend": "cd frontend && npm run build",
|
||||
"type-check": "npm run type-check:all",
|
||||
"type-check:all": "cd premium && npx tsc --noEmit && cd ../backend && npx tsc --noEmit && cd ../frontend && npx tsc --noEmit",
|
||||
"clean": "rm -rf premium/dist backend/dist frontend/dist"
|
||||
"docker:build": "docker build -t schichtplan-app .",
|
||||
"docker:run": "docker run -p 3002:3002 schichtplan-app",
|
||||
"build:all": "npm run build --workspace=backend && npm run build --workspace=frontend"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.3.3"
|
||||
|
||||
2
premium
2
premium
Submodule premium updated: ce4b3fd6e0...c65016aaab
Reference in New Issue
Block a user