Modernes React-Portfolio mit TypeScript, Tailwind CSS und professioneller CI/CD-Pipeline
Dieses Repository dient als Grundlage fΓΌr unser Portfolio-Projekt im Webentwicklungs-Kurs. Jeder Teilnehmer erstellt seine eigene Portfolio-Seite mit modernen Web-Technologien und professionellen Development-Standards.
# 1. Repository klonen
git clone https://github.com/Dependency-Injectors/WebDevKurs.git
cd WebDevKurs
# 2. Dependencies installieren
npm install
# 3. Development Server starten
npm run dev
# 4. Γffne: http://localhost:5173/WebDevKurs
β οΈ Wichtig: Das Projekt lΓ€uft auf/WebDevKurs(nicht/) wegen GitHub Pages Konfiguration.
WebDevKurs/
βββ π .github/workflows/ # CI/CD Pipelines
β βββ test.yml # Quality Gate & Testing
β βββ deploy.yml # GitHub Pages Deployment
β βββ playwright.yml # E2E Testing
β βββ lighthouse.yml # Performance Audits
β βββ health-check.yml # Daily Monitoring
βββ π src/
β βββ components/ # Reusable Components
β βββ pages/ # Student Portfolio Pages
β β βββ __tests__/ # Unit Tests (Vitest)
β βββ routes.tsx # Centralized Routing
βββ π§ͺ tests/ # E2E Tests (Playwright)
βββ π public/ # Static Assets
βββ βοΈ Configuration Files
β βββ vite.config.js # Build & Test Configuration
β βββ playwright.config.ts # E2E Test Configuration
β βββ lighthouserc.json # Performance Audit Rules
β βββ eslint.config.js # Code Quality Rules
βββ π Documentation
βββ README.md # Main Documentation (this file)
βββ ONBOARDING.md # Step-by-Step Guide for Students
βββ TUTORIAL.md # Quick Start Tutorial
- β‘ Vite - Lightning-fast build tool
- βοΈ React 19 - Modern React with latest features
- π TypeScript - Type-safe JavaScript
- π¨ Tailwind CSS - Utility-first CSS framework
- π§ React Router - Client-side routing
- π§ͺ Vitest - Fast unit testing framework
- π Playwright - End-to-end testing automation
- π ESLint - Code quality and best practices
- π Prettier - Automatic code formatting
- πͺ Husky - Git hooks for quality assurance
- π€ GitHub Actions - Automated testing and deployment
- π Lighthouse CI - Performance and accessibility audits
- π₯ Health Checks - Daily monitoring and alerting
- π± GitHub Pages - Free hosting and deployment
# Development
npm run dev # Start development server
npm run build # Create production build
npm run preview # Preview production build
# Testing
npm run test:unit # Run unit tests (Vitest)
npm run test:e2e # Run end-to-end tests (Playwright)
# Code Quality
npm run quality # Run all quality checks
npm run quality:fix # Run all checks + auto-fix issues
# Git Workflow
git checkout main && git pull origin main # Get latest changes
git checkout -b yourname/feature # Create feature branch
git push origin yourname/feature # Push and create PRJeder Teilnehmer arbeitet in einem eigenen Feature-Branch:
# Branch-Naming Convention
yourname/feature-description
# Beispiele:
max/portfolio-page
anna/about-section
tom/project-showcaseStandard Workflow:
git checkout main && git pull origin main- Neueste Γnderungen holengit checkout -b yourname/feature- Feature-Branch erstellen- Entwickeln, committen, pushen
- Pull Request erstellen β Automatische Quality Checks
- Nach Review: Merge in main β Live-Deploy
// src/pages/YourName.tsx
import type { FC } from "react";
const YourName: FC = () => {
return (
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 py-12">
<div className="max-w-6xl mx-auto px-4">
<h1 className="text-5xl font-bold text-center mb-8">Your Name</h1>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
{/* About Section */}
<div className="bg-white rounded-xl shadow-lg p-8">
<h2 className="text-3xl font-semibold mb-6">About Me</h2>
<p className="text-gray-700 leading-relaxed">
Tell your story here...
</p>
</div>
{/* Skills Section */}
<div className="bg-white rounded-xl shadow-lg p-8">
<h2 className="text-3xl font-semibold mb-6">Skills</h2>
{/* Add your skills here */}
</div>
</div>
</div>
</div>
);
};
export default YourName;// src/routes.tsx
import YourName from "./pages/YourName";
export const routes = [
{ path: "/", label: "Home", element: <Home /> },
{ path: "/help", label: "Help", element: <Help /> },
{ path: "/your-name", label: "Your Name", element: <YourName /> }, // Add this
// ... other routes
];npm run dev # Test locally
npm run quality:fix # Check code quality
git add . && git commit -m "Add my portfolio page"
git push origin yourname/portfolio
# Create Pull Request on GitHubnpm run test:unit # Run unit testsExample test:
// src/pages/__tests__/YourName.test.tsx
import { render, screen } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import YourName from "../YourName";
describe("YourName Page", () => {
it("renders page title", () => {
render(<YourName />);
expect(screen.getByText("Your Name")).toBeInTheDocument();
});
});npm run test:e2e # Run end-to-end testsExample E2E test:
// tests/portfolio.spec.ts
import { test, expect } from "@playwright/test";
test("can navigate to portfolio page", async ({ page }) => {
await page.goto("/");
await page.click("text=Your Name");
await expect(page).toHaveTitle(/Your Name/);
});Every Push and Pull Request triggers:
β
TypeScript Check # Type validation
β
ESLint Analysis # Code quality & best practices
β
Prettier Validation # Code formatting
β
Unit Tests (Vitest) # Component testing
β
E2E Tests (Playwright) # Integration testing
β
Build Verification # Production build testZusΓ€tzlich nach Deploy:
- π Lighthouse CI - Performance & Accessibility Audits
- π₯ Health Checks - Daily website monitoring
- π₯οΈ Desktop: Responsive sidebar navigation
- π± Mobile: Touch-optimized hamburger menu
- βΏ Accessible: Full keyboard navigation & ARIA support
- π¨ Smooth: Tailwind CSS animations and transitions
- Format on Save - Prettier integration
- ESLint Integration - Inline error highlighting
- Recommended Extensions - Auto-suggested on first open
- Quality Tasks - Pre-configured build tasks
- Lint-staged - Only check changed files
- Auto-fix - ESLint and Prettier corrections
- Test validation - Ensure tests pass before commit
- Quality Gate - Comprehensive code validation
- Auto-deploy - Deploy to GitHub Pages on main merge
- E2E Testing - Browser automation testing
- Performance Monitoring - Lighthouse CI audits
- Website Accessibility - HTTP status checks
- Content Validation - HTML structure verification
- Build Process - Dependency and build validation
- Performance - Response time monitoring
Bei Fehlern wird automatisch ein GitHub Issue mit Debugging-Checkliste erstellt.
# GitHub Actions
gh workflow run "Daily Health Check"
# Local testing
npm run build && npm run preview
npx lhci autorun # Lighthouse auditAutomatisches Deployment:
- Push to
mainβ GitHub Actions build β GitHub Pages deploy - Live URL: https://dependency-injectors.github.io/WebDevKurs/
GitHub Pages Konfiguration:
// vite.config.js
export default defineConfig({
base: "/WebDevKurs/", // Repository name
// ...
});// src/main.jsx
<BrowserRouter basename="/WebDevKurs">
<App />
</BrowserRouter>Empty page on GitHub Pages:
- Check
basename="/WebDevKurs"in main.jsx - Verify
base: "/WebDevKurs/"in vite.config.js
Test failures:
- Run
npm run quality:fixfor auto-fixes - Check TypeScript errors:
npm run type-check
Build failures:
- Update dependencies:
npm ci - Check GitHub Actions logs for details
- π ONBOARDING.md - Detailed step-by-step guide
- π TUTORIAL.md - Quick start tutorial
π Ready to build your portfolio? Start with ONBOARDING.md!
Bei Fragen: Erstelle ein Issue oder frage in der Gruppe.