From 809a838e2777c4e96ff6441a7d7bb2b719def5de Mon Sep 17 00:00:00 2001 From: donpat1to Date: Thu, 23 Oct 2025 23:53:57 +0200 Subject: [PATCH] changing repo structure --- .gitignore | 7 +- backend/package.json | 2 + backend/tsconfig.json | 22 ++-- frontend/package-lock.json | 1 + frontend/package.json | 2 + frontend/src/App.tsx | 69 ++++++++++- .../Layout/FooterLinks/About/About.tsx | 76 ++++++++++++ .../components/Layout/FooterLinks/FAQ/FAQ.tsx | 103 ++++++++++++++++ .../Layout/FooterLinks/Features/Features.tsx | 111 ++++++++++++++++++ frontend/tsconfig.json | 29 ++--- package.json | 23 ++++ tsconfig.base.json | 47 ++++++++ 12 files changed, 459 insertions(+), 33 deletions(-) create mode 100644 frontend/src/components/Layout/FooterLinks/About/About.tsx create mode 100644 frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx create mode 100644 frontend/src/components/Layout/FooterLinks/Features/Features.tsx create mode 100644 package.json create mode 100644 tsconfig.base.json diff --git a/.gitignore b/.gitignore index d9236cd..3da23e7 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,9 @@ Thumbs.db .npm # Optional eslint cache -.eslintcache \ No newline at end of file +.eslintcache + +# Ignore contents of premium folder in public repo +premium/* +!premium/README-PREMIUM.md +!premium/.gitkeep \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index 6b91829..6474688 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,5 +1,7 @@ { "name": "schichtplan-backend", + "license": "SEE LICENSE IN LICENSE.md", + "author": "Patrick ", "version": "1.0.0", "type": "module", "scripts": { diff --git a/backend/tsconfig.json b/backend/tsconfig.json index b06c0d9..937b3ad 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -1,19 +1,15 @@ -// backend/tsconfig.json { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "allowJs": true, "outDir": "./dist", "rootDir": "./src", - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true + "module": "ESNext", + "moduleResolution": "bundler" }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "include": [ + "src/**/*" + ], + "references": [ + { "path": "../premium" } + ] } \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ffdaf5d..e3bbef0 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "frontend", "version": "0.1.0", + "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^6.9.1", diff --git a/frontend/package.json b/frontend/package.json index cf6a624..20895f6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,5 +1,7 @@ { "name": "frontend", + "license": "SEE LICENSE IN LICENSE.md", + "author": "Patrick ", "version": "0.1.0", "private": true, "proxy": "http://localhost:3002", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index ce6720d..02bddff 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,4 +1,4 @@ -// frontend/src/App.tsx - KORRIGIERT MIT LAYOUT +// frontend/src/App.tsx - UPDATED WITH FOOTER LINKS import React from 'react'; import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { AuthProvider, useAuth } from './contexts/AuthContext'; @@ -16,6 +16,15 @@ import Settings from './pages/Settings/Settings'; import Help from './pages/Help/Help'; import Setup from './pages/Setup/Setup'; +// Footer Link Pages +import Contact from '../../premium/frontendPRO/src/componentsPRO/FooterLinksPro/Contact/Contact'; +import FAQ from './components/Layout/FooterLinks/FAQ/FAQ'; +import Privacy from '../../premium/frontendPRO/src/componentsPRO/FooterLinksPro/Privacy/Privacy'; +import Imprint from '../../premium/frontendPRO/src/componentsPRO/FooterLinksPro/Imprint/Imprint'; +import Terms from '../../premium/frontendPRO/src/componentsPRO/FooterLinksPro/Terms/Terms'; +import About from './components/Layout/FooterLinks/About/About'; +import Features from './components/Layout/FooterLinks/Features/Features'; + // Protected Route Component const ProtectedRoute: React.FC<{ children: React.ReactNode; roles?: string[] }> = ({ children, @@ -49,6 +58,22 @@ const ProtectedRoute: React.FC<{ children: React.ReactNode; roles?: string[] }> return {children}; }; +// Public Route Component (without Layout for footer pages) +const PublicRoute: React.FC<{ children: React.ReactNode }> = ({ children }) => { + const { user, loading } = useAuth(); + + if (loading) { + return ( +
+
⏳ Lade Anwendung...
+
+ ); + } + + // If user is logged in, show with layout, otherwise without + return user ? {children} : <>{children}; +}; + // Main App Content const AppContent: React.FC = () => { const { loading, needsSetup, user } = useAuth(); @@ -80,6 +105,7 @@ const AppContent: React.FC = () => { console.log('✅ Showing protected routes for user:', user.email); return ( + {/* Protected Routes (require login) */} @@ -120,7 +146,48 @@ const AppContent: React.FC = () => { } /> + + {/* Public Footer Link Pages (accessible without login, but show layout if logged in) */} + + + + } /> + + + + } /> + + + + } /> + + + + } /> + + + + } /> + + + + } /> + + + + } /> + + {/* Auth Routes */} } /> + + {/* Catch-all Route */} diff --git a/frontend/src/components/Layout/FooterLinks/About/About.tsx b/frontend/src/components/Layout/FooterLinks/About/About.tsx new file mode 100644 index 0000000..c8c7a5f --- /dev/null +++ b/frontend/src/components/Layout/FooterLinks/About/About.tsx @@ -0,0 +1,76 @@ +// frontend/src/pages/About/About.tsx +import React from 'react'; + +const About: React.FC = () => { + return ( +
+

