Skip to content

Commit 96a1e12

Browse files
authored
Merge pull request #2 from onetimesecret/docs/public-readmes
Reformat metadata and config; update site copy
2 parents c69a18c + 3f023b7 commit 96a1e12

34 files changed

+1730
-219
lines changed

.interface-design/system.md

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
# ssowhat.dev — Design System
2+
3+
## Direction
4+
5+
Protocol trace visualizer for engineers evaluating SSO integration patterns. The interface should feel like a well-annotated packet capture — dense with information but organized so you can follow the thread. Technical but not oppressive. Focused, not warm or cold.
6+
7+
## Signature
8+
9+
The dual-pane "what-you-see / what-really-happened" layout — each step shows a browser mockup alongside the HTTP-level dissection. This protocol-trace-as-narrative structure is unique to this product.
10+
11+
## Identity
12+
13+
Black substrate. White keyhole+skull SVG mark (Megadeth-meets-auth-glyph). Chromatic aberration glitch on the wordmark: `text-shadow: 2px 0 #ff0000, -2px 0 #00ff00`. The tagline is monospace, tracking-widest, uppercase — reads like a terminal banner.
14+
15+
```
16+
Title: font-black tracking-tighter uppercase italic
17+
Tagline: font-mono text-sm tracking-widest uppercase text-gray-400
18+
Mark: white keyhole silhouette, black skull inset, 400x400 SVG
19+
```
20+
21+
## Token System (app.css)
22+
23+
All colors flow through semantic tokens defined in `@theme`. Never use raw `gray-*` utilities in demo components — use the tokens below.
24+
25+
### Surfaces (elevation scale)
26+
27+
| Token | Value | Usage |
28+
|---|---|---|
29+
| `canvas` | `gray-950` | Page background, deepest layer |
30+
| `surface` | `gray-900` | Panels, cards, containers |
31+
| `surface-raised` | `gray-800` | Elevated elements: buttons, kbd, controls |
32+
| `code-surface` | `rgba(0,0,0,0.3)` | Code blocks, pre elements |
33+
| `code-surface-deep` | `rgba(0,0,0,0.4)` | Expanded payload code blocks |
34+
35+
### Text hierarchy
36+
37+
| Token | Value | Usage |
38+
|---|---|---|
39+
| `ink` | `gray-100` | Primary text, headings |
40+
| `ink-secondary` | `gray-300` | Secondary text, descriptions |
41+
| `ink-tertiary` | `gray-400` | Labels, metadata, section headers |
42+
| `ink-muted` | `gray-500` | Muted labels, separators, version strings |
43+
44+
### Borders
45+
46+
| Token | Value | Usage |
47+
|---|---|---|
48+
| `edge` | `rgba(255,255,255,0.08)` | Standard borders, dividers |
49+
| `edge-emphasis` | `rgba(255,255,255,0.14)` | Hover borders, dashed inactive borders |
50+
51+
### Accent
52+
53+
| Token | Value | Usage |
54+
|---|---|---|
55+
| `accent` | `blue-400` | Links, active indicators, interactive elements |
56+
| `accent-dim` | `rgba(96,165,250,0.15)` | Accent backgrounds |
57+
58+
## Depth Strategy
59+
60+
Borders-only. No drop shadows on containers. The `border-edge` token at 8% white opacity creates whisper-quiet separation. `shadow-*` is reserved for:
61+
- The browser mockup (`shadow-2xl`)
62+
- Active actor pills in the protocol stack (gradient backgrounds get `shadow-md`/`shadow-lg`)
63+
- The "Next" button (`shadow-md shadow-blue-500/20`)
64+
- The step badge (`shadow-lg shadow-blue-500/20`)
65+
66+
## Spacing
67+
68+
Base unit: 4px (Tailwind default). Consistent use of `gap-*`, `p-*`, `space-y-*` multiples.
69+
70+
Primary spacers: 8px (`gap-2`, `p-2`), 12px (`gap-3`, `p-3`), 16px (`gap-4`, `p-4`), 24px (`gap-6`, `p-6`).
71+
72+
## Typography
73+
74+
System sans-serif (Inter) for UI. Monospace (`font-mono`) for:
75+
- URLs, HTTP methods, status codes
76+
- Headers, request/response bodies
77+
- Protocol labels, version strings
78+
- kbd elements, inline code
79+
80+
### Heading scale
81+
82+
```
83+
h1: text-3xl font-semibold tracking-tight text-ink (page)
84+
text-3xl font-bold tracking-tight text-ink (demo shell)
85+
h2: text-lg font-semibold text-ink (cards, sections)
86+
text-xl font-bold text-ink (transcript steps)
87+
h3: text-xs font-semibold uppercase tracking-wider text-ink-muted (section labels)
88+
```
89+
90+
### Body text
91+
92+
```
93+
Body: text-sm leading-relaxed text-ink-secondary
94+
Caption: text-xs text-ink-muted
95+
Code: rounded bg-surface-raised px-1.5 py-0.5 font-mono text-xs
96+
```
97+
98+
## Semantic HTTP Colors (sso-demo-theme.css)
99+
100+
These are domain-specific — not generic status colors:
101+
102+
| Token | Value | Meaning |
103+
|---|---|---|
104+
| `http-request` | `blue-500` | Browser -> server requests |
105+
| `http-response` | `emerald-500` | Server -> browser responses |
106+
| `http-server` | `purple-500` | Server-to-server communication |
107+
| `http-internal` | `gray-500` | Internal processes |
108+
109+
Each has a `-dim` variant (40% opacity via `color-mix`) for backgrounds.
110+
111+
## Actor Colors (sso-demo-theme.css)
112+
113+
Per-actor colors with `-600` and `-700` shades for gradients:
114+
- `actor-browser`: slate-600
115+
- `actor-caddy`: lime-600
116+
- `actor-logto`: purple-500
117+
- `actor-entra`: cyan-500
118+
- `actor-okta`: indigo-500
119+
- `actor-google`: rose-500
120+
- `actor-ots`: red-500
121+
122+
## Motion
123+
124+
`transition-colors` is the dominant transition — used on buttons, links, containers. Physical motion is reserved:
125+
- `hover:scale-105` on actor pills only
126+
- `hover:translateY(-2px)` on identity/brand CTA only
127+
- `motion-reduce:transition-none` applied consistently on all interactive elements
128+
129+
## Component Patterns
130+
131+
### Buttons — Primary (CTA)
132+
133+
```
134+
bg-blue-600 px-5 py-2 text-sm font-semibold text-white
135+
shadow-md shadow-blue-500/20
136+
hover:bg-blue-500
137+
disabled:bg-surface-raised disabled:text-ink-muted disabled:shadow-none
138+
```
139+
140+
### Buttons — Secondary (ghost)
141+
142+
```
143+
border border-edge bg-transparent px-4 py-2 text-sm font-medium text-ink-secondary
144+
hover:border-edge-emphasis hover:bg-surface-raised hover:text-ink
145+
disabled:cursor-not-allowed disabled:border-edge disabled:text-ink-muted
146+
```
147+
148+
### Buttons — Tertiary (toggle, inactive)
149+
150+
```
151+
border border-edge bg-transparent px-3 py-2 text-xs font-medium text-ink-tertiary
152+
hover:border-edge-emphasis hover:text-ink-secondary
153+
```
154+
155+
### Buttons — Tertiary (toggle, active)
156+
157+
Semantic color borders at reduced opacity:
158+
159+
```
160+
border-blue-500/50 bg-blue-900/30 text-blue-400
161+
border-red-500/50 bg-red-900/30 text-red-400 (stop/danger)
162+
border-amber-500/50 bg-amber-900/30 text-amber-400 (mode toggle)
163+
```
164+
165+
### Containers
166+
167+
```
168+
rounded-lg border border-edge bg-surface p-4
169+
```
170+
171+
### Section headers
172+
173+
```
174+
text-xs font-semibold uppercase tracking-wider text-ink-muted
175+
```
176+
177+
### Tags / badges
178+
179+
```
180+
rounded border border-edge bg-surface-raised px-2 py-0.5 font-mono text-xs text-ink-tertiary
181+
```
182+
183+
### Kbd (keyboard shortcuts)
184+
185+
```
186+
rounded bg-surface-raised px-1.5 py-0.5 font-mono
187+
```
188+
189+
### Actor pills
190+
191+
```
192+
rounded-full border-2 px-3 py-1 text-xs font-semibold
193+
Active: ${colorInfo.bgClass} ${colorInfo.borderClass} ${colorInfo.textClass} scale-105 shadow-lg
194+
```
195+
196+
### Step indicators
197+
198+
```
199+
Completed: h-5 w-5 bg-emerald-500 rounded-full (checkmark SVG)
200+
Current: h-5 w-6 bg-blue-500 ring-2 ring-blue-300 ring-offset-2 ring-offset-surface
201+
Pending: h-5 w-5 border-2 border-dashed border-edge-emphasis bg-surface-raised
202+
```
203+
204+
### Links
205+
206+
```
207+
Inline: text-accent hover:underline
208+
Nav: text-ink-tertiary hover:text-ink-secondary
209+
Back: text-ink-muted hover:text-ink-secondary (with left arrow)
210+
```
211+
212+
### Focus rings
213+
214+
```
215+
focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 focus-visible:ring-offset-canvas
216+
```
217+
218+
### Callouts
219+
220+
```
221+
Standard: rounded-lg border border-edge bg-surface px-4 py-3 text-sm text-ink-tertiary
222+
Warning: rounded-md border border-amber-500/30 bg-amber-900/20 p-4
223+
```
224+
225+
## Exceptions (intentionally not tokenized)
226+
227+
- **`print:` variants**: Literal grays for paper output (light backgrounds, dark text)
228+
- **BrowserMockup chrome**: `from-gray-300 to-gray-400` gradient simulates real macOS browser chrome
229+
- **ProtocolStack connector fallbacks**: `bg-gray-600` / `border-l-gray-600` / `border-r-gray-600` are dynamically constructed in JS and safelisted in theme CSS
230+
- **Protocol stack sublabels**: `text-gray-200/80` used against colored gradient backgrounds where semantic tokens don't apply
231+
- **Semantic protocol colors**: `text-emerald-400`, `text-blue-300`, `text-yellow-400` etc. in HTTP entries are domain-specific syntax highlighting, not generic text

