mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
Compare commits
46 Commits
v0.0.16
...
bc73fcebd3
| Author | SHA1 | Date | |
|---|---|---|---|
| bc73fcebd3 | |||
| 82533ae616 | |||
| 840b4384a5 | |||
| 5a8b7e89d7 | |||
| 289c80eea1 | |||
| 1884a16220 | |||
| 478578308d | |||
| 93a52aa196 | |||
|
|
b11c55c1d9 | ||
| 16302f2105 | |||
| 57aff5c858 | |||
| b4abe459c2 | |||
| 06bc27a6ce | |||
| 0aad8f0a56 | |||
| b52e9d57c7 | |||
| 15f3183bc0 | |||
| ca3a5d1c0e | |||
| 6a1509d807 | |||
|
|
308ae74e37 | ||
| e876f5eb02 | |||
| dabd2dff3b | |||
| 84d7be052d | |||
| 9460f10278 | |||
| 6e1927fe2f | |||
| e5a6fc73fe | |||
| c773740634 | |||
| 23acd88ced | |||
| aa1a2d4d72 | |||
| cf3866ee21 | |||
| 7ab3e0a5fb | |||
| 41aa77e45d | |||
| 8e782a5290 | |||
| 3856f93484 | |||
| dae255e2c1 | |||
| 8f96368f5a | |||
| 636b892ece | |||
| 8be6a7b474 | |||
| a2b2b76665 | |||
| 6d00ab695c | |||
| 2608acc2d9 | |||
| 4dacf94077 | |||
| 5e7c5aabfb | |||
| 05fa87c638 | |||
| 875db3aeb7 | |||
| 809a838e27 | |||
| 8d020a0dac |
4
.env.production
Normal file
4
.env.production
Normal file
@@ -0,0 +1,4 @@
|
||||
# .env.production example
|
||||
NODE_ENV=production
|
||||
JWT_SECRET=your-super-secure-minimum-32-character-secret-key-here
|
||||
DATABASE_PATH=/app/data/production.db
|
||||
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 }}"
|
||||
|
||||
27
.gitignore
vendored
27
.gitignore
vendored
@@ -64,6 +64,7 @@ build/
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.production
|
||||
|
||||
# Database
|
||||
database/*.db
|
||||
@@ -110,3 +111,29 @@ Thumbs.db
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Ignore contents of premium folder in public repo
|
||||
premium/*
|
||||
!premium/README-PREMIUM.md
|
||||
!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
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "premium"]
|
||||
path = premium
|
||||
url = https://github.com/donpat1to/Schichtenplaner-Pro.git
|
||||
78
Dockerfile
78
Dockerfile
@@ -1,7 +1,7 @@
|
||||
# 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/backend
|
||||
WORKDIR /app
|
||||
|
||||
# Install Python + OR-Tools
|
||||
RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
||||
@@ -10,78 +10,58 @@ 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 backend files
|
||||
COPY backend/package*.json ./
|
||||
COPY backend/tsconfig.json ./
|
||||
# Copy root package files first
|
||||
COPY package*.json ./
|
||||
COPY tsconfig.base.json ./
|
||||
COPY ecosystem.config.cjs ./
|
||||
|
||||
# Install backend dependencies
|
||||
RUN npm ci
|
||||
# Install root dependencies
|
||||
RUN npm install --only=production
|
||||
|
||||
# Copy backend source
|
||||
COPY backend/src/ ./src/
|
||||
# Copy workspace files
|
||||
COPY backend/ ./backend/
|
||||
COPY frontend/ ./frontend/
|
||||
|
||||
# Build backend
|
||||
RUN npm run build
|
||||
# Install workspace dependencies individually
|
||||
RUN npm install --workspace=backend
|
||||
RUN npm install --workspace=frontend
|
||||
|
||||
# Copy database files manually
|
||||
RUN cp -r src/database/ 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/frontend
|
||||
|
||||
# Copy frontend files
|
||||
COPY frontend/package*.json ./
|
||||
COPY frontend/tsconfig.json ./
|
||||
|
||||
# Install frontend dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy frontend source
|
||||
COPY frontend/src/ ./src/
|
||||
COPY frontend/public/ ./public/
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build
|
||||
|
||||
# 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/package*.json ./
|
||||
COPY --from=backend-builder /app/backend/dist/ ./dist/
|
||||
COPY --from=backend-builder /app/backend/node_modules/ ./node_modules/
|
||||
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 \
|
||||
|
||||
@@ -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.
|
||||
|
||||
3893
backend/package-lock.json
generated
3893
backend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,6 @@
|
||||
"@types/bcrypt": "^6.0.0",
|
||||
"bcrypt": "^6.0.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.18.2",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"sqlite3": "^5.1.6",
|
||||
@@ -24,7 +23,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/cors": "^2.8.13",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/jsonwebtoken": "^9.0.2",
|
||||
"@types/uuid": "^9.0.2",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// backend/src/controllers/employeeController.ts
|
||||
import { Request, Response } from 'express';
|
||||
import { Response } from 'express';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { db } from '../services/databaseService.js';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// backend/src/controllers/setupController.ts
|
||||
import { Request, Response } from 'express';
|
||||
import bcrypt from 'bcrypt';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { db } from '../services/databaseService.js';
|
||||
|
||||
|
||||
@@ -5,10 +5,9 @@ import { db } from '../services/databaseService.js';
|
||||
import {
|
||||
CreateShiftPlanRequest,
|
||||
UpdateShiftPlanRequest,
|
||||
ShiftPlan
|
||||
} from '../models/ShiftPlan.js';
|
||||
import { AuthRequest } from '../middleware/auth.js';
|
||||
import { createPlanFromPreset, TEMPLATE_PRESETS } from '../models/defaults/shiftPlanDefaults.js';
|
||||
import { TEMPLATE_PRESETS } from '../models/defaults/shiftPlanDefaults.js';
|
||||
|
||||
async function getPlanWithDetails(planId: string) {
|
||||
const plan = await db.get<any>(`
|
||||
|
||||
@@ -149,3 +149,9 @@ CREATE INDEX IF NOT EXISTS idx_scheduled_shifts_required_employees ON scheduled_
|
||||
CREATE INDEX IF NOT EXISTS idx_shift_assignments_employee ON shift_assignments(employee_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_shift_assignments_shift ON shift_assignments(scheduled_shift_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_employee_availability_employee_plan ON employee_availability(employee_id, plan_id);
|
||||
|
||||
PRAGMA journal_mode = WAL;
|
||||
PRAGMA synchronous = NORMAL;
|
||||
PRAGMA foreign_keys = ON;
|
||||
PRAGMA secure_delete = ON;
|
||||
PRAGMA auto_vacuum = INCREMENTAL;
|
||||
@@ -1,6 +1,5 @@
|
||||
// backend/src/routes/setup.ts
|
||||
import express from 'express';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { checkSetupStatus, setupAdmin } from '../controllers/setupController.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { spawn } from 'child_process';
|
||||
import path from 'path';
|
||||
|
||||
export function runPythonScript(scriptPath, args = []) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -13,9 +13,6 @@ import setupRoutes from './routes/setup.js';
|
||||
import scheduledShifts from './routes/scheduledShifts.js';
|
||||
import schedulingRoutes from './routes/scheduling.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const app = express();
|
||||
const PORT = 3002;
|
||||
|
||||
@@ -39,25 +36,34 @@ app.get('/api/health', (req: any, res: any) => {
|
||||
});
|
||||
});
|
||||
|
||||
// 🆕 STATIC FILE SERVING FÜR FRONTEND
|
||||
const frontendBuildPath = path.join(__dirname, '../frontend-build');
|
||||
// 🆕 STATIC FILE SERVING
|
||||
// Use absolute path that matches Docker container structure
|
||||
const frontendBuildPath = path.resolve('/app/frontend-build');
|
||||
console.log('📁 Frontend build path:', frontendBuildPath);
|
||||
|
||||
// Ü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);
|
||||
|
||||
if (frontendBuildPath) {
|
||||
// Serviere statische Dateien
|
||||
app.use(express.static(frontendBuildPath));
|
||||
|
||||
console.log('✅ Static file serving configured');
|
||||
} else {
|
||||
console.log('❌ Frontend build directory NOT FOUND:', frontendBuildPath);
|
||||
// List files for debugging
|
||||
try {
|
||||
const files = fs.readdirSync(frontendBuildPath);
|
||||
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 in any location');
|
||||
}
|
||||
|
||||
// Root route
|
||||
app.get('/', (req, res) => {
|
||||
if (!frontendBuildPath) {
|
||||
return res.status(500).send('Frontend build not found');
|
||||
}
|
||||
|
||||
const indexPath = path.join(frontendBuildPath, 'index.html');
|
||||
console.log('📄 Serving index.html from:', indexPath);
|
||||
|
||||
@@ -69,19 +75,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' });
|
||||
}
|
||||
|
||||
if (!frontendBuildPath) {
|
||||
return res.status(500).json({ error: 'Frontend application not available' });
|
||||
}
|
||||
|
||||
const indexPath = path.join(frontendBuildPath, 'index.html');
|
||||
console.log('🔄 Client-side routing for:', req.path, '-> 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' });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
import { Worker } from 'worker_threads';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { Employee, EmployeeAvailability } from '../models/Employee.js';
|
||||
import { ShiftPlan, ScheduledShift } from '../models/ShiftPlan.js';
|
||||
import { ShiftPlan } from '../models/ShiftPlan.js';
|
||||
import { ScheduleRequest, ScheduleResult, Availability, Constraint } from '../models/scheduling.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import { parentPort, workerData } from 'worker_threads';
|
||||
import { CPModel, CPSolver } from './cp-sat-wrapper.js';
|
||||
import { ShiftPlan, Shift } from '../models/ShiftPlan.js';
|
||||
import { Employee, EmployeeAvailability } from '../models/Employee.js';
|
||||
import { Availability, Constraint, Violation, SolverOptions, Solution, Assignment } from '../models/scheduling.js';
|
||||
import { Employee } from '../models/Employee.js';
|
||||
import { Availability, Constraint } from '../models/scheduling.js';
|
||||
|
||||
interface WorkerData {
|
||||
shiftPlan: ShiftPlan;
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
// backend/tsconfig.json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"allowJs": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
||||
@@ -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',
|
||||
apps: [{
|
||||
name: 'schichtplan-app',
|
||||
script: './dist/server.js',
|
||||
instances: 1,
|
||||
exec_mode: 'fork',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: 3002
|
||||
PORT: 3002,
|
||||
FRONTEND_BUILD_PATH: './frontend-build'
|
||||
},
|
||||
error_file: './logs/app-err.log',
|
||||
out_file: './logs/app-out.log',
|
||||
error_file: './logs/err.log',
|
||||
out_file: './logs/out.log',
|
||||
log_file: './logs/combined.log',
|
||||
time: true
|
||||
}
|
||||
]
|
||||
}]
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
# frontend/.env.development
|
||||
BROWSER=none
|
||||
FAST_REFRESH=true
|
||||
DANGEROUSLY_DISABLE_HOST_CHECK=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>
|
||||
19000
frontend/package-lock.json
generated
19000
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -2,49 +2,25 @@
|
||||
"name": "frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"proxy": "http://localhost:3002",
|
||||
"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",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"react-router-dom": "^7.9.3",
|
||||
"typescript": "^4.9.5",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"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"
|
||||
]
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^6.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"http-proxy-middleware": "^3.0.5",
|
||||
"react-scripts": "^5.0.1"
|
||||
"@types/node": "20.19.23",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.0.7",
|
||||
"esbuild": "^0.21.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"short_name": "SP",
|
||||
"name": "schichtenplaner",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
|
||||
@@ -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 - KORRIGIERT MIT LAYOUT
|
||||
// src/App.tsx
|
||||
import React from 'react';
|
||||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
||||
import { AuthProvider, useAuth } from './contexts/AuthContext';
|
||||
@@ -16,6 +16,38 @@ import Settings from './pages/Settings/Settings';
|
||||
import Help from './pages/Help/Help';
|
||||
import Setup from './pages/Setup/Setup';
|
||||
|
||||
// Free Footer Link Pages (always available)
|
||||
import FAQ from './components/Layout/FooterLinks/FAQ/FAQ';
|
||||
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';
|
||||
|
||||
// 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;
|
||||
let PremiumPrivacy: React.FC = () => <CommunityLegalPage title="Datenschutz" />;
|
||||
let PremiumImprint: React.FC = () => <CommunityLegalPage title="Impressum" />;
|
||||
let PremiumTerms: React.FC = () => <CommunityLegalPage title="AGB" />;
|
||||
|
||||
// Load premium components only when ENABLE_PRO is true
|
||||
if (ENABLE_PRO) {
|
||||
try {
|
||||
// Use require with type assertions to avoid dynamic import issues
|
||||
const premiumModule = require('@premium-frontend/components/FooterLinks');
|
||||
|
||||
if (premiumModule.Contact) PremiumContact = premiumModule.Contact;
|
||||
if (premiumModule.Privacy) PremiumPrivacy = premiumModule.Privacy;
|
||||
if (premiumModule.Imprint) PremiumImprint = premiumModule.Imprint;
|
||||
if (premiumModule.Terms) PremiumTerms = premiumModule.Terms;
|
||||
|
||||
console.log('✅ Premium components loaded successfully');
|
||||
} catch (error) {
|
||||
console.warn('⚠️ Premium components not available, using community fallbacks:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Protected Route Component
|
||||
const ProtectedRoute: React.FC<{ children: React.ReactNode; roles?: string[] }> = ({
|
||||
children,
|
||||
@@ -49,11 +81,27 @@ const ProtectedRoute: React.FC<{ children: React.ReactNode; roles?: string[] }>
|
||||
return <Layout>{children}</Layout>;
|
||||
};
|
||||
|
||||
// Public Route Component (without Layout for footer pages)
|
||||
const PublicRoute: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
const { user, loading } = useAuth();
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div style={{ textAlign: 'center', padding: '40px' }}>
|
||||
<div>⏳ Lade Anwendung...</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return user ? <Layout>{children}</Layout> : <>{children}</>;
|
||||
};
|
||||
|
||||
// Main App Content
|
||||
const AppContent: React.FC = () => {
|
||||
const { loading, needsSetup, user } = useAuth();
|
||||
|
||||
console.log('🏠 AppContent rendering - loading:', loading, 'needsSetup:', needsSetup, 'user:', user);
|
||||
console.log('🎯 Premium features enabled:', ENABLE_PRO);
|
||||
|
||||
// Während des Ladens
|
||||
if (loading) {
|
||||
@@ -80,52 +128,32 @@ const AppContent: React.FC = () => {
|
||||
console.log('✅ Showing protected routes for user:', user.email);
|
||||
return (
|
||||
<Routes>
|
||||
<Route path="/" element={
|
||||
<ProtectedRoute>
|
||||
<Dashboard />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/shift-plans" element={
|
||||
<ProtectedRoute>
|
||||
<ShiftPlanList />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/shift-plans/new" element={
|
||||
<ProtectedRoute roles={['admin', 'maintenance']}>
|
||||
<ShiftPlanCreate />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/shift-plans/:id/edit" element={
|
||||
<ProtectedRoute roles={['admin', 'maintenance']}>
|
||||
<ShiftPlanEdit />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/shift-plans/:id" element={
|
||||
<ProtectedRoute>
|
||||
<ShiftPlanView />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/employees" element={
|
||||
<ProtectedRoute roles={['admin', 'maintenance']}>
|
||||
<EmployeeManagement />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/settings" element={
|
||||
<ProtectedRoute>
|
||||
<Settings />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
<Route path="/help" element={
|
||||
<ProtectedRoute>
|
||||
<Help />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
{/* Protected Routes (require login) */}
|
||||
<Route path="/" element={<ProtectedRoute><Dashboard /></ProtectedRoute>} />
|
||||
<Route path="/shift-plans" element={<ProtectedRoute><ShiftPlanList /></ProtectedRoute>} />
|
||||
<Route path="/shift-plans/new" element={<ProtectedRoute roles={['admin', 'maintenance']}><ShiftPlanCreate /></ProtectedRoute>} />
|
||||
<Route path="/shift-plans/:id/edit" element={<ProtectedRoute roles={['admin', 'maintenance']}><ShiftPlanEdit /></ProtectedRoute>} />
|
||||
<Route path="/shift-plans/:id" element={<ProtectedRoute><ShiftPlanView /></ProtectedRoute>} />
|
||||
<Route path="/employees" element={<ProtectedRoute roles={['admin', 'maintenance']}><EmployeeManagement /></ProtectedRoute>} />
|
||||
<Route path="/settings" element={<ProtectedRoute><Settings /></ProtectedRoute>} />
|
||||
<Route path="/help" element={<ProtectedRoute><Help /></ProtectedRoute>} />
|
||||
|
||||
{/* Public Footer Link Pages (always available) */}
|
||||
<Route path="/faq" element={<PublicRoute><FAQ /></PublicRoute>} />
|
||||
<Route path="/about" element={<PublicRoute><About /></PublicRoute>} />
|
||||
<Route path="/features" element={<PublicRoute><Features /></PublicRoute>} />
|
||||
|
||||
{/* PREMIUM Footer Link Pages (conditionally available) */}
|
||||
<Route path="/contact" element={<PublicRoute><PremiumContact /></PublicRoute>} />
|
||||
<Route path="/privacy" element={<PublicRoute><PremiumPrivacy /></PublicRoute>} />
|
||||
<Route path="/imprint" element={<PublicRoute><PremiumImprint /></PublicRoute>} />
|
||||
<Route path="/terms" element={<PublicRoute><PremiumTerms /></PublicRoute>} />
|
||||
|
||||
{/* Auth Routes */}
|
||||
<Route path="/login" element={<Login />} />
|
||||
<Route path="*" element={
|
||||
<ProtectedRoute>
|
||||
<Dashboard />
|
||||
</ProtectedRoute>
|
||||
} />
|
||||
|
||||
{/* Catch-all Route */}
|
||||
<Route path="*" element={<ProtectedRoute><Dashboard /></ProtectedRoute>} />
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// frontend/src/components/Layout/Footer.tsx - ELEGANT WHITE DESIGN
|
||||
// frontend/src/components/Layout/Footer.tsx
|
||||
import React from 'react';
|
||||
|
||||
const Footer: React.FC = () => {
|
||||
@@ -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',
|
||||
@@ -182,20 +182,6 @@ const Footer: React.FC = () => {
|
||||
>
|
||||
Funktionen
|
||||
</a>
|
||||
<a
|
||||
href="/pricing"
|
||||
style={styles.footerLink}
|
||||
onMouseEnter={(e) => {
|
||||
e.currentTarget.style.color = '#FBFAF6';
|
||||
e.currentTarget.style.transform = 'translateX(4px)';
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
e.currentTarget.style.color = 'rgba(251, 250, 246, 0.7)';
|
||||
e.currentTarget.style.transform = 'translateX(0)';
|
||||
}}
|
||||
>
|
||||
Preise
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
76
frontend/src/components/Layout/FooterLinks/About/About.tsx
Normal file
76
frontend/src/components/Layout/FooterLinks/About/About.tsx
Normal file
@@ -0,0 +1,76 @@
|
||||
// frontend/src/components/Layout/FooterLinks/About/About.tsx
|
||||
import React from 'react';
|
||||
|
||||
const About: React.FC = () => {
|
||||
return (
|
||||
<div style={{ padding: '40px 20px', maxWidth: '800px', margin: '0 auto' }}>
|
||||
<h1>👨💻 Über uns</h1>
|
||||
|
||||
<div style={{
|
||||
backgroundColor: 'white',
|
||||
borderRadius: '12px',
|
||||
padding: '30px',
|
||||
marginTop: '20px',
|
||||
boxShadow: '0 4px 6px rgba(0,0,0,0.1)',
|
||||
border: '1px solid #e0e0e0',
|
||||
lineHeight: 1.6
|
||||
}}>
|
||||
<h2 style={{ color: '#2c3e50' }}>Unser Team</h2>
|
||||
|
||||
<div style={{ display: 'flex', alignItems: 'center', marginTop: '20px', padding: '20px', backgroundColor: '#f8f9fa', borderRadius: '8px' }}>
|
||||
<div style={{ marginRight: '20px' }}>
|
||||
<div style={{
|
||||
width: '80px',
|
||||
height: '80px',
|
||||
backgroundColor: '#3498db',
|
||||
borderRadius: '50%',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: 'white',
|
||||
fontSize: '2rem',
|
||||
fontWeight: 'bold'
|
||||
}}>
|
||||
P
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style={{ color: '#2c3e50', margin: '0 0 5px 0' }}>Patrick</h3>
|
||||
<p style={{ color: '#6c757d', margin: '0 0 10px 0' }}>
|
||||
Full-Stack Developer & Projektleiter
|
||||
</p>
|
||||
<p style={{ margin: 0, fontSize: '0.9rem' }}>
|
||||
GitHub: <a href="https://github.com/donpat1to" style={{ color: '#3498db' }}>donpat1to</a><br/>
|
||||
E-Mail: <a href="mailto:dev.patrick@inca-vikingo.de" style={{ color: '#3498db' }}>dev.patrick@inca-vikingo.de</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 style={{ color: '#3498db', marginTop: '30px' }}>🚀 Unsere Mission</h3>
|
||||
<p>
|
||||
Wir entwickeln intelligente Lösungen für die Personalplanung,
|
||||
die Zeit sparen und faire Schichtverteilung gewährleisten.
|
||||
</p>
|
||||
|
||||
<h3 style={{ color: '#3498db', marginTop: '25px' }}>💻 Technologie</h3>
|
||||
<p>
|
||||
Unser Stack umfasst moderne Technologien:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Frontend: React, TypeScript</li>
|
||||
<li>Backend: Node.js, Express</li>
|
||||
<li>Optimierung: Google OR-Tools CP-SAT</li>
|
||||
<li>Datenbank: SQLite/PostgreSQL</li>
|
||||
</ul>
|
||||
|
||||
<h3 style={{ color: '#3498db', marginTop: '25px' }}>📈 Entwicklung</h3>
|
||||
<p>
|
||||
Schichtenplaner wird kontinuierlich weiterentwickelt und
|
||||
basiert auf Feedback unserer Nutzer.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default About;
|
||||
@@ -0,0 +1,38 @@
|
||||
// frontend/src/components/Layout/FooterLinks/CommunityLinks/communityLinks.tsx
|
||||
import React from 'react';
|
||||
|
||||
export const CommunityContact: React.FC = () => (
|
||||
<div style={{ padding: '40px 20px', maxWidth: '800px', margin: '0 auto' }}>
|
||||
<h1>📞 Kontakt</h1>
|
||||
<div style={{ backgroundColor: 'white', borderRadius: '12px', padding: '30px', marginTop: '20px' }}>
|
||||
<h2 style={{ color: '#2c3e50' }}>Community Edition</h2>
|
||||
<p>Kontaktfunktionen sind in der Premium Edition verfügbar.</p>
|
||||
<p>
|
||||
<a href="/features" style={{ color: '#3498db' }}>
|
||||
➡️ Zu den Features
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const CommunityLegalPage: React.FC<{ title: string }> = ({ title }) => (
|
||||
<div style={{ padding: '40px 20px', maxWidth: '800px', margin: '0 auto' }}>
|
||||
<h1>📄 {title}</h1>
|
||||
<div style={{ backgroundColor: 'white', borderRadius: '12px', padding: '30px', marginTop: '20px' }}>
|
||||
<h2 style={{ color: '#2c3e50' }}>Community Edition</h2>
|
||||
<p>Rechtliche Dokumentation ist in der Premium Edition verfügbar.</p>
|
||||
<p>
|
||||
<a href="/features" style={{ color: '#3498db' }}>
|
||||
➡️ Erfahren Sie mehr über Premium
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
// Optional: Barrel export für einfachere Imports
|
||||
export default {
|
||||
CommunityContact,
|
||||
CommunityLegalPage
|
||||
};
|
||||
103
frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx
Normal file
103
frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx
Normal file
@@ -0,0 +1,103 @@
|
||||
// frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx
|
||||
import React, { useState } from 'react';
|
||||
|
||||
const FAQ: React.FC = () => {
|
||||
const [openItems, setOpenItems] = useState<number[]>([]);
|
||||
|
||||
const toggleItem = (index: number) => {
|
||||
setOpenItems(prev =>
|
||||
prev.includes(index)
|
||||
? prev.filter(i => i !== index)
|
||||
: [...prev, index]
|
||||
);
|
||||
};
|
||||
|
||||
const faqItems = [
|
||||
{
|
||||
question: "Wie funktioniert der Scheduling-Algorithmus?",
|
||||
answer: "Unser System verwendet Google's OR-Tools CP-SAT Solver, um optimale Schichtzuweisungen basierend auf Verfügbarkeiten, Vertragstypen und Geschäftsregeln zu berechnen."
|
||||
},
|
||||
{
|
||||
question: "Was bedeuten die Verfügbarkeits-Level 1, 2 und 3?",
|
||||
answer: "Level 1: Bevorzugt (Mitarbeiter möchte diese Schicht), Level 2: Verfügbar (kann arbeiten), Level 3: Nicht verfügbar (kann nicht arbeiten)."
|
||||
},
|
||||
{
|
||||
question: "Wie werden Vertragstypen berücksichtigt?",
|
||||
answer: "Kleine Verträge: 1 Schicht pro Woche, Große Verträge: 2 Schichten pro Woche. Das System weist genau diese Anzahl zu."
|
||||
},
|
||||
{
|
||||
question: "Kann ich manuelle Anpassungen vornehmen?",
|
||||
answer: "Ja, nach dem automatischen Scheduling können Sie Zuordnungen manuell anpassen und optimieren."
|
||||
},
|
||||
{
|
||||
question: "Was passiert bei unterbesetzten Schichten?",
|
||||
answer: "Das System zeigt eine Warnung an und versucht, alternative Lösungen zu finden. In kritischen Fällen müssen manuelle Anpassungen vorgenommen werden."
|
||||
},
|
||||
{
|
||||
question: "Wie lange dauert die Planungserstellung?",
|
||||
answer: "Typischerweise maximal 105 Sekunden, abhängig von der Anzahl der Mitarbeiter und Schichten."
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div style={{ padding: '40px 20px', maxWidth: '800px', margin: '0 auto' }}>
|
||||
<h1>❓ Häufige Fragen (FAQ)</h1>
|
||||
|
||||
<div style={{
|
||||
backgroundColor: 'white',
|
||||
borderRadius: '12px',
|
||||
marginTop: '20px',
|
||||
boxShadow: '0 4px 6px rgba(0,0,0,0.1)',
|
||||
border: '1px solid #e0e0e0'
|
||||
}}>
|
||||
{faqItems.map((item, index) => (
|
||||
<div key={index} style={{
|
||||
borderBottom: index < faqItems.length - 1 ? '1px solid #e0e0e0' : 'none',
|
||||
padding: '20px 30px'
|
||||
}}>
|
||||
<div
|
||||
onClick={() => toggleItem(index)}
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center'
|
||||
}}
|
||||
>
|
||||
<h3 style={{
|
||||
color: '#2c3e50',
|
||||
margin: 0,
|
||||
fontSize: '1.1rem'
|
||||
}}>
|
||||
{item.question}
|
||||
</h3>
|
||||
<span style={{
|
||||
fontSize: '1.5rem',
|
||||
color: '#3498db',
|
||||
transform: openItems.includes(index) ? 'rotate(45deg)' : 'rotate(0)',
|
||||
transition: 'transform 0.2s ease'
|
||||
}}>
|
||||
+
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{openItems.includes(index) && (
|
||||
<div style={{
|
||||
marginTop: '15px',
|
||||
padding: '15px',
|
||||
backgroundColor: '#f8f9fa',
|
||||
borderRadius: '8px',
|
||||
color: '#6c757d',
|
||||
lineHeight: 1.6
|
||||
}}>
|
||||
{item.answer}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default FAQ;
|
||||
111
frontend/src/components/Layout/FooterLinks/Features/Features.tsx
Normal file
111
frontend/src/components/Layout/FooterLinks/Features/Features.tsx
Normal file
@@ -0,0 +1,111 @@
|
||||
// frontend/src/pages/Features/Features.tsx
|
||||
import React from 'react';
|
||||
|
||||
const Features: React.FC = () => {
|
||||
const features = [
|
||||
{
|
||||
icon: "🤖",
|
||||
title: "Automatisches Scheduling",
|
||||
description: "Intelligenter Algorithmus erstellt optimale Schichtpläne basierend auf Verfügbarkeiten und Regeln"
|
||||
},
|
||||
{
|
||||
icon: "⚡",
|
||||
title: "Schnelle Berechnung",
|
||||
description: "Google OR-Tools CP-SAT Solver findet Lösungen in maximal 105 Sekunden"
|
||||
},
|
||||
{
|
||||
icon: "👥",
|
||||
title: "Flexible Regelkonfiguration",
|
||||
description: "Anpassbare Geschäftsregeln für Trainee-Betreuung, Alleinarbeit, Vertragstypen"
|
||||
},
|
||||
{
|
||||
icon: "📊",
|
||||
title: "Echtzeit-Validierung",
|
||||
description: "Automatische Erkennung von Regelverletzungen und Konflikten"
|
||||
},
|
||||
{
|
||||
icon: "🔒",
|
||||
title: "Lokale Datenspeicherung",
|
||||
description: "Alle Daten bleiben in Ihrer Infrastruktur - volle Kontrolle und Datenschutz"
|
||||
},
|
||||
{
|
||||
icon: "🎯",
|
||||
title: "Präferenz-basiert",
|
||||
description: "Berücksichtigt Mitarbeiterwünsche für höhere Zufriedenheit"
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div style={{ padding: '40px 20px', maxWidth: '1000px', margin: '0 auto' }}>
|
||||
<h1>✨ Funktionen</h1>
|
||||
|
||||
<div style={{
|
||||
backgroundColor: 'white',
|
||||
borderRadius: '12px',
|
||||
padding: '30px',
|
||||
marginTop: '20px',
|
||||
boxShadow: '0 4px 6px rgba(0,0,0,0.1)',
|
||||
border: '1px solid #e0e0e0'
|
||||
}}>
|
||||
<h2 style={{ color: '#2c3e50', textAlign: 'center', marginBottom: '40px' }}>
|
||||
Alles, was Sie für die perfekte Schichtplanung benötigen
|
||||
</h2>
|
||||
|
||||
<div style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
|
||||
gap: '30px'
|
||||
}}>
|
||||
{features.map((feature, index) => (
|
||||
<div key={index} style={{
|
||||
padding: '25px',
|
||||
backgroundColor: '#f8f9fa',
|
||||
borderRadius: '12px',
|
||||
border: '2px solid #e9ecef',
|
||||
textAlign: 'center',
|
||||
transition: 'transform 0.2s ease, box-shadow 0.2s ease'
|
||||
}}>
|
||||
<div style={{
|
||||
fontSize: '3rem',
|
||||
marginBottom: '15px'
|
||||
}}>
|
||||
{feature.icon}
|
||||
</div>
|
||||
<h3 style={{
|
||||
color: '#2c3e50',
|
||||
margin: '0 0 15px 0'
|
||||
}}>
|
||||
{feature.title}
|
||||
</h3>
|
||||
<p style={{
|
||||
color: '#6c757d',
|
||||
margin: 0,
|
||||
lineHeight: 1.5
|
||||
}}>
|
||||
{feature.description}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div style={{
|
||||
marginTop: '40px',
|
||||
padding: '25px',
|
||||
backgroundColor: '#e8f4fd',
|
||||
borderRadius: '12px',
|
||||
border: '2px solid #b8d4f0',
|
||||
textAlign: 'center'
|
||||
}}>
|
||||
<h3 style={{ color: '#2980b9', margin: '0 0 15px 0' }}>
|
||||
🚀 Starter Sie durch
|
||||
</h3>
|
||||
<p style={{ color: '#2c3e50', margin: 0 }}>
|
||||
Erstellen Sie Ihren ersten optimierten Schichtplan in wenigen Minuten.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Features;
|
||||
@@ -1,220 +0,0 @@
|
||||
/* Layout.css - Professionelles Design */
|
||||
.layout {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.logo h1 {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Desktop Navigation */
|
||||
.desktop-nav {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
transition: all 0.3s ease;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* User Menu */
|
||||
.user-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: white;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.logout-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
/* Mobile Menu Button */
|
||||
.mobile-menu-btn {
|
||||
display: none;
|
||||
background: none;
|
||||
border: none;
|
||||
color: white;
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
/* Mobile Navigation */
|
||||
.mobile-nav {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
background: white;
|
||||
padding: 1rem;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.mobile-nav-link {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 1rem;
|
||||
border-bottom: 1px solid #eee;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.mobile-nav-link:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.mobile-user-info {
|
||||
padding: 1rem;
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.mobile-logout-btn {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
margin-top: 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Main Content */
|
||||
.main-content {
|
||||
flex: 1;
|
||||
background-color: #f8f9fa;
|
||||
min-height: calc(100vh - 140px);
|
||||
}
|
||||
|
||||
.content-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 20px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
background: #2c3e50;
|
||||
color: white;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.footer-section h3,
|
||||
.footer-section h4 {
|
||||
margin-bottom: 1rem;
|
||||
color: #ecf0f1;
|
||||
}
|
||||
|
||||
.footer-section a {
|
||||
color: #bdc3c7;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.footer-section a:hover {
|
||||
color: #3498db;
|
||||
}
|
||||
|
||||
.footer-bottom {
|
||||
border-top: 1px solid #34495e;
|
||||
padding: 1rem 20px;
|
||||
text-align: center;
|
||||
color: #95a5a6;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.desktop-nav,
|
||||
.user-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-menu-btn {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mobile-nav {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
padding: 1rem 15px;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
grid-template-columns: 1fr;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.logo h1 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.content-container {
|
||||
padding: 1rem 10px;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// frontend/src/components/Layout/Layout.tsx - ELEGANT WHITE DESIGN
|
||||
// frontend/src/components/Layout/Layout.tsx
|
||||
import React from 'react';
|
||||
import Navigation from './Navigation';
|
||||
import Footer from './Footer';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// frontend/src/components/Layout/Navigation.tsx - ELEGANT WHITE DESIGN
|
||||
// frontend/src/components/Layout/Navigation.tsx
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useAuth } from '../../contexts/AuthContext';
|
||||
import PillNav from '../PillNav/PillNav';
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/* frontend/src/components/PillNav/PillNav.module.css */
|
||||
.pillNavContainer {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
overflow-x: auto;
|
||||
padding: 4px;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
}
|
||||
|
||||
.pillNavContainer::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pill {
|
||||
padding: 8px 16px;
|
||||
border-radius: 9999px;
|
||||
border: 1px solid;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease-in-out;
|
||||
white-space: nowrap;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.pill:focus-visible {
|
||||
outline: 2px solid #3b82f6;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Solid Variant */
|
||||
.pillSolid {
|
||||
background-color: transparent;
|
||||
color: #6b7280;
|
||||
border-color: #d1d5db;
|
||||
}
|
||||
|
||||
.pillSolidActive {
|
||||
background-color: #2563eb;
|
||||
color: white;
|
||||
border-color: #2563eb;
|
||||
}
|
||||
|
||||
.pillSolid:hover:not(.pillSolidActive) {
|
||||
background-color: #f3f4f6;
|
||||
color: #374151;
|
||||
border-color: #9ca3af;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Outline Variant */
|
||||
.pillOutline {
|
||||
background-color: transparent;
|
||||
color: #6b7280;
|
||||
border-color: #d1d5db;
|
||||
}
|
||||
|
||||
.pillOutlineActive {
|
||||
color: #2563eb;
|
||||
border-color: #2563eb;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.pillOutline:hover:not(.pillOutlineActive) {
|
||||
background-color: #f3f4f6;
|
||||
color: #374151;
|
||||
border-color: #9ca3af;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Ghost Variant */
|
||||
.pillGhost {
|
||||
background-color: transparent;
|
||||
color: #6b7280;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.pillGhostActive {
|
||||
background-color: #f3f4f6;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.pillGhost:hover:not(.pillGhostActive) {
|
||||
background-color: #f9fafb;
|
||||
color: #374151;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// frontend/src/components/PillNav/PillNav.tsx - ELEGANT WHITE DESIGN
|
||||
// frontend/src/components/PillNav/PillNav.tsx
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
export interface PillNavItem {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
// frontend/src/components/PillNav/index.ts
|
||||
export { default } from './PillNav';
|
||||
export type { PillNavProps, PillNavItem } from './PillNav';
|
||||
@@ -1,4 +1,4 @@
|
||||
// frontend/src/design/DesignSystem.tsx
|
||||
// frontend/src/design/DesignSystem.txt
|
||||
export const designTokens = {
|
||||
colors: {
|
||||
// Primary Colors
|
||||
@@ -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',
|
||||
|
||||
@@ -333,7 +333,7 @@ const Setup: React.FC = () => {
|
||||
disabled={loading}
|
||||
style={{
|
||||
padding: '0.75rem 2rem',
|
||||
backgroundColor: loading ? '#6c757d' : '#007bff',
|
||||
backgroundColor: loading ? '#6c757d' : '#51258f',
|
||||
color: 'white',
|
||||
border: 'none',
|
||||
borderRadius: '6px',
|
||||
|
||||
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,6 +1,6 @@
|
||||
// frontend/src/services/shiftPlanService.ts
|
||||
import { authService } from './authService';
|
||||
import { ShiftPlan, CreateShiftPlanRequest, ScheduledShift, CreateShiftFromTemplateRequest } from '../models/ShiftPlan';
|
||||
import { ShiftPlan, CreateShiftPlanRequest } from '../models/ShiftPlan';
|
||||
import { TEMPLATE_PRESETS } from '../models/defaults/shiftPlanDefaults';
|
||||
|
||||
const API_BASE_URL = '/api/shift-plans';
|
||||
|
||||
@@ -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,27 +1,38 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
//"ignoreDeprecations": "6.0",
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"ignoreDeprecations": "6.0",
|
||||
"jsx": "react-jsx",
|
||||
"downlevelIteration": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
|
||||
/* 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"],
|
||||
"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
|
||||
}
|
||||
})
|
||||
17
package.json
Normal file
17
package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "schichtenplaner-monorepo",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"frontend",
|
||||
"backend",
|
||||
"premium"
|
||||
],
|
||||
"scripts": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
1
premium
Submodule
1
premium
Submodule
Submodule premium added at c65016aaab
52
tsconfig.base.json
Normal file
52
tsconfig.base.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* LANGUAGE AND ENVIRONMENT */
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022"],
|
||||
|
||||
/* MODULES */
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
|
||||
/* TYPE CHECKING */
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noImplicitOverride": true,
|
||||
|
||||
/* EMIT */
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"removeComments": false,
|
||||
|
||||
/* INTEROP CONSTRAINTS */
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
||||
/* COMPATIBILITY */
|
||||
"isolatedModules": true,
|
||||
|
||||
"types": ["vite/client", "node"]
|
||||
},
|
||||
"include": [
|
||||
"/premium/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"build",
|
||||
"coverage",
|
||||
"*.test.*",
|
||||
"*.spec.*"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user