👨‍💻 Über uns

+ +
+

Unser Team

+ +
+
+
+ P +
+
+
+

Patrick

+

+ Full-Stack Developer & Projektleiter +

+

+ GitHub: donpat1to
+ E-Mail: dev.patrick@inca-vikingo.de +

+
+
+ +

🚀 Unsere Mission

+

+ Wir entwickeln intelligente Lösungen für die Personalplanung, + die Zeit sparen und faire Schichtverteilung gewährleisten. +

+ +

💻 Technologie

+

+ Unser Stack umfasst moderne Technologien: +

+
    +
  • Frontend: React, TypeScript
  • +
  • Backend: Node.js, Express
  • +
  • Optimierung: Google OR-Tools CP-SAT
  • +
  • Datenbank: SQLite/PostgreSQL
  • +
+ +

📈 Entwicklung

+

+ Schichtenplaner wird kontinuierlich weiterentwickelt und + basiert auf Feedback unserer Nutzer. +

+
+
+ ); +}; + +export default About; \ No newline at end of file diff --git a/frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx b/frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx new file mode 100644 index 0000000..9c82f84 --- /dev/null +++ b/frontend/src/components/Layout/FooterLinks/FAQ/FAQ.tsx @@ -0,0 +1,103 @@ +// frontend/src/pages/FAQ/FAQ.tsx +import React, { useState } from 'react'; + +const FAQ: React.FC = () => { + const [openItems, setOpenItems] = useState([]); + + 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 30-105 Sekunden, abhängig von der Anzahl der Mitarbeiter und Schichten." + } + ]; + + return ( +
+

❓ Häufige Fragen (FAQ)

+ +
+ {faqItems.map((item, index) => ( +
+
toggleItem(index)} + style={{ + cursor: 'pointer', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center' + }} + > +

+ {item.question} +

+ + + + +
+ + {openItems.includes(index) && ( +
+ {item.answer} +
+ )} +
+ ))} +
+
+ ); +}; + +export default FAQ; \ No newline at end of file diff --git a/frontend/src/components/Layout/FooterLinks/Features/Features.tsx b/frontend/src/components/Layout/FooterLinks/Features/Features.tsx new file mode 100644 index 0000000..f8faa3a --- /dev/null +++ b/frontend/src/components/Layout/FooterLinks/Features/Features.tsx @@ -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 30-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 ( +
+

✨ Funktionen

+ +
+

+ Alles, was Sie für die perfekte Schichtplanung benötigen +

+ +
+ {features.map((feature, index) => ( +
+
+ {feature.icon} +
+

+ {feature.title} +

+

+ {feature.description} +

+
+ ))} +
+ +
+

+ 🚀 Starter Sie durch +

+

+ Erstellen Sie Ihren ersten optimierten Schichtplan in wenigen Minuten. +

+
+
+
+ ); +}; + +export default Features; \ No newline at end of file diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 47fc929..8b6b16f 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,27 +1,20 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "es5", "lib": [ - "dom", - "dom.iterable", - "esnext" + "ES2022", + "DOM", + "DOM.Iterable" ], - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "ignoreDeprecations": "6.0", "jsx": "react-jsx", - "downlevelIteration": true + "noEmit": true, + "allowImportingTsExtensions": true, + "moduleResolution": "bundler" }, "include": [ - "src" + "src/**/*" + ], + "references": [ + { "path": "../premium" } ] } \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..24ada9b --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "schichtenplaner-monorepo", + "private": true, + "workspaces": [ + "frontend", + "backend", + "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" + }, + "devDependencies": { + "typescript": "^5.3.3" + } +} \ No newline at end of file diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..d6bb1fb --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,47 @@ +{ + "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 + }, + "exclude": [ + "node_modules", + "dist", + "build", + "coverage", + "*.test.*", + "*.spec.*" + ] +} \ No newline at end of file