README.md

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,60 @@
1-
# sv
1+
# ssowhat.dev
22

3-
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
3+
Interactive visualizations of enterprise SSO authentication flows. Step through every redirect, cookie, and token exchange to see what actually happens when a user clicks "Sign in with SSO."
44

5-
## Creating a project
5+
**Live site:** [ssowhat.dev](https://ssowhat.dev)
66

7-
If you're seeing this, you've probably already done this step. Congrats!
7+
## What this is
88

9-
```sh
10-
# create a new project
11-
npx sv create my-app
12-
```
9+
Each demo walks through a complete authentication flow step by step, showing what the user sees in the browser alongside the HTTP exchanges happening behind the scenes. Decoded SAML assertions, JWT tokens, and protocol details are shown at each stage.
1310

14-
To recreate this project with the same configuration:
11+
The example application is [Onetime Secret](https://onetimesecret.com) (OTS) — an open-source tool for sharing sensitive information via self-destructing links. It serves as a realistic stand-in for any web application adding SSO support.
1512

16-
```sh
17-
# recreate this project
18-
npx sv create --template minimal --types ts --no-install ssowhat.dev
19-
```
13+
## Available demos
2014

21-
## Developing
15+
| Demo | Protocols | Architecture |
16+
|------|-----------|--------------|
17+
| [Enterprise SAML for Modern Apps](https://ssowhat.dev/oidc-saml-bridge/) | OIDC, SAML | Caddy + Logto bridge OIDC to SAML with Entra ID |
18+
| [SP-Initiated SAML with Okta](https://ssowhat.dev/sp-saml-okta/) | SAML 2.0 | OTS redirects to Okta, assertion posted back |
19+
| [OAuth2 Social Login with Google](https://ssowhat.dev/oauth2-google/) | OAuth 2.0, OIDC | Authorization Code Flow with PKCE via Google |
2220

23-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
21+
Planned: SCIM provisioning flows, multi-IdP federation patterns.
2422

25-
```sh
26-
npm run dev
23+
## Running locally
2724

28-
# or start the server and open the app in a new browser tab
29-
npm run dev -- --open
25+
```bash
26+
pnpm install
27+
pnpm dev
3028
```
3129

30+
Open [localhost:5184](http://localhost:5184).
31+
3232
## Building
3333

34-
To create a production version of your app:
34+
```bash
35+
pnpm build
36+
pnpm preview
37+
```
38+
39+
Produces a fully static site in `build/` via `@sveltejs/adapter-static`.
3540

36-
```sh
37-
npm run build
41+
## Creating a new demo
42+
43+
Copy the template and customize:
44+
45+
```bash
46+
cp -r src/lib/sso-demos/_template src/lib/sso-demos/your-demo-name
3847
```
3948

40-
You can preview the production build with `npm run preview`.
49+
Then create a route at `src/routes/your-demo-name/+page.svelte`. See the [component docs](src/lib/sso-demos/README.md) for the full guide.
50+
51+
## Tech stack
52+
53+
- [SvelteKit](https://svelte.dev/docs/kit) with static adapter
54+
- [Svelte 5](https://svelte.dev) (runes)
55+
- [Tailwind CSS v4](https://tailwindcss.com)
56+
- TypeScript, Vite
57+
58+
## License
4159

42-
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
60+
[MIT](LICENSE) — Onetime Secret Inc

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"packageManager": "pnpm@10.22.0",
1212
"type": "module",
1313
"scripts": {
14-
"dev": "vite dev --host",
14+
"dev": "vite dev --host --port 5184",
1515
"build": "vite build",
1616
"preview": "vite preview",
1717
"prepare": "svelte-kit sync || echo ''",

src/app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
/* Interactive accent — blue, unified with HTTP request color */
2121
--color-accent: var(--color-blue-400);
2222
--color-accent-dim: rgba(96, 165, 250, 0.15);
23+
24+
/* Code blocks — translucent dark surface for pre/code */
25+
--color-code-surface: rgba(0, 0, 0, 0.3);
26+
--color-code-surface-deep: rgba(0, 0, 0, 0.4);
2327
}
2428

2529
@layer base {

src/lib/sso-demos/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# SSO Demo Shared Components
1+
# SSO Demo Components
22

3-
Reusable Svelte components for creating interactive authentication flow demos.
4-
Each demo shows the same OTS application protected by different authentication architectures.
3+
> Part of [ssowhat.dev](https://github.com/onetimesecret/ssowhat.dev) — interactive SSO protocol visualizations.
4+
5+
Reusable Svelte 5 components for building step-by-step authentication flow demos. Each demo shows the same application protected by a different SSO architecture, with full HTTP transcript visibility.
56

67
## Quick Start: Creating a New Demo
78

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<script lang="ts">
2+
/**
3+
* OAuth2 Social Login with Google
4+
* OTS + Google via OAuth 2.0 / OIDC
5+
*
6+
* Standard Authorization Code Flow: OTS redirects unauthenticated users
7+
* to Google's authorization endpoint. After authentication and consent,
8+
* Google redirects back with an authorization code. OTS exchanges the
9+
* code server-to-server for an ID token (JWT) containing the user's identity.
10+
*
11+
* This is the most common pattern for "Sign in with Google" integrations.
12+
*/
13+
14+
import type { Component } from 'svelte';
15+
import SSODemoShell from '../shared/SSODemoShell.svelte';
16+
import Blank from '../screens/ots/Blank.svelte';
17+
import Loading from '../screens/ots/Loading.svelte';
18+
import Dashboard from '../screens/ots/Dashboard.svelte';
19+
import GoogleOAuth from '../screens/idp/GoogleOAuth.svelte';
20+
import { STEPS } from './steps.js';
21+
import { demoConfig } from './config.js';
22+
23+
/**
24+
* Screen mapping for this demo.
25+
* Maps step.userSees values to screen components.
26+
*/
27+
const screens: Record<string, Component> = {
28+
blank: Blank,
29+
loading: Loading,
30+
dashboard: Dashboard,
31+
'google-oauth': GoogleOAuth,
32+
};
33+
</script>
34+
35+
<!--
36+
OAuth2 Google Social Login Demo
37+
Uses the shared SSODemoShell with demo-specific steps, screens, and config.
38+
-->
39+
<SSODemoShell steps={STEPS} {screens} config={demoConfig} />

0 commit comments

Comments
 (0)