Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: '24'
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Dependency Review
uses: actions/dependency-review-action@v5
Expand All @@ -28,5 +28,10 @@ jobs:
fail-on-severity: moderate
# Post a comment on the PR with a summary of findings
comment-summary-in-pr: always
# Deny packages with known malware
deny-licenses: GPL-2.0, GPL-3.0
# Only licenses this AGPL-3.0 project can take in. A package outside
# the list fails the review; a reviewed exception goes into
# allow-dependencies-licenses as its purl.
allow-licenses: >-
MIT, ISC, 0BSD, BSD-2-Clause, BSD-3-Clause, Apache-2.0,
BlueOak-1.0.0, CC0-1.0, CC-BY-4.0, OFL-1.1, MPL-2.0,
LGPL-3.0-or-later, AGPL-3.0-or-later
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
steps:
# ── 1. Checkout ──────────────────────────────────────────
- name: ⬇️ Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 1

# ── 2. Node.js ───────────────────────────────────────────
- name: ⚙️ Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: '24'
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Set up Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: '24'
cache: 'npm'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@

name: Mirror to Codeberg

# Only main and tags start a run. No delete trigger: every merged pull request
# deletes its branch and would start a run of its own; the next push to main
# prunes the branch on Codeberg anyway.
on:
push:
branches: ["main"]
tags: ["**"]
delete:
workflow_dispatch:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# Checkout des Tags (falls vorhanden) bzw. des angegebenen Branches (für neue Tags).
# fetch-depth: 0 holt komplette History + alle Tags.
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ inputs.ref || github.ref }}
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/secret-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
# Full history – damit TruffleHog auch alte Commits prüfen kann
fetch-depth: 0
Expand Down
28 changes: 9 additions & 19 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,27 @@ Teil des MSK-Ökosystems unter `s.msk-scripts.de`.

| Bereich | Technologie |
|--------------|-------------------------|
| Framework | Next.js 15 (App Router) |
| Framework | Next.js 16 (App Router) |
| Sprache | TypeScript (strict) |
| Datenbank | MariaDB (`mysql2`) |
| Styling | Tailwind CSS |
| Styling | Tailwind CSS 4 |
| Validation | Zod |
| Short-Codes | nanoid |
| QR-Codes | qrcode |
| Passwörter | bcrypt |
| UA-Parsing | ua-parser-js |
| Charts | recharts |
| Charts | SVG, ohne Bibliothek |

**Bewusst kein:** Prisma (Overhead), Redis (Single-Server), Drittanbieter-Auth.

## 🎨 MSK Design-System

```css
/* Farben */
--msk-bg: #1b1b1d
--msk-surface: #242526
--msk-surface2: #2a2b2e
--msk-border: #3d3d3f
--msk-accent: #5eb131 /* MSK-Grün */
--msk-hover: #4e9827
--msk-text: #e3e3e3
--msk-muted: #8d9096
--msk-danger: #e05c4b

/* Fonts */
Headings: Syne (700/800/900)
Body: DM Sans (300-600)
```
Das Designsystem von msk-scripts.de, wie in MSK Forms: Tokens, Typografie, Layout, Komponenten und
Barrierefreiheit stehen in **`DESIGN.md`**, die Werte in `app/globals.css`. Kurz: Hell und Dunkel
(System als Vorgabe), Archivo und Source Sans 3 lokal über Fontsource, Phosphor-Icons nur aus
`src/components/icons`, Kopf- und Fußleiste des Shops (`src/components/site`), Diagramme als
SVG ohne Bibliothek. `src/test/contrast.test.ts` rechnet jedes Farbpaar in beiden Themes nach.
Ausgeschlossen: Inter, JetBrains Mono, GitHub-Dark-Palette, Emoji als Icons.

## 📦 Features

