Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
Initial commit: Archify 2.0
tt-a1i1e9f223f8aa9
diff --git a/.gitignore b/.gitignorenew file mode 100644index 00000000..8b978ac9--- /dev/null+++ b/.gitignore@@ -0,0 +1,2 @@+.DS_Store+*.DS_Storediff --git a/LICENSE b/LICENSEnew file mode 100644index 00000000..4c27b715--- /dev/null+++ b/LICENSE@@ -0,0 +1,22 @@+MIT License++Copyright (c) 2026 tt-a1i (Archify)+Copyright (c) 2025 Cocoon AI (original "architecture-diagram-generator")++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/README.md b/README.mdnew file mode 100644index 00000000..9e08447e--- /dev/null+++ b/README.md@@ -0,0 +1,176 @@+# Archify++**Generate beautiful architecture diagrams in chat. Switch dark / light. Export PNG / JPEG / WebP / SVG.**++Archify is a [Claude Skill](https://support.claude.com/en/articles/12512180-using-skills-in-claude) that turns a plain-English description of your system into a polished, self-contained architecture diagram — a single HTML file you can open, toggle themes on, and export to any common image format.++- **No design skills needed** — describe your architecture in English, get a diagram+- **Built-in theme toggle** — one click between dark and light, persists across sessions+- **One-click image export** — PNG, JPEG, WebP (2x retina), or SVG (vector)+- **Self-contained HTML** — zero dependencies, share by sending the file+- **Iterate by chat** — "add Redis", "move auth to the left", "use emerald for the API"++++++## Preview+++++## What's new in 2.0++Archify is based on [Cocoon-AI/architecture-diagram-generator](https://github.com/Cocoon-AI/architecture-diagram-generator) v1.0 (dark-only, HTML output). 2.0 rewrites the template around a themeable CSS-variable system and adds a client-side export pipeline:++| Feature | v1.0 | Archify 2.0 |+|---|---|---|+| Dark theme | Yes | Yes |+| Light theme | — | Yes, one-click toggle |+| Theme persistence | — | `localStorage` + `prefers-color-scheme` |+| PNG export | manual screenshot | Built-in, 2x retina |+| JPEG / WebP export | — | Built-in, 2x retina |+| SVG export | — | Built-in, vector, styles inlined |+| Styling model | Inline `fill` / `stroke` | CSS custom properties + semantic classes |++## Quick start++### 1. Install the skill++> Requires Claude Pro, Max, Team, or Enterprise plan (or Claude Code).++**Claude.ai:**+1. Download [`archify.zip`](archify.zip)+2. Go to **Settings** -> **Capabilities** -> **Skills**+3. Click **+ Add** and upload the zip file+4. Toggle the skill on++**Claude Code CLI:**+```bash+# Global (all projects)+unzip archify.zip -d ~/.claude/skills/++# Or project-local+unzip archify.zip -d ./.claude/skills/+```++**Claude.ai Projects (alternative):**+Upload [`archify.zip`](archify.zip) to your Project Knowledge.++### 2. Describe your system++Any of these work:++**Have AI analyze your codebase:**+```+Analyze this codebase and describe the architecture. Include all major+components, how they connect, what technologies they use, and any cloud+services or integrations. Format as a list for an architecture diagram.+```++**Write it yourself:**+```+- React frontend talking to a Node.js API+- PostgreSQL database+- Redis for caching+- Hosted on AWS with CloudFront CDN+```++**Or ask for a typical architecture:**+```+What's a typical architecture for a SaaS application?+```++### 3. Ask Claude to use the skill++```+Use your archify skill to create an architecture diagram from this description:++[PASTE YOUR ARCHITECTURE DESCRIPTION HERE]+```++That's it. Claude generates an HTML file you can open in any browser. Iterate by chat: "add Redis", "swap Postgres for MySQL", "highlight the auth path".++## Using the output++Open the generated HTML in any browser. Top-right you'll see:++- **Theme button** — toggles Dark / Light. Remembered across sessions.+- **Export menu** — drops down with PNG / JPEG / WebP / SVG options.++The export respects the **current** theme — flip to light mode first if you want a light-mode PNG. PNG/JPEG/WebP are rendered at 2x retina; SVG is true vector with all styles inlined, so it scales cleanly and can be further edited in Figma or Illustrator.++## Example prompts++**Web app:**+```+Create an architecture diagram for a web application with:+- React frontend+- Node.js/Express API+- PostgreSQL database+- Redis cache+- JWT authentication+```++**AWS serverless:**+```+Create an architecture diagram showing:+- CloudFront CDN+- API Gateway+- Lambda functions (Node.js)+- DynamoDB+- S3 for static assets+- Cognito for auth+```++**Microservices:**+```+Create an architecture diagram for a microservices system with:+- React web app and mobile clients+- Kong API Gateway+- User Service (Go), Order Service (Java), Product Service (Python)+- PostgreSQL, MongoDB, and Elasticsearch databases+- Kafka for event streaming+- Kubernetes orchestration+```++## Color palette++| Component Type | Color | Use for |+| -------------- | ------- | --------------------------------- |+| Frontend | Cyan | Client apps, UI, edge devices |+| Backend | Emerald | Servers, APIs, services |+| Database | Violet | Databases, storage, AI/ML |+| Cloud / AWS | Amber | Cloud services, infrastructure |+| Security | Rose | Auth, security groups, encryption |+| Message Bus | Orange | Kafka, RabbitMQ, SNS, event buses |+| External | Slate | Generic, external systems |++Each color has coordinated dark-mode and light-mode variants that switch together via the theme toggle.++## Technical details++- **Styling:** CSS custom properties on `:root` + `[data-theme="light"]`; SVG elements reference semantic classes (`c-frontend`, `t-muted`, `a-emphasis`, etc.). Toggling `data-theme` on `<html>` re-themes the entire diagram including gradient, grid, arrows, and mask rects.+- **Export pipeline:** The SVG is cloned, host `<style>` is inlined, current theme variables are resolved and written into a `:root` rule on the clone, then serialized via `XMLSerializer`. For raster formats it's rasterized via an `Image` + 2x `<canvas>` + `toBlob(mime)`. JPEG gets an explicit background fill since it doesn't support transparency.+- **Self-contained output:** Single HTML file, Google Fonts link + inline SVG + ~3 KB of embedded JS. No build step, no JS framework, no server.+- **Browser support:** Any modern browser (Chrome, Safari, Firefox, Edge). Needs `Image` + `canvas.toBlob` with `image/webp` support for WebP export.++## Attribution++Archify is a fork / rewrite of [**Cocoon-AI/architecture-diagram-generator**](https://github.com/Cocoon-AI/architecture-diagram-generator) (MIT, v1.0) by [Cocoon AI](mailto:[email protected]). The original's clean visual design — color palette, grid background, summary-card layout, JetBrains Mono typography — is preserved. All credit for the original aesthetic belongs to them.++Archify 2.0 contributes:+- Refactor of the template to a CSS-variable theme system (dark + light)+- Theme toggle + `localStorage` persistence + `prefers-color-scheme` default+- Built-in PNG / JPEG / WebP / SVG export menu+- Updated `SKILL.md` to guide Claude toward class-based (themeable) diagrams++Both projects are MIT-licensed.++## License++[MIT](LICENSE) — free to use, modify, and distribute.++## Contributing++Issues, PRs, and shared diagrams welcome.diff --git a/archify.zip b/archify.zipnew file mode 100644index 00000000..6945c8ffBinary files /dev/null and b/archify.zip differdiff --git a/archify/SKILL.md b/archify/SKILL.mdnew file mode 100644index 00000000..861db017--- /dev/null+++ b/archify/SKILL.md@@ -0,0 +1,211 @@+---+name: archify+description: Create professional architecture diagrams as standalone HTML files with SVG graphics, a built-in dark/light theme toggle, and one-click export to PNG / JPEG / WebP / SVG. Use when the user asks for system architecture diagrams, infrastructure diagrams, cloud architecture visualizations, security diagrams, network topology diagrams, or any technical diagram showing system components and their relationships.+license: MIT+metadata:+ version: "2.0"+ author: tt-a1i+ based_on: Cocoon-AI/architecture-diagram-generator (MIT, v1.0)+---++# Archify Skill++Create professional technical architecture diagrams as self-contained HTML files with inline SVG, a theme toggle, and a built-in image/SVG export menu. No external runtime dependencies beyond Google Fonts.++Every diagram this skill produces ships with:++- A **Dark / Light theme toggle** (top-right, persists in `localStorage`, respects `prefers-color-scheme` on first visit).+- An **Export menu** offering **PNG**, **JPEG**, **WebP** (all 2x retina), and **SVG** (vector) — rendered entirely in-browser, no server.+- A **CSS-variable-driven color system** so both themes remain visually consistent with the same SVG markup.++## The Cardinal Rule: Use CSS Classes, Not Inline Colors++The theme toggle works by switching CSS custom properties. If you hardcode `fill="rgba(...)"` or `stroke="#22d3ee"` on SVG elements, those values will NOT update when the theme changes. Always prefer the class-based system.++### Do this++```svg+<rect x="X" y="Y" width="W" height="H" rx="6" class="c-mask"/>+<rect x="X" y="Y" width="W" height="H" rx="6" class="c-backend" stroke-width="1.5"/>+<text x="CX" y="CY" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>+<text x="CX" y="CY+16" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>+```++### Don't do this++```svg+<!-- Hardcoded colors break the theme toggle -->+<rect fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" .../>+<text fill="white" .../>+```++## Design System++### Component color classes++| Component Type | Fill class | Text color class | When to use |+|------------------|------------------|------------------|--------------------------------------------|+| Frontend | `c-frontend` | `t-frontend` | Client apps, browsers, mobile, UI |+| Backend | `c-backend` | `t-backend` | Services, APIs, workers, daemons |+| Database | `c-database` | `t-database` | DBs, caches, log files, data stores |+| Cloud / AWS | `c-cloud` | `t-cloud` | Managed cloud services, infra |+| Security | `c-security` | `t-security` | Auth providers, secrets, guards |+| Message Bus | `c-messagebus` | `t-messagebus` | Kafka/RabbitMQ/SNS/Event buses |+| External/Generic | `c-external` | `t-muted` | Users, 3rd parties, anything uncategorized |++Text on a dark or light background uses three neutral helpers:++| Text class | Role |+|-------------|-------------------------------|+| `t-primary` | Component names / titles |+| `t-muted` | Sublabels, annotations |+| `t-dim` | Tertiary / footer metadata |++### Arrow classes++| Class | Marker id | Semantic |+|---------------|----------------------------|--------------------------------|+| `a-default` | `#arrowhead` | Standard data/flow arrow |+| `a-emphasis` | `#arrowhead-emphasis` | Live event stream / hot path |+| `a-security` | `#arrowhead-security` | Auth / security flow (dashed) |+| `a-dashed` | `#arrowhead-dashed` | Async / secondary (dashed) |++Always set `stroke-width` on the line (e.g., `1.5`) — the class only sets color and dasharray.++### Boundary classes++| Class | Purpose |+|---------------------|------------------------------------|+| `c-security-group` | Dashed rose boundary for SGs |+| `c-region` | Large dashed amber region/cluster |++### Typography++Inherit from the SVG root (already wired to JetBrains Mono). Font sizes: 12px for component names, 9px for sublabels, 8px for annotations, 7px for tiny labels.++### Visual Elements++**Background grid:** Automatically themed via `.c-grid` inside the `<pattern id="grid">`. Don't modify.++**Component boxes:** Rounded rectangles (`rx="6"`), `stroke-width="1.5"`, using the `.c-<type>` classes.++**Arrow z-order:** Draw connection arrows BEFORE component boxes (earlier in the SVG). SVG paints in document order, so arrows drawn first appear behind shapes drawn later.++**Masking arrows behind transparent fills:** Component fills are semi-transparent, which means arrows behind them bleed through. The template solves this with a two-rect pattern — an opaque mask rect, then the styled component on top:++```svg+<!-- 1. opaque mask (themed: dark=#0f172a, light=#ffffff) -->+<rect x="X" y="Y" width="W" height="H" rx="6" class="c-mask"/>+<!-- 2. styled component on top -->+<rect x="X" y="Y" width="W" height="H" rx="6" class="c-database" stroke-width="1.5"/>+```++Always use `c-mask` instead of hardcoded `fill="#0f172a"` — the mask color itself is themed.++**Message buses / Event buses:** Small connector elements between services:++```svg+<rect x="X" y="Y" width="120" height="20" rx="4" class="c-messagebus" stroke-width="1"/>+<text x="CENTER_X" y="Y+14" class="t-messagebus" font-size="7" text-anchor="middle">Kafka / RabbitMQ</text>+```++### Spacing Rules++**CRITICAL:** When stacking components vertically, ensure proper spacing to avoid overlaps:++- **Standard component height:** 60px for services, 80-120px for larger components+- **Minimum vertical gap between components:** 40px+- **Inline connectors (message buses):** Place IN the gap between components, not overlapping++**Example vertical layout:**+```+Component A: y=70, height=60 -> ends at y=130+Gap: y=130 to y=170 -> 40px gap, place bus at y=140 (20px tall)+Component B: y=170, height=60 -> ends at y=230+```++**Wrong:** Placing a message bus at y=160 when Component B starts at y=170 (causes overlap)+**Right:** Placing a message bus at y=140, centered in the 40px gap (y=130 to y=170)++### Legend Placement++**CRITICAL:** Place legends OUTSIDE all boundary boxes (region boundaries, cluster boundaries, security groups).++- Calculate where all boundaries end (y position + height)+- Place legend at least 20px below the lowest boundary+- Expand SVG viewBox height if needed to accommodate++### Layout Structure++1. **Header** — Title with pulsing dot indicator, subtitle+2. **Toolbar** (auto-included from template) — theme toggle + export menu, top-right fixed position+3. **Main SVG diagram** — contained in rounded border card+4. **Summary cards** — grid of 3 cards below diagram with key details+5. **Footer** — minimal metadata line++## Component Box Pattern++```svg+<rect x="X" y="Y" width="W" height="H" rx="6" class="c-mask"/>+<rect x="X" y="Y" width="W" height="H" rx="6" class="c-<type>" stroke-width="1.5"/>+<text x="CENTER_X" y="Y+20" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">LABEL</text>+<text x="CENTER_X" y="Y+36" class="t-muted" font-size="9" text-anchor="middle">sublabel</text>+```++## Arrow Patterns++```svg+<!-- Standard -->+<line x1="..." y1="..." x2="..." y2="..." class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>++<!-- Emphasis (live events / hot path) -->+<line x1="..." y1="..." x2="..." y2="..." class="a-emphasis" stroke-width="1.5" marker-end="url(#arrowhead-emphasis)"/>++<!-- Security / auth flow (dashed) -->+<path d="..." class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>++<!-- Async / secondary (dashed) -->+<path d="..." class="a-dashed" stroke-width="1" marker-end="url(#arrowhead-dashed)"/>+```++Pair each arrow class with the matching marker id (same suffix).++## Info Card Pattern++```html+<div class="card">+ <div class="card-header">+ <div class="card-dot COLOR"></div>+ <h3>Title</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ </ul>+</div>+```++Valid `card-dot` colors: `cyan`, `emerald`, `violet`, `amber`, `rose` — these automatically re-theme.++## Template++Copy and customize the template at `assets/template.html`. Customization points:++1. Update the `<title>` and header `<h1>` text + subtitle+2. Modify SVG `viewBox` dimensions if needed (default: `1000 x 680`)+3. Add/remove/reposition component boxes using the `.c-<type>` classes+4. Draw connection arrows using `.a-<variant>` classes+5. Update the three summary cards+6. Update footer metadata++Do NOT remove the `.toolbar` element, the `<script>` blocks, or the `:root` / `[data-theme="..."]` CSS. Those are what give every generated diagram the theme toggle and export buttons.++## Output++Produce a single self-contained `.html` file with:++- Embedded CSS (no external stylesheets except Google Fonts)+- Inline SVG (no external images)+- Small amount of embedded JS (theme toggle + export) — keep as-is from template++The file should render correctly when opened directly in any modern browser, and the **Export** menu should cleanly download PNG/JPEG/WebP (2x retina) and a standalone SVG with inlined styles.diff --git a/archify/assets/template.html b/archify/assets/template.htmlnew file mode 100644index 00000000..78d4e839--- /dev/null+++ b/archify/assets/template.html@@ -0,0 +1,712 @@+<!DOCTYPE html>+<html lang="en" data-theme="dark">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>[PROJECT NAME] Architecture Diagram</title>+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">+ <style>+ /* ==========================================================+ THEME VARIABLES — switch by toggling [data-theme] on <html>+ ========================================================== */+ :root,+ [data-theme="dark"] {+ --bg: #020617;+ --grid: #1e293b;+ --text: #ffffff;+ --text-muted: #94a3b8;+ --text-dim: #475569;++ --panel: rgba(15, 23, 42, 0.5);+ --panel-border: #1e293b;++ --arrow: #64748b;+ --arrow-emphasis: #34d399;++ /* Opaque mask color used behind semi-transparent component fills+ so the arrows drawn underneath are properly hidden. */+ --mask: #0f172a;++ --frontend-fill: rgba(8, 51, 68, 0.4);+ --frontend-stroke: #22d3ee;+ --backend-fill: rgba(6, 78, 59, 0.4);+ --backend-stroke: #34d399;+ --database-fill: rgba(76, 29, 149, 0.4);+ --database-stroke: #a78bfa;+ --cloud-fill: rgba(120, 53, 15, 0.3);+ --cloud-stroke: #fbbf24;+ --security-fill: rgba(136, 19, 55, 0.4);+ --security-stroke: #fb7185;+ --messagebus-fill: rgba(251, 146, 60, 0.3);+ --messagebus-stroke:#fb923c;+ --external-fill: rgba(30, 41, 59, 0.5);+ --external-stroke: #94a3b8;++ --toolbar-bg: rgba(15, 23, 42, 0.8);+ --toolbar-border: #334155;+ --toolbar-text: #e2e8f0;+ --toolbar-hover: rgba(15, 23, 42, 0.95);+ --toolbar-menu-bg: #0f172a;+ }++ [data-theme="light"] {+ --bg: #f8fafc;+ --grid: #e2e8f0;+ --text: #0f172a;+ --text-muted: #64748b;+ --text-dim: #94a3b8;++ --panel: #ffffff;+ --panel-border: #e2e8f0;++ --arrow: #94a3b8;+ --arrow-emphasis: #059669;++ --mask: #ffffff;++ --frontend-fill: rgba(34, 211, 238, 0.15);+ --frontend-stroke: #0891b2;+ --backend-fill: rgba(52, 211, 153, 0.18);+ --backend-stroke: #059669;+ --database-fill: rgba(167, 139, 250, 0.2);+ --database-stroke: #7c3aed;+ --cloud-fill: rgba(251, 191, 36, 0.18);+ --cloud-stroke: #d97706;+ --security-fill: rgba(251, 113, 133, 0.15);+ --security-stroke: #e11d48;+ --messagebus-fill: rgba(251, 146, 60, 0.15);+ --messagebus-stroke:#ea580c;+ --external-fill: rgba(148, 163, 184, 0.18);+ --external-stroke: #64748b;++ --toolbar-bg: rgba(255, 255, 255, 0.92);+ --toolbar-border: #cbd5e1;+ --toolbar-text: #334155;+ --toolbar-hover: #ffffff;+ --toolbar-menu-bg: #ffffff;+ }++ * { margin: 0; padding: 0; box-sizing: border-box; }++ body {+ font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;+ background: var(--bg);+ min-height: 100vh;+ padding: 2rem;+ color: var(--text);+ transition: background 0.2s ease, color 0.2s ease;+ }++ .container { max-width: 1200px; margin: 0 auto; }++ .header { margin-bottom: 2rem; }++ .header-row {+ display: flex;+ align-items: center;+ gap: 1rem;+ margin-bottom: 0.5rem;+ }++ .pulse-dot {+ width: 12px;+ height: 12px;+ background: var(--frontend-stroke);+ border-radius: 50%;+ animation: pulse 2s infinite;+ }++ @keyframes pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.5; }+ }++ h1 {+ font-size: 1.5rem;+ font-weight: 700;+ letter-spacing: -0.025em;+ }++ .subtitle {+ color: var(--text-muted);+ font-size: 0.875rem;+ margin-left: 1.75rem;+ }++ .diagram-container {+ background: var(--panel);+ border-radius: 1rem;+ border: 1px solid var(--panel-border);+ padding: 1.5rem;+ overflow-x: auto;+ }++ svg {+ width: 100%;+ min-width: 900px;+ display: block;+ }++ .cards {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));+ gap: 1rem;+ margin-top: 2rem;+ }++ .card {+ background: var(--panel);+ border-radius: 0.75rem;+ border: 1px solid var(--panel-border);+ padding: 1.25rem;+ }++ .card-header {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ margin-bottom: 0.75rem;+ }++ .card-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ }++ .card-dot.cyan { background: var(--frontend-stroke); }+ .card-dot.emerald { background: var(--backend-stroke); }+ .card-dot.violet { background: var(--database-stroke); }+ .card-dot.amber { background: var(--cloud-stroke); }+ .card-dot.rose { background: var(--security-stroke); }++ .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }++ .card ul {+ list-style: none;+ color: var(--text-muted);+ font-size: 0.75rem;+ }++ .card li { margin-bottom: 0.375rem; }++ .footer {+ text-align: center;+ margin-top: 1.5rem;+ color: var(--text-dim);+ font-size: 0.75rem;+ }++ /* ==========================================================+ TOOLBAR (theme toggle + export menu)+ ========================================================== */+ .toolbar {+ position: fixed;+ top: 1rem;+ right: 1rem;+ display: flex;+ gap: 0.5rem;+ z-index: 100;+ }+ .toolbar button {+ background: var(--toolbar-bg);+ color: var(--toolbar-text);+ border: 1px solid var(--toolbar-border);+ padding: 0.5rem 0.875rem;+ border-radius: 0.5rem;+ font-family: inherit;+ font-size: 0.75rem;+ font-weight: 500;+ cursor: pointer;+ backdrop-filter: blur(8px);+ transition: background 0.15s, border-color 0.15s;+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ }+ .toolbar button:hover {+ background: var(--toolbar-hover);+ border-color: var(--arrow);+ }+ .toolbar .export-wrap { position: relative; }+ .toolbar .export-menu {+ position: absolute;+ top: calc(100% + 0.375rem);+ right: 0;+ background: var(--toolbar-menu-bg);+ border: 1px solid var(--toolbar-border);+ border-radius: 0.5rem;+ padding: 0.375rem;+ min-width: 160px;+ display: none;+ flex-direction: column;+ box-shadow: 0 4px 20px rgba(0,0,0,0.25);+ }+ .toolbar .export-menu.open { display: flex; }+ .toolbar .export-menu button {+ background: transparent;+ border: 0;+ justify-content: space-between;+ width: 100%;+ text-align: left;+ padding: 0.5rem 0.75rem;+ }+ .toolbar .export-menu button:hover {+ background: var(--toolbar-hover);+ }+ .toolbar .export-menu .hint {+ color: var(--text-dim);+ font-size: 0.625rem;+ }++ /* ==========================================================+ SVG SEMANTIC CLASSES — use these instead of inline fill/stroke+ ========================================================== */+ .c-grid { stroke: var(--grid); fill: none; }+ .c-mask { fill: var(--mask); stroke: none; }++ .c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }+ .c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }+ .c-database { fill: var(--database-fill); stroke: var(--database-stroke); }+ .c-cloud { fill: var(--cloud-fill); stroke: var(--cloud-stroke); }+ .c-security { fill: var(--security-fill); stroke: var(--security-stroke); }+ .c-messagebus { fill: var(--messagebus-fill); stroke: var(--messagebus-stroke); }+ .c-external { fill: var(--external-fill); stroke: var(--external-stroke); }++ /* Text helpers */+ .t-primary { fill: var(--text); }+ .t-muted { fill: var(--text-muted); }+ .t-dim { fill: var(--text-dim); }+ .t-frontend { fill: var(--frontend-stroke); }+ .t-backend { fill: var(--backend-stroke); }+ .t-database { fill: var(--database-stroke); }+ .t-cloud { fill: var(--cloud-stroke); }+ .t-security { fill: var(--security-stroke); }+ .t-messagebus { fill: var(--messagebus-stroke); }++ /* Arrows */+ .a-default { stroke: var(--arrow); fill: none; }+ .a-emphasis { stroke: var(--arrow-emphasis); fill: none; }+ .a-security { stroke: var(--security-stroke); fill: none; stroke-dasharray: 5,5; }+ .a-dashed { stroke: var(--database-stroke); fill: none; stroke-dasharray: 4,4; }++ /* Arrowhead markers reference these */+ .m-default { fill: var(--arrow); }+ .m-emphasis { fill: var(--arrow-emphasis); }+ .m-security { fill: var(--security-stroke); }+ .m-dashed { fill: var(--database-stroke); }++ /* Dashed boundary variants */+ .c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }+ .c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }+ </style>+</head>+<body>+ <!-- Toolbar: theme toggle + export menu (present on every generated diagram) -->+ <div class="toolbar">+ <button id="btn-theme" type="button" title="Toggle theme">+ <span id="theme-icon">☾</span>+ <span id="theme-label">Dark</span>+ </button>+ <div class="export-wrap">+ <button id="btn-export" type="button" title="Export diagram">Export ▾</button>+ <div class="export-menu" id="export-menu" role="menu">+ <button data-format="png" type="button">PNG <span class="hint">2×</span></button>+ <button data-format="jpeg" type="button">JPEG <span class="hint">2×</span></button>+ <button data-format="webp" type="button">WebP <span class="hint">2×</span></button>+ <button data-format="svg" type="button">SVG <span class="hint">vector</span></button>+ </div>+ </div>+ </div>++ <div class="container">+ <!-- Header -->+ <div class="header">+ <div class="header-row">+ <div class="pulse-dot"></div>+ <h1>[PROJECT NAME] Architecture</h1>+ </div>+ <p class="subtitle">[Subtitle description]</p>+ </div>++ <!-- Main Diagram -->+ <div class="diagram-container">+ <svg viewBox="0 0 1000 680">+ <!-- Definitions -->+ <defs>+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-default" />+ </marker>+ <marker id="arrowhead-emphasis" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-emphasis" />+ </marker>+ <marker id="arrowhead-security" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-security" />+ </marker>+ <marker id="arrowhead-dashed" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" class="m-dashed" />+ </marker>+ <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" class="c-grid" stroke-width="0.5"/>+ </pattern>+ </defs>++ <!-- Background Grid -->+ <rect width="100%" height="100%" fill="url(#grid)" />++ <!-- =================================================================+ COMPONENT EXAMPLES — use CSS classes, not inline fill/stroke+ (so theme toggle works). Each box pattern:+ 1. opaque mask rect (.c-mask) to hide arrows underneath+ 2. styled rect (.c-<type>) with 1.5px stroke+ 3. text (.t-primary / .t-muted)+ ================================================================= -->++ <!-- External/Generic Component -->+ <rect x="30" y="280" width="100" height="50" rx="6" class="c-mask"/>+ <rect x="30" y="280" width="100" height="50" rx="6" class="c-external" stroke-width="1.5"/>+ <text x="80" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Users</text>+ <text x="80" y="316" class="t-muted" font-size="9" text-anchor="middle">Browser/Mobile</text>++ <!-- Security Component -->+ <rect x="30" y="80" width="100" height="60" rx="6" class="c-mask"/>+ <rect x="30" y="80" width="100" height="60" rx="6" class="c-security" stroke-width="1.5"/>+ <text x="80" y="105" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Auth Provider</text>+ <text x="80" y="121" class="t-muted" font-size="9" text-anchor="middle">OAuth 2.0</text>++ <!-- Region/Cloud Boundary -->+ <rect x="160" y="40" width="820" height="620" rx="12" class="c-region" stroke-width="1"/>+ <text x="172" y="58" class="t-cloud" font-size="10" font-weight="600">AWS Region: us-west-2</text>++ <!-- AWS/Cloud Service -->+ <rect x="200" y="280" width="110" height="50" rx="6" class="c-mask"/>+ <rect x="200" y="280" width="110" height="50" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="255" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>+ <text x="255" y="316" class="t-muted" font-size="9" text-anchor="middle">CDN</text>++ <!-- Multi-line AWS Component (S3 Buckets example) -->+ <rect x="200" y="380" width="110" height="100" rx="6" class="c-mask"/>+ <rect x="200" y="380" width="110" height="100" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="255" y="400" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">S3 Buckets</text>+ <text x="255" y="420" class="t-muted" font-size="8" text-anchor="middle">• bucket-one</text>+ <text x="255" y="434" class="t-muted" font-size="8" text-anchor="middle">• bucket-two</text>+ <text x="255" y="448" class="t-muted" font-size="8" text-anchor="middle">• bucket-three</text>+ <text x="255" y="466" class="t-cloud" font-size="7" text-anchor="middle">OAI Protected</text>++ <!-- Security Group (dashed boundary) -->+ <rect x="350" y="265" width="120" height="80" rx="8" class="c-security-group" stroke-width="1"/>+ <text x="358" y="279" class="t-security" font-size="8">sg-name :port</text>++ <!-- Component inside security group -->+ <rect x="360" y="280" width="100" height="50" rx="6" class="c-mask"/>+ <rect x="360" y="280" width="100" height="50" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="410" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Load Balancer</text>+ <text x="410" y="316" class="t-muted" font-size="9" text-anchor="middle">HTTPS :443</text>++ <!-- Backend Component -->+ <rect x="510" y="280" width="110" height="50" rx="6" class="c-mask"/>+ <rect x="510" y="280" width="110" height="50" rx="6" class="c-backend" stroke-width="1.5"/>+ <text x="565" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">API Server</text>+ <text x="565" y="316" class="t-muted" font-size="9" text-anchor="middle">FastAPI :8000</text>++ <!-- Database Component -->+ <rect x="700" y="280" width="120" height="50" rx="6" class="c-mask"/>+ <rect x="700" y="280" width="120" height="50" rx="6" class="c-database" stroke-width="1.5"/>+ <text x="760" y="300" class="t-primary" font-size="11" font-weight="600" text-anchor="middle">Database</text>+ <text x="760" y="316" class="t-muted" font-size="9" text-anchor="middle">PostgreSQL</text>++ <!-- Frontend Component -->+ <rect x="200" y="520" width="200" height="110" rx="8" class="c-mask"/>+ <rect x="200" y="520" width="200" height="110" rx="8" class="c-frontend" stroke-width="1.5"/>+ <text x="300" y="545" class="t-primary" font-size="12" font-weight="600" text-anchor="middle">Frontend</text>+ <text x="300" y="565" class="t-muted" font-size="9" text-anchor="middle">React + TypeScript</text>+ <text x="300" y="580" class="t-muted" font-size="9" text-anchor="middle">Additional detail</text>+ <text x="300" y="595" class="t-muted" font-size="9" text-anchor="middle">More info</text>+ <text x="300" y="615" class="t-frontend" font-size="8" text-anchor="middle">domain.example.com</text>++ <!-- =================================================================+ ARROW EXAMPLES (use .a-* classes and stroke-width on the line)+ ================================================================= -->++ <!-- Standard arrow with label -->+ <line x1="130" y1="305" x2="198" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="164" y="299" class="t-muted" font-size="9" text-anchor="middle">HTTPS</text>++ <!-- Simple arrow (no label) -->+ <line x1="310" y1="305" x2="358" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Vertical arrow -->+ <line x1="255" y1="330" x2="255" y2="378" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="270" y="358" class="t-muted" font-size="9">OAI</text>++ <!-- Straight arrows between services -->+ <line x1="460" y1="305" x2="508" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="620" y1="305" x2="698" y2="305" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="655" y="299" class="t-muted" font-size="9">TLS</text>++ <!-- Curved dashed path for auth/security flow -->+ <path d="M 80 140 L 80 200 Q 80 220 100 220 L 200 220 Q 220 220 220 240 L 220 278"+ class="a-security" stroke-width="1.5"/>+ <text x="150" y="210" class="t-security" font-size="8">JWT + PKCE</text>++ <!-- =================================================================+ LEGEND+ ================================================================= -->+ <text x="720" y="70" class="t-primary" font-size="10" font-weight="600">Legend</text>++ <rect x="720" y="82" width="16" height="10" rx="2" class="c-frontend" stroke-width="1"/>+ <text x="742" y="90" class="t-muted" font-size="8">Frontend</text>++ <rect x="720" y="98" width="16" height="10" rx="2" class="c-backend" stroke-width="1"/>+ <text x="742" y="106" class="t-muted" font-size="8">Backend</text>++ <rect x="720" y="114" width="16" height="10" rx="2" class="c-cloud" stroke-width="1"/>+ <text x="742" y="122" class="t-muted" font-size="8">Cloud Service</text>++ <rect x="720" y="130" width="16" height="10" rx="2" class="c-database" stroke-width="1"/>+ <text x="742" y="138" class="t-muted" font-size="8">Database</text>++ <rect x="720" y="146" width="16" height="10" rx="2" class="c-security" stroke-width="1"/>+ <text x="742" y="154" class="t-muted" font-size="8">Security</text>++ <line x1="720" y1="168" x2="736" y2="168" class="a-security" stroke-width="1"/>+ <text x="742" y="171" class="t-muted" font-size="8">Auth Flow</text>++ <rect x="720" y="178" width="16" height="10" rx="2" class="c-security-group" stroke-width="1"/>+ <text x="742" y="186" class="t-muted" font-size="8">Security Group</text>+ </svg>+ </div>++ <!-- Info Cards -->+ <div class="cards">+ <div class="card">+ <div class="card-header">+ <div class="card-dot rose"></div>+ <h3>Card Title 1</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ <li>• Item three</li>+ <li>• Item four</li>+ </ul>+ </div>++ <div class="card">+ <div class="card-header">+ <div class="card-dot amber"></div>+ <h3>Card Title 2</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ <li>• Item three</li>+ <li>• Item four</li>+ </ul>+ </div>++ <div class="card">+ <div class="card-header">+ <div class="card-dot violet"></div>+ <h3>Card Title 3</h3>+ </div>+ <ul>+ <li>• Item one</li>+ <li>• Item two</li>+ <li>• Item three</li>+ <li>• Item four</li>+ </ul>+ </div>+ </div>++ <!-- Footer -->+ <p class="footer">+ [Project Name] • [Additional metadata]+ </p>+ </div>++ <script>+ /* ============================================================+ Theme toggle — persists to localStorage, respects system pref+ ============================================================ */+ (function () {+ var STORAGE_KEY = 'archify-theme';+ var html = document.documentElement;+ var btn = document.getElementById('btn-theme');+ var icon = document.getElementById('theme-icon');+ var label = document.getElementById('theme-label');++ function resolveInitial() {+ var saved = localStorage.getItem(STORAGE_KEY);+ if (saved === 'light' || saved === 'dark') return saved;+ return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';+ }++ function apply(theme) {+ html.setAttribute('data-theme', theme);+ icon.textContent = theme === 'dark' ? '\u263E' : '\u263C';+ label.textContent = theme === 'dark' ? 'Dark' : 'Light';+ }++ apply(resolveInitial());++ btn.addEventListener('click', function () {+ var next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';+ apply(next);+ localStorage.setItem(STORAGE_KEY, next);+ });+ })();++ /* ============================================================+ Export — PNG / JPEG / WebP / SVG+ PNG/JPEG/WebP are rendered from the SVG onto a 2x canvas.+ JPEG/WebP use the current theme's background color.+ ============================================================ */+ (function () {+ var SCALE = 2;++ function diagramFilename() {+ var title = (document.title || 'diagram').replace(/\s+Architecture\s+Diagram$/i, '').trim();+ return title.replace(/[^a-z0-9_\-]+/gi, '-').toLowerCase() || 'diagram';+ }++ function currentBg() {+ return getComputedStyle(document.body).backgroundColor || '#ffffff';+ }++ /**+ * Serialize the main SVG into a standalone document.+ * Inlines the host CSS + the current theme's resolved variables so the+ * serialized SVG renders correctly both as a standalone file and when+ * rasterized via an Image -> canvas pipeline (canvas does not read the+ * host document's CSS).+ */+ function serializeSvg() {+ var svg = document.querySelector('.diagram-container svg');+ var clone = svg.cloneNode(true);++ var vb = svg.viewBox.baseVal;+ clone.setAttribute('width', vb.width);+ clone.setAttribute('height', vb.height);+ clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');++ var theme = document.documentElement.getAttribute('data-theme') || 'dark';+ var hostStyle = Array.prototype.map.call(document.querySelectorAll('style'), function (s) {+ return s.textContent;+ }).join('\n');++ var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;+ var computed = getComputedStyle(themeHost);+ var varNames = [+ '--bg','--grid','--text','--text-muted','--text-dim',+ '--arrow','--arrow-emphasis','--mask',+ '--frontend-fill','--frontend-stroke',+ '--backend-fill','--backend-stroke',+ '--database-fill','--database-stroke',+ '--cloud-fill','--cloud-stroke',+ '--security-fill','--security-stroke',+ '--messagebus-fill','--messagebus-stroke',+ '--external-fill','--external-stroke'+ ];+ var vars = varNames.map(function (n) {+ return n + ': ' + computed.getPropertyValue(n).trim() + ';';+ }).join(' ');++ var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');+ style.textContent =+ "svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }\n" ++ ":root { " + vars + " }\n" ++ hostStyle;+ clone.insertBefore(style, clone.firstChild);++ var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');+ bgRect.setAttribute('width', '100%');+ bgRect.setAttribute('height', '100%');+ bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');+ clone.insertBefore(bgRect, style.nextSibling);++ return {+ svgString: new XMLSerializer().serializeToString(clone),+ width: vb.width,+ height: vb.height+ };+ }++ function download(blob, filename) {+ var url = URL.createObjectURL(blob);+ var a = document.createElement('a');+ a.href = url;+ a.download = filename;+ document.body.appendChild(a);+ a.click();+ a.remove();+ setTimeout(function () { URL.revokeObjectURL(url); }, 1000);+ }++ function rasterize(format) {+ var data = serializeSvg();+ var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });+ var svgUrl = URL.createObjectURL(svgBlob);++ return new Promise(function (resolve, reject) {+ var img = new Image();+ img.onload = function () {+ var canvas = document.createElement('canvas');+ canvas.width = data.width * SCALE;+ canvas.height = data.height * SCALE;+ var ctx = canvas.getContext('2d');+ if (format === 'jpeg') {+ ctx.fillStyle = currentBg();+ ctx.fillRect(0, 0, canvas.width, canvas.height);+ }+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);+ URL.revokeObjectURL(svgUrl);+ var mime = format === 'jpeg' ? 'image/jpeg' :+ format === 'webp' ? 'image/webp' : 'image/png';+ var quality = format === 'png' ? undefined : 0.92;+ canvas.toBlob(function (blob) {+ if (!blob) reject(new Error('toBlob returned null for ' + format));+ else resolve(blob);+ }, mime, quality);+ };+ img.onerror = function (e) {+ URL.revokeObjectURL(svgUrl);+ reject(e);+ };+ img.src = svgUrl;+ });+ }++ var menu = document.getElementById('export-menu');+ var btn = document.getElementById('btn-export');++ btn.addEventListener('click', function (e) {+ e.stopPropagation();+ menu.classList.toggle('open');+ });+ document.addEventListener('click', function (e) {+ if (!menu.contains(e.target) && e.target !== btn) menu.classList.remove('open');+ });++ menu.addEventListener('click', function (e) {+ var target = e.target.closest('button[data-format]');+ if (!target) return;+ var format = target.dataset.format;+ var base = diagramFilename();+ menu.classList.remove('open');+ (format === 'svg'+ ? Promise.resolve(serializeSvg()).then(function (d) {+ download(new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' }), base + '.svg');+ })+ : rasterize(format).then(function (blob) {+ download(blob, base + '.' + format);+ })+ ).catch(function (err) {+ console.error(err);+ alert('Export failed: ' + (err && err.message ? err.message : format));+ });+ });+ })();+ </script>+</body>+</html>diff --git a/examples/aws-serverless.html b/examples/aws-serverless.htmlnew file mode 100644index 00000000..ffacf026--- /dev/null+++ b/examples/aws-serverless.html@@ -0,0 +1,186 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>AWS Serverless Architecture</title>+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">+ <style>+ * { margin: 0; padding: 0; box-sizing: border-box; }+ body {+ font-family: 'JetBrains Mono', monospace;+ background: #020617;+ min-height: 100vh;+ padding: 2rem;+ color: white;+ }+ .container { max-width: 1200px; margin: 0 auto; }+ .header { margin-bottom: 2rem; }+ .header-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }+ .pulse-dot {+ width: 12px; height: 12px; background: #fbbf24;+ border-radius: 50%; animation: pulse 2s infinite;+ }+ @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }+ h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }+ .subtitle { color: #94a3b8; font-size: 0.875rem; margin-left: 1.75rem; }+ .diagram-container {+ background: rgba(15, 23, 42, 0.5);+ border-radius: 1rem; border: 1px solid #1e293b;+ padding: 1.5rem; overflow-x: auto;+ }+ svg { width: 100%; min-width: 900px; display: block; }+ .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 2rem; }+ .card { background: rgba(15, 23, 42, 0.5); border-radius: 0.75rem; border: 1px solid #1e293b; padding: 1.25rem; }+ .card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }+ .card-dot { width: 8px; height: 8px; border-radius: 50%; }+ .card-dot.amber { background: #fbbf24; }+ .card-dot.emerald { background: #34d399; }+ .card-dot.violet { background: #a78bfa; }+ .card h3 { font-size: 0.875rem; font-weight: 600; }+ .card ul { list-style: none; color: #94a3b8; font-size: 0.75rem; }+ .card li { margin-bottom: 0.375rem; }+ .footer { text-align: center; margin-top: 1.5rem; color: #475569; font-size: 0.75rem; }+ </style>+</head>+<body>+ <div class="container">+ <div class="header">+ <div class="header-row">+ <div class="pulse-dot"></div>+ <h1>AWS Serverless Architecture</h1>+ </div>+ <p class="subtitle">Lambda + API Gateway + DynamoDB</p>+ </div>++ <div class="diagram-container">+ <svg viewBox="0 0 950 480">+ <defs>+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" fill="#64748b" />+ </marker>+ <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>+ </pattern>+ </defs>++ <rect width="100%" height="100%" fill="url(#grid)" />++ <!-- AWS Region -->+ <rect x="140" y="30" width="780" height="420" rx="12" fill="rgba(251, 191, 36, 0.05)" stroke="#fbbf24" stroke-width="1" stroke-dasharray="8,4"/>+ <text x="155" y="52" fill="#fbbf24" font-size="10" font-weight="600">AWS Region: us-east-1</text>++ <!-- Arrows -->+ <line x1="120" y1="200" x2="188" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="310" y1="200" x2="378" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="500" y1="200" x2="568" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="690" y1="200" x2="758" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Lambda to S3 -->+ <line x1="630" y1="240" x2="630" y2="318" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Lambda to SQS -->+ <line x1="630" y1="160" x2="630" y2="102" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Users -->+ <rect x="20" y="160" width="100" height="80" rx="6" fill="#0f172a"/>+ <rect x="20" y="160" width="100" height="80" rx="6" fill="rgba(30, 41, 59, 0.5)" stroke="#94a3b8" stroke-width="1.5"/>+ <text x="70" y="195" fill="white" font-size="12" font-weight="600" text-anchor="middle">Clients</text>+ <text x="70" y="215" fill="#94a3b8" font-size="9" text-anchor="middle">Web/Mobile</text>++ <!-- CloudFront -->+ <rect x="190" y="160" width="120" height="80" rx="6" fill="#0f172a"/>+ <rect x="190" y="160" width="120" height="80" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>+ <text x="250" y="195" fill="white" font-size="11" font-weight="600" text-anchor="middle">CloudFront</text>+ <text x="250" y="215" fill="#94a3b8" font-size="9" text-anchor="middle">CDN</text>++ <!-- API Gateway -->+ <rect x="380" y="150" width="120" height="100" rx="6" fill="#0f172a"/>+ <rect x="380" y="150" width="120" height="100" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>+ <text x="440" y="185" fill="white" font-size="11" font-weight="600" text-anchor="middle">API Gateway</text>+ <text x="440" y="205" fill="#94a3b8" font-size="9" text-anchor="middle">REST API</text>+ <text x="440" y="220" fill="#94a3b8" font-size="9" text-anchor="middle">WebSocket</text>+ <text x="440" y="240" fill="#fbbf24" font-size="8" text-anchor="middle">HTTPS</text>++ <!-- Lambda -->+ <rect x="570" y="140" width="120" height="120" rx="6" fill="#0f172a"/>+ <rect x="570" y="140" width="120" height="120" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>+ <text x="630" y="180" fill="white" font-size="11" font-weight="600" text-anchor="middle">Lambda</text>+ <text x="630" y="200" fill="#94a3b8" font-size="9" text-anchor="middle">Functions</text>+ <text x="630" y="215" fill="#94a3b8" font-size="9" text-anchor="middle">Node.js/Python</text>+ <text x="630" y="248" fill="#34d399" font-size="8" text-anchor="middle">Auto-scaling</text>++ <!-- DynamoDB -->+ <rect x="760" y="150" width="130" height="100" rx="6" fill="#0f172a"/>+ <rect x="760" y="150" width="130" height="100" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>+ <text x="825" y="185" fill="white" font-size="11" font-weight="600" text-anchor="middle">DynamoDB</text>+ <text x="825" y="205" fill="#94a3b8" font-size="9" text-anchor="middle">NoSQL Database</text>+ <text x="825" y="220" fill="#94a3b8" font-size="9" text-anchor="middle">On-demand</text>+ <text x="825" y="240" fill="#a78bfa" font-size="8" text-anchor="middle">Single-digit ms</text>++ <!-- S3 -->+ <rect x="570" y="320" width="120" height="90" rx="6" fill="#0f172a"/>+ <rect x="570" y="320" width="120" height="90" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>+ <text x="630" y="355" fill="white" font-size="11" font-weight="600" text-anchor="middle">S3</text>+ <text x="630" y="375" fill="#94a3b8" font-size="9" text-anchor="middle">Object Storage</text>+ <text x="630" y="400" fill="#fbbf24" font-size="8" text-anchor="middle">Static Assets</text>++ <!-- SQS -->+ <rect x="570" y="60" width="120" height="40" rx="6" fill="#0f172a"/>+ <rect x="570" y="60" width="120" height="40" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>+ <text x="630" y="85" fill="white" font-size="11" font-weight="600" text-anchor="middle">SQS</text>++ <!-- Legend -->+ <text x="170" y="420" fill="white" font-size="10" font-weight="600">Legend</text>+ <rect x="170" y="432" width="16" height="10" rx="2" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1"/>+ <text x="192" y="440" fill="#94a3b8" font-size="8">AWS Service</text>+ <rect x="270" y="432" width="16" height="10" rx="2" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1"/>+ <text x="292" y="440" fill="#94a3b8" font-size="8">Compute</text>+ <rect x="360" y="432" width="16" height="10" rx="2" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1"/>+ <text x="382" y="440" fill="#94a3b8" font-size="8">Database</text>+ </svg>+ </div>++ <div class="cards">+ <div class="card">+ <div class="card-header">+ <div class="card-dot amber"></div>+ <h3>Infrastructure</h3>+ </div>+ <ul>+ <li>• CloudFront CDN distribution</li>+ <li>• API Gateway REST endpoints</li>+ <li>• S3 static asset hosting</li>+ <li>• SQS message queues</li>+ </ul>+ </div>+ <div class="card">+ <div class="card-header">+ <div class="card-dot emerald"></div>+ <h3>Compute</h3>+ </div>+ <ul>+ <li>• Lambda functions (Node.js)</li>+ <li>• Auto-scaling to zero</li>+ <li>• Pay-per-invocation</li>+ <li>• 15 min max execution</li>+ </ul>+ </div>+ <div class="card">+ <div class="card-header">+ <div class="card-dot violet"></div>+ <h3>Data</h3>+ </div>+ <ul>+ <li>• DynamoDB tables</li>+ <li>• On-demand capacity</li>+ <li>• Global secondary indexes</li>+ <li>• Point-in-time recovery</li>+ </ul>+ </div>+ </div>++ <p class="footer">AWS Serverless Architecture • Event-driven design</p>+ </div>+</body>+</html>diff --git a/examples/images/aws-serverless.png b/examples/images/aws-serverless.pngnew file mode 100644index 00000000..2c168828Binary files /dev/null and b/examples/images/aws-serverless.png differdiff --git a/examples/images/claude-skills-settings.png b/examples/images/claude-skills-settings.pngnew file mode 100644index 00000000..06984671Binary files /dev/null and b/examples/images/claude-skills-settings.png differdiff --git a/examples/images/microservices.png b/examples/images/microservices.pngnew file mode 100644index 00000000..cb024eb4Binary files /dev/null and b/examples/images/microservices.png differdiff --git a/examples/images/web-app.png b/examples/images/web-app.pngnew file mode 100644index 00000000..98f8414bBinary files /dev/null and b/examples/images/web-app.png differdiff --git a/examples/microservices.html b/examples/microservices.htmlnew file mode 100644index 00000000..2b44b6cd--- /dev/null+++ b/examples/microservices.html@@ -0,0 +1,237 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Microservices Architecture</title>+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">+ <style>+ * { margin: 0; padding: 0; box-sizing: border-box; }+ body {+ font-family: 'JetBrains Mono', monospace;+ background: #020617;+ min-height: 100vh;+ padding: 2rem;+ color: white;+ }+ .container { max-width: 1200px; margin: 0 auto; }+ .header { margin-bottom: 2rem; }+ .header-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }+ .pulse-dot {+ width: 12px; height: 12px; background: #34d399;+ border-radius: 50%; animation: pulse 2s infinite;+ }+ @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }+ h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }+ .subtitle { color: #94a3b8; font-size: 0.875rem; margin-left: 1.75rem; }+ .diagram-container {+ background: rgba(15, 23, 42, 0.5);+ border-radius: 1rem; border: 1px solid #1e293b;+ padding: 1.5rem; overflow-x: auto;+ }+ svg { width: 100%; min-width: 900px; display: block; }+ .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 2rem; }+ .card { background: rgba(15, 23, 42, 0.5); border-radius: 0.75rem; border: 1px solid #1e293b; padding: 1.25rem; }+ .card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }+ .card-dot { width: 8px; height: 8px; border-radius: 50%; }+ .card-dot.cyan { background: #22d3ee; }+ .card-dot.emerald { background: #34d399; }+ .card-dot.rose { background: #fb7185; }+ .card h3 { font-size: 0.875rem; font-weight: 600; }+ .card ul { list-style: none; color: #94a3b8; font-size: 0.75rem; }+ .card li { margin-bottom: 0.375rem; }+ .footer { text-align: center; margin-top: 1.5rem; color: #475569; font-size: 0.75rem; }+ </style>+</head>+<body>+ <div class="container">+ <div class="header">+ <div class="header-row">+ <div class="pulse-dot"></div>+ <h1>Microservices Architecture</h1>+ </div>+ <p class="subtitle">Kubernetes-orchestrated services with API Gateway</p>+ </div>++ <div class="diagram-container">+ <svg viewBox="0 0 950 560">+ <defs>+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" fill="#64748b" />+ </marker>+ <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>+ </pattern>+ </defs>++ <rect width="100%" height="100%" fill="url(#grid)" />++ <!-- Kubernetes Cluster boundary -->+ <rect x="280" y="30" width="640" height="460" rx="12" fill="rgba(34, 211, 238, 0.03)" stroke="#22d3ee" stroke-width="1" stroke-dasharray="8,4"/>+ <text x="295" y="52" fill="#22d3ee" font-size="10" font-weight="600">Kubernetes Cluster</text>++ <!-- Arrows to Gateway -->+ <line x1="120" y1="150" x2="188" y2="150" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="120" y1="380" x2="188" y2="380" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Gateway to services -->+ <line x1="370" y1="180" x2="438" y2="100" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="370" y1="200" x2="438" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="370" y1="220" x2="438" y2="300" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="370" y1="360" x2="438" y2="400" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Services to DBs -->+ <line x1="560" y1="100" x2="698" y2="100" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="560" y1="200" x2="698" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="560" y1="300" x2="698" y2="300" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <line x1="560" y1="400" x2="698" y2="400" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>++ <!-- Message bus connections -->+ <line x1="500" y1="130" x2="500" y2="138" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>+ <line x1="500" y1="162" x2="500" y2="170" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>+ <line x1="500" y1="230" x2="500" y2="238" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>+ <line x1="500" y1="262" x2="500" y2="270" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>+ <line x1="500" y1="330" x2="500" y2="338" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>+ <line x1="500" y1="362" x2="500" y2="370" stroke="#fb7185" stroke-width="1" stroke-dasharray="4,4"/>++ <!-- Web Client -->+ <rect x="20" y="110" width="100" height="80" rx="6" fill="#0f172a"/>+ <rect x="20" y="110" width="100" height="80" rx="6" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1.5"/>+ <text x="70" y="145" fill="white" font-size="11" font-weight="600" text-anchor="middle">Web App</text>+ <text x="70" y="165" fill="#94a3b8" font-size="9" text-anchor="middle">React SPA</text>++ <!-- Mobile Client -->+ <rect x="20" y="340" width="100" height="80" rx="6" fill="#0f172a"/>+ <rect x="20" y="340" width="100" height="80" rx="6" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1.5"/>+ <text x="70" y="375" fill="white" font-size="11" font-weight="600" text-anchor="middle">Mobile App</text>+ <text x="70" y="395" fill="#94a3b8" font-size="9" text-anchor="middle">iOS/Android</text>++ <!-- API Gateway -->+ <rect x="190" y="140" width="180" height="120" rx="6" fill="#0f172a"/>+ <rect x="190" y="140" width="180" height="120" rx="6" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1.5"/>+ <text x="280" y="175" fill="white" font-size="12" font-weight="600" text-anchor="middle">API Gateway</text>+ <text x="280" y="195" fill="#94a3b8" font-size="9" text-anchor="middle">Kong / Nginx</text>+ <text x="280" y="210" fill="#94a3b8" font-size="9" text-anchor="middle">Rate Limiting</text>+ <text x="280" y="225" fill="#94a3b8" font-size="9" text-anchor="middle">Auth / Routing</text>+ <text x="280" y="250" fill="#fb7185" font-size="8" text-anchor="middle">:443</text>++ <!-- Auth Gateway for mobile -->+ <rect x="190" y="340" width="180" height="80" rx="6" fill="#0f172a"/>+ <rect x="190" y="340" width="180" height="80" rx="6" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1.5"/>+ <text x="280" y="375" fill="white" font-size="11" font-weight="600" text-anchor="middle">Auth Service</text>+ <text x="280" y="395" fill="#94a3b8" font-size="9" text-anchor="middle">OAuth 2.0 / JWT</text>++ <!-- User Service -->+ <rect x="440" y="70" width="120" height="60" rx="6" fill="#0f172a"/>+ <rect x="440" y="70" width="120" height="60" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>+ <text x="500" y="95" fill="white" font-size="10" font-weight="600" text-anchor="middle">User Service</text>+ <text x="500" y="115" fill="#94a3b8" font-size="8" text-anchor="middle">Go :8081</text>++ <!-- Order Service -->+ <rect x="440" y="170" width="120" height="60" rx="6" fill="#0f172a"/>+ <rect x="440" y="170" width="120" height="60" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>+ <text x="500" y="195" fill="white" font-size="10" font-weight="600" text-anchor="middle">Order Service</text>+ <text x="500" y="215" fill="#94a3b8" font-size="8" text-anchor="middle">Java :8082</text>++ <!-- Product Service -->+ <rect x="440" y="270" width="120" height="60" rx="6" fill="#0f172a"/>+ <rect x="440" y="270" width="120" height="60" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>+ <text x="500" y="295" fill="white" font-size="10" font-weight="600" text-anchor="middle">Product Service</text>+ <text x="500" y="315" fill="#94a3b8" font-size="8" text-anchor="middle">Python :8083</text>++ <!-- Notification Service -->+ <rect x="440" y="370" width="120" height="60" rx="6" fill="#0f172a"/>+ <rect x="440" y="370" width="120" height="60" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>+ <text x="500" y="395" fill="white" font-size="10" font-weight="600" text-anchor="middle">Notification Svc</text>+ <text x="500" y="415" fill="#94a3b8" font-size="8" text-anchor="middle">Node.js :8084</text>++ <!-- Message Bus -->+ <rect x="440" y="140" width="120" height="20" rx="4" fill="rgba(251, 146, 60, 0.3)" stroke="#fb923c" stroke-width="1"/>+ <text x="500" y="154" fill="#fb923c" font-size="7" text-anchor="middle">Kafka / RabbitMQ</text>++ <rect x="440" y="240" width="120" height="20" rx="4" fill="rgba(251, 146, 60, 0.3)" stroke="#fb923c" stroke-width="1"/>+ <text x="500" y="254" fill="#fb923c" font-size="7" text-anchor="middle">Event Bus</text>++ <rect x="440" y="340" width="120" height="20" rx="4" fill="rgba(251, 146, 60, 0.3)" stroke="#fb923c" stroke-width="1"/>+ <text x="500" y="354" fill="#fb923c" font-size="7" text-anchor="middle">Event Bus</text>++ <!-- PostgreSQL -->+ <rect x="700" y="70" width="100" height="60" rx="6" fill="#0f172a"/>+ <rect x="700" y="70" width="100" height="60" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>+ <text x="750" y="95" fill="white" font-size="10" font-weight="600" text-anchor="middle">PostgreSQL</text>+ <text x="750" y="115" fill="#94a3b8" font-size="8" text-anchor="middle">Users DB</text>++ <!-- MongoDB -->+ <rect x="700" y="170" width="100" height="60" rx="6" fill="#0f172a"/>+ <rect x="700" y="170" width="100" height="60" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>+ <text x="750" y="195" fill="white" font-size="10" font-weight="600" text-anchor="middle">MongoDB</text>+ <text x="750" y="215" fill="#94a3b8" font-size="8" text-anchor="middle">Orders DB</text>++ <!-- Elasticsearch -->+ <rect x="700" y="270" width="100" height="60" rx="6" fill="#0f172a"/>+ <rect x="700" y="270" width="100" height="60" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>+ <text x="750" y="295" fill="white" font-size="10" font-weight="600" text-anchor="middle">Elasticsearch</text>+ <text x="750" y="315" fill="#94a3b8" font-size="8" text-anchor="middle">Products</text>++ <!-- Redis -->+ <rect x="700" y="370" width="100" height="60" rx="6" fill="#0f172a"/>+ <rect x="700" y="370" width="100" height="60" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>+ <text x="750" y="395" fill="white" font-size="10" font-weight="600" text-anchor="middle">Redis</text>+ <text x="750" y="415" fill="#94a3b8" font-size="8" text-anchor="middle">Cache / Queue</text>++ <!-- Legend (placed below all boundaries) -->+ <text x="300" y="510" fill="white" font-size="10" font-weight="600">Legend</text>+ <rect x="300" y="522" width="16" height="10" rx="2" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1"/>+ <text x="322" y="530" fill="#94a3b8" font-size="8">Service</text>+ <rect x="380" y="522" width="16" height="10" rx="2" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1"/>+ <text x="402" y="530" fill="#94a3b8" font-size="8">Database</text>+ <rect x="470" y="522" width="16" height="10" rx="2" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1"/>+ <text x="492" y="530" fill="#94a3b8" font-size="8">Gateway</text>+ <rect x="560" y="522" width="16" height="10" rx="2" fill="rgba(251, 146, 60, 0.3)" stroke="#fb923c" stroke-width="1"/>+ <text x="582" y="530" fill="#94a3b8" font-size="8">Message Bus</text>+ </svg>+ </div>++ <div class="cards">+ <div class="card">+ <div class="card-header">+ <div class="card-dot cyan"></div>+ <h3>Client Applications</h3>+ </div>+ <ul>+ <li>• React SPA (Web)</li>+ <li>• Native iOS/Android</li>+ <li>• Unified API interface</li>+ <li>• JWT authentication</li>+ </ul>+ </div>+ <div class="card">+ <div class="card-header">+ <div class="card-dot emerald"></div>+ <h3>Microservices</h3>+ </div>+ <ul>+ <li>• Polyglot (Go, Java, Python, Node)</li>+ <li>• Independent deployments</li>+ <li>• Event-driven communication</li>+ <li>• Database per service</li>+ </ul>+ </div>+ <div class="card">+ <div class="card-header">+ <div class="card-dot rose"></div>+ <h3>Infrastructure</h3>+ </div>+ <ul>+ <li>• Kubernetes orchestration</li>+ <li>• Kong API Gateway</li>+ <li>• Kafka event streaming</li>+ <li>• Prometheus monitoring</li>+ </ul>+ </div>+ </div>++ <p class="footer">Microservices Architecture • Domain-driven design</p>+ </div>+</body>+</html>diff --git a/examples/web-app.html b/examples/web-app.htmlnew file mode 100644index 00000000..7df2ece5--- /dev/null+++ b/examples/web-app.html@@ -0,0 +1,163 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Web Application Architecture</title>+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">+ <style>+ * { margin: 0; padding: 0; box-sizing: border-box; }+ body {+ font-family: 'JetBrains Mono', monospace;+ background: #020617;+ min-height: 100vh;+ padding: 2rem;+ color: white;+ }+ .container { max-width: 1200px; margin: 0 auto; }+ .header { margin-bottom: 2rem; }+ .header-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }+ .pulse-dot {+ width: 12px; height: 12px; background: #22d3ee;+ border-radius: 50%; animation: pulse 2s infinite;+ }+ @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }+ h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }+ .subtitle { color: #94a3b8; font-size: 0.875rem; margin-left: 1.75rem; }+ .diagram-container {+ background: rgba(15, 23, 42, 0.5);+ border-radius: 1rem; border: 1px solid #1e293b;+ padding: 1.5rem; overflow-x: auto;+ }+ svg { width: 100%; min-width: 800px; display: block; }+ .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 2rem; }+ .card { background: rgba(15, 23, 42, 0.5); border-radius: 0.75rem; border: 1px solid #1e293b; padding: 1.25rem; }+ .card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }+ .card-dot { width: 8px; height: 8px; border-radius: 50%; }+ .card-dot.cyan { background: #22d3ee; }+ .card-dot.emerald { background: #34d399; }+ .card-dot.violet { background: #a78bfa; }+ .card h3 { font-size: 0.875rem; font-weight: 600; }+ .card ul { list-style: none; color: #94a3b8; font-size: 0.75rem; }+ .card li { margin-bottom: 0.375rem; }+ .footer { text-align: center; margin-top: 1.5rem; color: #475569; font-size: 0.75rem; }+ </style>+</head>+<body>+ <div class="container">+ <div class="header">+ <div class="header-row">+ <div class="pulse-dot"></div>+ <h1>Web Application Architecture</h1>+ </div>+ <p class="subtitle">React + Node.js + PostgreSQL stack</p>+ </div>++ <div class="diagram-container">+ <svg viewBox="0 0 900 400">+ <defs>+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">+ <polygon points="0 0, 10 3.5, 0 7" fill="#64748b" />+ </marker>+ <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">+ <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>+ </pattern>+ </defs>++ <rect width="100%" height="100%" fill="url(#grid)" />++ <!-- Arrows (drawn first for z-order) -->+ <line x1="130" y1="200" x2="248" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="189" y="190" fill="#94a3b8" font-size="8" text-anchor="middle">HTTPS</text>++ <line x1="400" y1="200" x2="498" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="449" y="190" fill="#94a3b8" font-size="8" text-anchor="middle">REST API</text>++ <line x1="650" y1="200" x2="748" y2="200" stroke="#64748b" stroke-width="1.5" marker-end="url(#arrowhead)"/>+ <text x="699" y="190" fill="#94a3b8" font-size="8" text-anchor="middle">SQL</text>++ <!-- Users -->+ <rect x="30" y="160" width="100" height="80" rx="6" fill="#0f172a"/>+ <rect x="30" y="160" width="100" height="80" rx="6" fill="rgba(30, 41, 59, 0.5)" stroke="#94a3b8" stroke-width="1.5"/>+ <text x="80" y="195" fill="white" font-size="12" font-weight="600" text-anchor="middle">Users</text>+ <text x="80" y="215" fill="#94a3b8" font-size="9" text-anchor="middle">Browser</text>++ <!-- Frontend -->+ <rect x="250" y="140" width="150" height="120" rx="6" fill="#0f172a"/>+ <rect x="250" y="140" width="150" height="120" rx="6" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1.5"/>+ <text x="325" y="175" fill="white" font-size="12" font-weight="600" text-anchor="middle">Frontend</text>+ <text x="325" y="195" fill="#94a3b8" font-size="9" text-anchor="middle">React</text>+ <text x="325" y="210" fill="#94a3b8" font-size="9" text-anchor="middle">TypeScript</text>+ <text x="325" y="225" fill="#94a3b8" font-size="9" text-anchor="middle">Tailwind CSS</text>+ <text x="325" y="248" fill="#22d3ee" font-size="8" text-anchor="middle">:3000</text>++ <!-- Backend -->+ <rect x="500" y="140" width="150" height="120" rx="6" fill="#0f172a"/>+ <rect x="500" y="140" width="150" height="120" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>+ <text x="575" y="175" fill="white" font-size="12" font-weight="600" text-anchor="middle">Backend</text>+ <text x="575" y="195" fill="#94a3b8" font-size="9" text-anchor="middle">Node.js</text>+ <text x="575" y="210" fill="#94a3b8" font-size="9" text-anchor="middle">Express</text>+ <text x="575" y="225" fill="#94a3b8" font-size="9" text-anchor="middle">REST API</text>+ <text x="575" y="248" fill="#34d399" font-size="8" text-anchor="middle">:8080</text>++ <!-- Database -->+ <rect x="750" y="150" width="120" height="100" rx="6" fill="#0f172a"/>+ <rect x="750" y="150" width="120" height="100" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>+ <text x="810" y="190" fill="white" font-size="12" font-weight="600" text-anchor="middle">PostgreSQL</text>+ <text x="810" y="210" fill="#94a3b8" font-size="9" text-anchor="middle">Database</text>+ <text x="810" y="238" fill="#a78bfa" font-size="8" text-anchor="middle">:5432</text>++ <!-- Legend -->+ <text x="30" y="350" fill="white" font-size="10" font-weight="600">Legend</text>+ <rect x="30" y="362" width="16" height="10" rx="2" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1"/>+ <text x="52" y="370" fill="#94a3b8" font-size="8">Frontend</text>+ <rect x="110" y="362" width="16" height="10" rx="2" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1"/>+ <text x="132" y="370" fill="#94a3b8" font-size="8">Backend</text>+ <rect x="190" y="362" width="16" height="10" rx="2" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1"/>+ <text x="212" y="370" fill="#94a3b8" font-size="8">Database</text>+ </svg>+ </div>++ <div class="cards">+ <div class="card">+ <div class="card-header">+ <div class="card-dot cyan"></div>+ <h3>Frontend Stack</h3>+ </div>+ <ul>+ <li>• React 18 with hooks</li>+ <li>• TypeScript for type safety</li>+ <li>• Tailwind CSS styling</li>+ <li>• Vite build tool</li>+ </ul>+ </div>+ <div class="card">+ <div class="card-header">+ <div class="card-dot emerald"></div>+ <h3>Backend Stack</h3>+ </div>+ <ul>+ <li>• Node.js runtime</li>+ <li>• Express framework</li>+ <li>• JWT authentication</li>+ <li>• REST API design</li>+ </ul>+ </div>+ <div class="card">+ <div class="card-header">+ <div class="card-dot violet"></div>+ <h3>Data Layer</h3>+ </div>+ <ul>+ <li>• PostgreSQL database</li>+ <li>• Prisma ORM</li>+ <li>• Redis caching</li>+ <li>• S3 file storage</li>+ </ul>+ </div>+ </div>++ <p class="footer">Web Application Architecture • Three-tier design</p>+ </div>+</body>+</html>