Initial commit: React frontend (SLP Software) + AIDLC workflow docs

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-07-20 00:19:44 +02:00
co-authored by Junie
commit e299f1c745
73 changed files with 7275 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import { aboutContent } from '../data/content';
export function AboutSection() {
return (
<section id="over" className="py-[88px]">
<div className="mx-auto max-w-[1080px] px-6">
<div className="grid grid-cols-1 items-start gap-12 sm:grid-cols-[1.2fr_0.8fr]">
<div>
<div className="mb-6">
<span className="font-mono block text-sm uppercase tracking-wider text-accent">
// over
</span>
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
Eén ontwikkelaar, korte lijnen
</h2>
</div>
{aboutContent.paragraphs.map((paragraph) => (
<p key={paragraph} className="mb-4 text-muted">
{paragraph}
</p>
))}
</div>
<div className="font-mono rounded border border-line bg-surface p-6 text-[0.85rem]">
<div className="mb-3.5 text-[0.75rem] uppercase tracking-wider text-accent">
tech_stack
</div>
<ul className="list-none">
{aboutContent.techStack.map((item, index) => (
<li
key={item.label}
className={`py-1.5 text-muted ${
index < aboutContent.techStack.length - 1 ? 'border-b border-line' : ''
}`}
>
<b className="font-medium text-text">{item.label}</b> {item.value}
</li>
))}
</ul>
</div>
</div>
</div>
</section>
);
}
+33
View File
@@ -0,0 +1,33 @@
import { contactInfo } from '../data/content';
export function ContactSection() {
const mailtoHref = `mailto:${contactInfo.email}?subject=${encodeURIComponent(contactInfo.mailSubject)}`;
return (
<section id="contact" className="pb-[110px]">
<div className="mx-auto max-w-[1080px] px-6">
<div className="rounded-[20px] border border-accent-line bg-gradient-to-br from-surface-2 to-surface px-10 py-14 text-center">
<span className="font-mono block text-sm uppercase tracking-wider text-accent">
// contact
</span>
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
{contactInfo.heading}
</h2>
<p className="mx-auto mb-8 mt-3.5 max-w-[46ch] text-muted">{contactInfo.description}</p>
<a
href={mailtoHref}
className="rounded-lg bg-accent px-6 py-3.5 text-[0.98rem] font-semibold text-[var(--color-accent-contrast)] transition-colors hover:bg-[var(--color-accent-hover)]"
>
Stuur een bericht
</a>
<span className="font-mono mt-5 block text-[0.9rem] text-muted">
of mail direct naar{' '}
<a href={`mailto:${contactInfo.email}`} className="text-accent underline-offset-2 hover:underline">
{contactInfo.email}
</a>
</span>
</div>
</div>
</section>
);
}
+42
View File
@@ -0,0 +1,42 @@
import { Component } from 'react';
import type { ErrorInfo, ReactNode } from 'react';
interface ErrorBoundaryProps {
children: ReactNode;
}
interface ErrorBoundaryState {
hasError: boolean;
}
/**
* Top-level, on-brand error boundary (NFR Design resilience pattern; SECURITY-09/SECURITY-15).
* Shows a generic, themed fallback message — never technical details like stack traces.
*/
export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
state: ErrorBoundaryState = { hasError: false };
static getDerivedStateFromError(): ErrorBoundaryState {
return { hasError: true };
}
componentDidCatch(error: Error, info: ErrorInfo): void {
console.error('Unexpected application error', error, info);
}
render(): ReactNode {
if (this.state.hasError) {
return (
<div
className="theme-red flex min-h-screen items-center justify-center bg-bg px-6 text-center text-text"
role="alert"
data-testid="error-boundary-fallback"
>
<p className="font-display text-lg">Er ging iets mis. Probeer de pagina te vernieuwen.</p>
</div>
);
}
return this.props.children;
}
}
+10
View File
@@ -0,0 +1,10 @@
export function Footer() {
return (
<footer className="border-t border-line py-7 text-[0.85rem] text-muted">
<div className="mx-auto flex max-w-[1080px] flex-wrap justify-between gap-2.5 px-6">
<span>© 2026 SLP Software</span>
<span className="font-mono">slp.Bouw(uwIdee);</span>
</div>
</footer>
);
}
+41
View File
@@ -0,0 +1,41 @@
import { heroContent } from '../data/content';
import { handleAnchorClick } from '../utils/scrollToHash';
export function Hero() {
return (
<header id="top" className="relative overflow-hidden pb-[88px] pt-24">
<div className="mx-auto max-w-[1080px] px-6">
<span className="font-mono mb-5 block text-sm uppercase tracking-wider text-accent">
{heroContent.eyebrow}
</span>
<h1 className="font-display mb-6 max-w-[15ch] text-4xl font-extrabold leading-tight tracking-tight sm:text-5xl">
{heroContent.heading}
</h1>
<p className="mb-9 max-w-[52ch] text-lg text-muted">{heroContent.lead}</p>
<div
aria-hidden="true"
className="font-mono mb-10 inline-flex max-w-full items-center gap-2 overflow-x-auto whitespace-nowrap rounded border border-line bg-surface px-6 py-4 shadow-lg"
>
<span>{heroContent.codeLine}</span>
<span className="caret" data-testid="hero-caret" />
</div>
<div className="flex flex-wrap gap-4">
<a
href="#pakketten"
onClick={(event) => handleAnchorClick(event, '#pakketten')}
className="rounded-lg bg-accent px-6 py-3.5 text-[0.98rem] font-semibold text-[var(--color-accent-contrast)] transition-transform hover:bg-[var(--color-accent-hover)] active:scale-[0.98]"
>
Bekijk pakketten
</a>
<a
href="#contact"
onClick={(event) => handleAnchorClick(event, '#contact')}
className="rounded-lg border border-line px-6 py-3.5 text-[0.98rem] font-semibold text-text transition-colors hover:border-accent-line"
>
Plan een gesprek
</a>
</div>
</div>
</header>
);
}
+48
View File
@@ -0,0 +1,48 @@
import { navLinks } from '../data/content';
import { ThemeToggle } from './ThemeToggle';
import { handleAnchorClick } from '../utils/scrollToHash';
export function Nav() {
return (
<nav className="sticky top-0 z-50 border-b border-line bg-bg/80 backdrop-blur-md">
<div className="mx-auto flex h-16 max-w-[1080px] items-center justify-between px-6">
<a
href="#top"
onClick={(event) => handleAnchorClick(event, '#top')}
className="font-mono text-base font-bold tracking-wide text-text"
>
SLP<span className="text-accent">.</span>Software
</a>
<ul className="flex items-center gap-7">
{navLinks.map((link) =>
link.isCta ? (
<li key={link.href}>
<a
href={link.href}
onClick={(event) => handleAnchorClick(event, link.href)}
className="font-mono rounded-lg border border-accent-line bg-accent-soft px-4 py-2 text-sm font-medium text-text"
data-testid="nav-cta-link"
>
{link.label}
</a>
</li>
) : (
<li key={link.href} className="hidden sm:block">
<a
href={link.href}
onClick={(event) => handleAnchorClick(event, link.href)}
className="text-sm font-medium text-muted transition-colors hover:text-text"
>
{link.label}
</a>
</li>
),
)}
<li>
<ThemeToggle />
</li>
</ul>
</div>
</nav>
);
}
+49
View File
@@ -0,0 +1,49 @@
import type { PackageCardData } from '../data/content';
import { handleAnchorClick } from '../utils/scrollToHash';
export function PackageCard({ pkg }: { pkg: PackageCardData }) {
return (
<div
className={`relative flex flex-col rounded border p-8 transition-all hover:-translate-y-1 ${
pkg.featured
? 'border-accent-line bg-surface-2'
: 'border-line bg-surface hover:border-accent-line'
}`}
data-testid={`package-card-${pkg.id}`}
>
{pkg.featured && (
<span className="font-mono absolute -top-3 left-7 rounded-full bg-accent px-3 py-1 text-[0.7rem] font-bold uppercase tracking-wide text-[var(--color-accent-contrast)]">
Meest gekozen
</span>
)}
<span className="font-mono mb-3.5 text-[0.78rem] text-accent">{pkg.id}</span>
<h3 className="mb-2.5 text-xl font-bold">{pkg.title}</h3>
<p className="mb-6 text-[0.95rem] text-muted">{pkg.description}</p>
<div className="font-mono mb-1 text-3xl font-bold">
{pkg.price}
<small className="mt-0.5 block text-[0.78rem] font-normal text-muted">{pkg.priceNote}</small>
</div>
<ul className="my-6 flex-1 list-none">
{pkg.features.map((feature) => (
<li key={feature} className="relative mb-2.5 pl-6 text-[0.93rem] text-muted">
<span className="font-mono absolute left-0 text-accent" aria-hidden="true">
</span>
{feature}
</li>
))}
</ul>
<a
href="#contact"
onClick={(event) => handleAnchorClick(event, '#contact')}
className={`rounded-lg px-6 py-3.5 text-center text-[0.98rem] font-semibold ${
pkg.featured
? 'bg-accent text-[var(--color-accent-contrast)] hover:bg-[var(--color-accent-hover)]'
: 'border border-line text-text hover:border-accent-line'
}`}
>
{pkg.ctaLabel}
</a>
</div>
);
}
+33
View File
@@ -0,0 +1,33 @@
import { usePackagesQuery } from '../hooks/usePackagesQuery';
import { PackageCard } from './PackageCard';
export function PackagesSection() {
const { data: packages, isLoading } = usePackagesQuery();
return (
<section
id="pakketten"
className="bg-gradient-to-b from-transparent via-surface/50 to-transparent py-[88px]"
>
<div className="mx-auto max-w-[1080px] px-6">
<div className="mb-[52px]">
<span className="font-mono block text-sm uppercase tracking-wider text-accent">
// pakketten
</span>
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
Drie manieren om te starten
</h2>
<p className="mt-3 max-w-[56ch] text-muted">
Van één sterke pagina tot volledig maatwerk met eigen back-end. Elk pakket heeft een
vaste scope en een vaste prijs.
</p>
</div>
<div className="grid grid-cols-1 gap-[22px] sm:grid-cols-3" data-testid="packages-grid">
{isLoading || !packages
? null
: packages.map((pkg) => <PackageCard key={pkg.id} pkg={pkg} />)}
</div>
</div>
</section>
);
}
+24
View File
@@ -0,0 +1,24 @@
import { processSteps } from '../data/content';
import { ProcessStep } from './ProcessStep';
export function ProcessSection() {
return (
<section id="werkwijze" className="py-[88px]">
<div className="mx-auto max-w-[1080px] px-6">
<div className="mb-[52px]">
<span className="font-mono block text-sm uppercase tracking-wider text-accent">
// werkwijze
</span>
<h2 className="font-display mt-3.5 text-3xl font-bold sm:text-4xl">
Van idee naar live in drie stappen
</h2>
</div>
<div className="grid grid-cols-1 gap-[22px] sm:grid-cols-3">
{processSteps.map((step) => (
<ProcessStep key={step.label} step={step} />
))}
</div>
</div>
</section>
);
}
+11
View File
@@ -0,0 +1,11 @@
import type { ProcessStepData } from '../data/content';
export function ProcessStep({ step }: { step: ProcessStepData }) {
return (
<div className="border-l-2 border-line py-1 pl-6 transition-colors hover:border-accent">
<span className="font-mono mb-2.5 block text-[0.78rem] text-accent">{step.label}</span>
<h3 className="mb-2 text-[1.08rem]">{step.title}</h3>
<p className="text-[0.93rem] text-muted">{step.description}</p>
</div>
);
}
+13
View File
@@ -0,0 +1,13 @@
import type { ReactNode } from 'react';
import { Nav } from './Nav';
import { Footer } from './Footer';
export function RootLayout({ children }: { children: ReactNode }) {
return (
<div className="font-sans min-h-screen bg-bg text-text">
<Nav />
{children}
<Footer />
</div>
);
}
+27
View File
@@ -0,0 +1,27 @@
import { useTheme } from '../theme/ThemeProvider';
/**
* Visible theme switcher (requirements FR-3, Functional Design Q1/Q7).
* Rendered as a small icon/swatch button in the nav.
*/
export function ThemeToggle() {
const { theme, toggleTheme } = useTheme();
const isPurple = theme === 'purple';
return (
<button
type="button"
onClick={toggleTheme}
aria-label="Wissel kleurthema"
aria-pressed={isPurple}
data-testid="theme-toggle-button"
className="font-mono flex h-8 w-8 items-center justify-center rounded-full border border-line text-xs font-medium text-text transition-colors hover:border-accent-line"
>
<span
aria-hidden="true"
className="block h-4 w-4 rounded-full bg-accent"
data-testid="theme-toggle-swatch"
/>
</button>
);
}
+40
View File
@@ -0,0 +1,40 @@
import { render, screen, fireEvent } from '@testing-library/react';
import { describe, it, expect, beforeEach } from 'vitest';
import { Nav } from '../Nav';
import { ThemeProvider } from '../../theme/ThemeProvider';
function renderNav() {
return render(
<ThemeProvider>
<Nav />
</ThemeProvider>,
);
}
describe('Nav', () => {
beforeEach(() => {
window.localStorage.clear();
document.documentElement.className = '';
});
it('renders all nav links including the CTA', () => {
renderNav();
expect(screen.getByText('Pakketten')).toBeInTheDocument();
expect(screen.getByText('Werkwijze')).toBeInTheDocument();
expect(screen.getByText('Over')).toBeInTheDocument();
expect(screen.getByTestId('nav-cta-link')).toHaveTextContent('Start project');
});
it('renders the theme toggle with a Dutch accessible label', () => {
renderNav();
expect(screen.getByRole('button', { name: 'Wissel kleurthema' })).toBeInTheDocument();
});
it('toggles the theme when the toggle button is clicked', () => {
renderNav();
const toggle = screen.getByTestId('theme-toggle-button');
expect(toggle).toHaveAttribute('aria-pressed', 'false');
fireEvent.click(toggle);
expect(toggle).toHaveAttribute('aria-pressed', 'true');
});
});
@@ -0,0 +1,37 @@
import { render, screen, waitFor } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { PackagesSection } from '../PackagesSection';
import { packages } from '../../data/content';
function renderWithQueryClient() {
const queryClient = new QueryClient();
return render(
<QueryClientProvider client={queryClient}>
<PackagesSection />
</QueryClientProvider>,
);
}
describe('PackagesSection', () => {
it('renders one PackageCard per package once loaded', async () => {
renderWithQueryClient();
await waitFor(() => {
expect(screen.getByTestId('packages-grid').children.length).toBe(packages.length);
});
for (const pkg of packages) {
expect(screen.getByTestId(`package-card-${pkg.id}`)).toBeInTheDocument();
expect(screen.getByText(pkg.title)).toBeInTheDocument();
}
});
it('marks the featured package as "Meest gekozen"', async () => {
renderWithQueryClient();
await waitFor(() => {
expect(screen.getByText('Meest gekozen')).toBeInTheDocument();
});
});
});