Expand Down
154 changes: 154 additions & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
name: MSK Shortener
description: A web tool of msk-scripts.de. The shop's design system, applied to one form and its statistics.
colors:
ground: "#f6f6f4"
ground-dark: "#18191b"
card: "#ffffff"
card-dark: "#212225"
tile: "#ededea"
tile-dark: "#111214"
text: "#1c1d1f"
text-dark: "#ececea"
muted-text: "#5a5d61"
muted-text-dark: "#a7a9ad"
msk-green: "#27762e"
msk-green-dark: "#6dbb3d"
band: "#26282b"
band-green: "#7cc04b"
typography:
display: "Archivo Variable, clamp(2.25rem, 1.2rem + 2.4vw, 5rem), 750"
body: "Source Sans 3 Variable, clamp(1.0625rem, 0.9rem + 0.2vw, 1.25rem), line height 1.6"
---

# Design System: MSK Shortener

How s.msk-scripts.de looks and behaves. MSK Shortener uses the design system of the MSK
Scripts shop (msk-scripts.de), the same one MSK Forms and MSK Paste use. The values live in
[`app/globals.css`](app/globals.css); this file says what they are for.

## Principles

**"One form, done well."** Most visitors come to shorten one link and leave, a few come back
for its statistics. The form is the first thing on the page, everything else waits below it.

- **Structure before looks.** A good-looking page is forgiven small faults, not large ones.
- **One accent.** Anthracite and white carry the page, MSK green marks the brand and what can
be acted on.
- **Fewer boxes.** Groups come from spacing and hairlines. Cards are for the form, figures and
charts.
- **Fluid, not stepped.** Type, spacing and columns grow with the window through `clamp()` up
to UWQHD; components follow their container.
- **Both themes are equal.** Light is the default ground, dark is a palette of its own, the
system setting decides (`next-themes`, `defaultTheme="system"`). Every pair is computed.
- **The CSP is a design constraint.** Scripts run under a nonce (`proxy.ts`). Fonts are local,
the dialog is native, charts are hand-written SVG rendered on the server.

## Exclusion list

Binding for the whole site (decided for msk-scripts.de on 27.10.2026):

- Inter and JetBrains Mono, not even as a fallback.
- The GitHub dark palette, terminal mockups, `>_` icons, green monospace eyebrows with a dash.
- Lucide as the icon set; emoji as icons.
- Rows of three or four equal cards with icon, title and two lines of text.
- Em dashes in visible copy, in both languages.

## Colour

Source tokens are shadcn-style names holding HSL channels (`--primary: 125.3 50.3% 30.8%`),
light in `:root`, dark in `.dark`. `@theme inline` wraps them into utilities
(`bg-primary`, `text-muted-foreground`). Code names the utility, plain CSS writes
`hsl(var(--primary))`.

| Utility | Light | Dark | Role |
|---|---|---|---|
| `background` | `#f6f6f4` | `#18191b` | The ground of every page |
| `card` | `#ffffff` | `#212225` | Cards, the form, the header bar, the dialog |
| `muted` | `#ededea` | `#111214` | The tile: hover, code chips |
| `foreground` | `#1c1d1f` | `#ececea` | Text |
| `muted-foreground` | `#5a5d61` | `#a7a9ad` | Secondary text, hints, placeholders |
| `border` | `#dcdcd8` | `#313337` | Hairlines, never text |
| `input` | `#84878b` | `#6d7075` | Field borders, outline buttons (3:1) |
| `primary`, `ring` | `#27762e` | `#6dbb3d` | MSK green: links, the primary fill, focus |
| `primary-hover`, `accent-soft` | derived | derived | Hovered fill; the soft surface of the current item |
| `success`, `warning`, `danger`, `info` | | | Status, always with a word and a sign |
| `band*` | anthracite | same | Page heads and the footer |
| `brand` | `#27762e` | same | The 4 px stripe above the header bar |
| `chart-1` to `chart-5` | | | Chart series |

