# Architecture This document describes the technical architecture of **malxte.de**. ## Overview malxte.de is a static single-page personal website built as a **SvelteKit** application. It uses server-side rendering (SSR) with SvelteKit's adapter system for deployment flexibility. There is no backend, database, or API — all content is hardcoded in Svelte components. ## Directory Layout ``` . ├── src/ # Application source │ ├── app.d.ts # Global TypeScript type declarations │ ├── app.html # HTML shell template │ ├── lib/ # Shared library code │ │ ├── index.ts # Library barrel export (currently empty) │ │ └── assets/ │ │ └── favicon.svg # Favicon (Svelte logo placeholder) │ └── routes/ # SvelteKit file-based routing │ ├── +layout.svelte # Root layout (wraps all pages) │ └── +page.svelte # Home page (index route /) ├── static/ # Static assets (served as-is) │ └── robots.txt # Search engine crawl rules ├── BYTEMALTE.md # Design system specification ├── ARCHITECTURE.md # This file ├── AGENTS.md # AI agent handoff documentation ├── package.json # Project manifest and scripts ├── pnpm-lock.yaml # Lockfile ├── pnpm-workspace.yaml # pnpm workspace config ├── svelte.config.js # SvelteKit configuration ├── tsconfig.json # TypeScript configuration ├── vite.config.ts # Vite configuration └── .npmrc # pnpm settings (engine-strict) ``` ## Routing SvelteKit uses file-based routing. This project has a single route: | File | Route | Purpose | |------|-------|---------| | `src/routes/+layout.svelte` | All pages | Global shell: header, nav, footer | | `src/routes/+page.svelte` | `/` | Home page content | The `+layout.svelte` file wraps `+page.svelte` using Svelte 5's `{@render children()}` pattern. ## Component Architecture ### `+layout.svelte` — Root Layout Responsibilities: - **Global CSS reset** — `box-sizing: border-box`, margin/padding zero - **Global styles** — Body background (`#0F172A`), font family (Inter), link colors - **Sticky header** — Glassmorphism effect (`backdrop-filter: blur(12px)`) - **Navigation** — Smooth scroll anchors (`#about`, `#connect`, `#projects`) - **Footer** — Social links + copyright Key patterns: - Uses `:global()` selectors for body-level styles - Children rendered via Svelte 5 `{@render children()}` slot syntax - Responsive breakpoint at `640px` ### `+page.svelte` — Home Page Responsibilities: - All page content in a single component - Data-driven rendering via `connectLinks` and `projects` arrays - Interactive copy-to-clipboard for Nostr credentials Structure (top to bottom): 1. **Script block** — State (`$state`), functions, data arrays 2. **Hero section** — Badge, heading, subtitle, CTA buttons, Nostr identity card 3. **About section** — Three icon cards in CSS Grid 4. **Connect section** — Social link cards with SVG icons 5. **Projects section** — Project cards with tags 6. **Style block** — All scoped CSS ## State Management The application uses minimal client-side state: ```typescript let copiedField = $state(''); ``` This single reactive variable tracks which Nostr credential was recently copied (for showing the checkmark feedback). There is no global state management — no stores, context, or external state libraries. ## Data Model All content is defined as static arrays in `+page.svelte`: ```typescript connectLinks: Array<{ title: string; description: string; icon: string; // Inline SVG markup href: string; // External URL cta: string; // Call-to-action label (unused in UI currently) }> projects: Array<{ title: string; description: string; tags: string[]; // Displayed as green badges link: string | null; // Optional external link }> ``` To add or remove social links or projects, edit these arrays directly. ## Styling Strategy - **Scoped CSS** — Each `.svelte` file has a `