[`src/test/contrast.test.ts`](src/test/contrast.test.ts) reads the tokens from `globals.css` and
recomputes every rendered pair in both themes (WCAG 2.2 AA: 4.5:1 text, 3:1 controls). Coverage
tests fail when a colour utility has no pair.

## Typography

Archivo (`font-display`) for headings and names, Source Sans 3 (`font-sans`) for everything else,
both variable and loaded locally through `@fontsource-variable` in `app/layout.tsx`. Short codes,
tokens and addresses use the system monospace (`font-mono`); monospace marks what a machine reads.

Sizes: `text-display`, `text-h2`, `text-h3`, `text-lead`, `text-body` (default), `text-small`,
`text-label`. Every maximum is at most 2.5 times its minimum (zoom to 200 %). Running text stays
under 65 characters per line. Figures use `tabular-nums`.

## Layout

- `container-page`: the shell of header, footer and wide pages (statistics), fluid up to UWQHD.
- `tool-column`: the narrower column of the form and the text pages.
- `--space-section` and `--space-stack` set the rhythm between and inside sections.
- No sideways scrolling down to 320 px; the header menu opens below the bar under 1280 px.

## Components

| Component | Use it for |
|---|---|
| `SiteFrame` | Header, the one `<main id="main">`, footer. Every page renders it. |
| `SiteHeader`, `HeaderBar` | The shop's header: green stripe, the tool's own pages, the shop's product lines with Web tools as the current one, the language. |
| `SiteFooter` | The shop's footer on the band: brand, appearance switch, product, ecosystem, legal. |
| `PageHead` | The head of a page on the band: kicker, heading, lead. `size="tool"` on the home page. |
| `Button` | Every button and button-styled link (`asChild`): `primary`, `outline`, `link`, `ghost`, `danger`, `band`, `band-outline`. |
| `ThemeSwitch` | System, light or dark as three toggle buttons. |
| `LanguagePicker` | A native select that posts to `/api/locale` and refreshes. |
| `DeleteLinkButton` | The delete form in a native modal `<dialog>`. |
| `TimelineChart`, `AggregateBars` | Clicks per day and shares as SVG and bars, each value also as text. |

Navigation lives in one table (`src/components/site/navigation.ts`), so the desktop bar and the
menu cannot drift apart. Shop addresses come from `src/lib/shopUrl.ts`.

## Icons

Phosphor, regular weight, imported only from [`src/components/icons`](src/components/icons/index.tsx).
Icons are decorative by default (`aria-hidden`); an icon-only button carries its name on the
button. Brand marks (GitHub) are local SVG.

## Motion

Colour and border transitions of 150 ms on controls, 200 ms for fades and the theme colours.
`prefers-reduced-motion` cuts every animation to 0.01 ms.

## Accessibility

- A skip link to the one `<main id="main">`.
- Focus is a 3 px outline in `ring` with 2 px offset; on the band it turns to the band green.
- Targets are at least 44 px (`min-h-11`, `tap-target`).
- Native first: `<select>`, `<dialog>`, real buttons and links.
- Never colour alone: states carry a word and a sign, charts their figures.
- `prefers-contrast: more` raises muted text and lines; `forced-colors` gives controls a system
border.

## Two languages

German and English (`messages/de.json`, `messages/en.json`, next-intl). Every visible string,
`aria-label` included, exists in both. The choice is the `NEXT_LOCALE` cookie; addresses carry no
language. The header and footer texts are the shop's and MSK Forms' wording.

## Adding a colour

Ask first whether an existing token fits. Otherwise add the source token in `:root` (and `.dark`
if it differs), the utility in `@theme inline`, every rendered pair to `PAIRS` in
`src/test/contrast.test.ts`, and a row to the table above.

## Adding an icon

Find it in Phosphor (regular), add it to the import and the export list in
`src/components/icons/index.tsx` in alphabetical order, and import it from `@/components/icons`.
Loading
Loading