Skip to content

🗺️ Architecture Template Library ​

Every template is an "architecture map." We focus strictly on architecture — no language, framework, or syntax. The goal: after reading a template, you understand why this class of system is designed this way, and can use it as the starting point for your own design.


Template Catalog ​

31 templates in total: 16 classic / general systems + 5 AI-native systems + 4 AI coding / autonomous Agents + 1 system prompt architecture + 5 industrial / embedded systems. Every template ends with links to real open-source projects and engineering docs (see Section 14 "Reference Prototypes & Further Reading" in each template).

Classic / General Systems ​

TemplateRepresentative ProductsOne-Line PositioningKey Architecture Themes
AI Chat ProductClaude, ChatGPTWrap a large language model into a conversational, streaming, web-connected productInference serving, streaming, context, RAG, cost
Browser ExtensionHoney, GrammarlySafely inject capabilities into third-party web pages and monetizeScript separation, injection, privacy boundaries, monetization
Standard Web AppCorporate sites, blogs, SaaS dashboardsThe "good enough" architecture that 90% of projects actually needThree-tier, caching, read/write split
Mobile AppMost iOS/Android appsDeliver a smooth experience over unreliable networksOffline-first, sync, client state, push
E-commerce PlatformAmazon, Shopify, TaobaoKeep money and inventory accurate under high concurrencyInventory, orders, payment, overselling, traffic spikes
Social FeedTwitter/X, InstagramRank and deliver massive content to every user by social graph and interestFeed push/pull, follow graph, hot fan-out
Video StreamingNetflix, YouTubeDeliver large media files globally with minimal latency and bandwidth costTranscoding, CDN, adaptive bitrate, recommendation
Realtime ChatWhatsApp, Slack, WeChatDeliver messages fast, reliably, and in orderLong-lived connections, ordering, offline delivery, group fan-out
URL ShortenerBitly, TinyURL, t.coCompress long URLs into shareable, trackable short codes and redirect at ultra-low latencyRead-heavy, caching, 301/302, distributed unique IDs
Payment SystemStripe, Alipay, PayPalKeep every cent accounted for in an uncertain, distributed worldIdempotency, double-entry ledger, reconciliation, state machine
Search EngineGoogle, ElasticsearchHit and rank documents in milliseconds using inverted indexesInverted index, relevance, recall + rerank, sharding
Ride-HailingUber, Lyft, DiDiMatch massive numbers of riders and drivers on a live map in secondsGeospatial index, real-time location, supply–demand matching
Collaborative DocGoogle Docs, FigmaLet multiple users edit simultaneously and merge in real time without overwriting each otherOT/CRDT, single-writer serialization, operation log
Cloud StorageDropbox, iCloudNever lose files, sync across devices, and minimize storage footprintChunking, content-addressed dedup, incremental sync
Notification SystemNovu, FCM/APNsDeliver "what happened" to the right person reliably and with restraintMulti-channel fan-out, dedup & rate-limiting, async retry
Online TicketingTicketmaster, Damai, 12306Handle massive instant contention for finite seats without oversellingVirtual waiting room, atomic stock decrement, seat-lock TTL

🤖 AI-Native Systems (LLM Era) ​

TemplateRepresentative Products / PrototypesOne-Line PositioningKey Architecture Themes
AI Gateway / RelayOne API, LiteLLM, PortkeyAccess all large models through a unified entry point with centralized governanceUnified API, billing & rate-limiting, load balancing, caching
RAG Knowledge BaseRAGFlow, LlamaIndex, DifyGive the model an "open-book exam" grounded in your own documentsChunking, vector retrieval, hybrid search + rerank, citations
AI Agent / WorkflowDify, Coze, LangGraphLet the model plan → call tools → observe → decide againAction loop, tool sandbox, memory, controllable fallbacks
Inference ServingvLLM, SGLang, TritonSqueeze maximum throughput out of GPUs when serving modelsContinuous batching, paged KV cache, quantization, replicas
Vector DatabaseMilvus, Qdrant, pgvectorMillisecond similarity search over massive high-dimensional vectorsANN, HNSW/IVF, recall–latency trade-off

🦾 AI Coding & Autonomous Agents (New in 2026) ​

TemplateRepresentative Products / PrototypesOne-Line PositioningKey Architecture Themes
Claude CodeClaude Code (Anthropic)A local-first coding agent that puts Claude directly in your terminalAutonomous loop, subagents/hooks/MCP, two-tier permissions + OS sandbox, context compaction
OpenAI CodexCodex CLI + CloudOne kernel, two forms: local real-time pairing + cloud async execution that opens PRsDual form factor, sandbox × approval axes, kernel isolation, offline by default
OpenClaw (the lobster 🦞)OpenClaw (formerly Clawdbot/Moltbot)Self-hosted, always-on gateway that wires an agent into the chat apps you already useSingle-process gateway, chat apps as UI, heartbeat/cron, pluggable harness
HermesHermes (Nous Research)A self-hosted, always-on agent that grows alongside youFTS5 persistent memory, auto-distilled skills, cron, multi-channel / multi-provider

📜 System Prompt Architecture ​

TemplateRepresentative Products / PrototypesOne-Line PositioningKey Architecture Themes
System Prompt ArchitectureClaude Fable 5, GPT-5.5, Gemini, Grok, CursorA layered Agent OS that turns a raw large model into a productSix-layer modules, decision-tree routing, externalized Skills, compliance hard rules, runtime injection

🏭 Industrial / Embedded Systems (New in 2026) ​

What this group shares: software bugs become physical-world consequences — bricked hardware, halted production lines, or physical collisions. The protagonist of the architecture shifts from "scaling and iteration" to "isolation, autonomy, and fail-safes."

TemplateRepresentative Products / PrototypesOne-Line PositioningKey Architecture Themes
Embedded Device FirmwareSmart locks, wearables; Zephyr, FreeRTOSResource-locked micro-systems where errors have nowhere to hideHAL layering, state machines, watchdog, A/B dual-bank OTA
IoT Device PlatformAWS IoT Core, Tuya; ThingsBoard, EMQXKeep millions of unreliable devices connected, reporting up, and controllable downMassive long-lived connections, per-device identity, device shadow, staged OTA
Industrial Edge / SCADAFactory data acquisition, SCADA; EdgeX, OPC UAA regulated border crossing between OT and ITProtocol normalization, edge autonomy, Purdue isolation, gated reverse control
Automotive E/ETesla central compute, domain controllers; openpilot, AUTOSARA data center on wheels where braking always comes firstASIL isolation, dual bus networks, whole-vehicle OTA, shadow mode
Robotics SystemRobot vacuums, AGVs, drones; ROS 2, PX4Millisecond physical closed loop of sense → plan → actFrequency layering, independent safety bypass, record & replay, fleet management

Every Template Shares the Same 14-Section Structure ​

We deliberately make every template follow the exact same structure (see _TEMPLATE.md). This has two benefits:

  1. You read faster the more you read: the first template you read top-to-bottom; by the tenth, you can jump straight to "Key Decisions & Trade-offs."
  2. The structure itself is the lesson: these 14 sections are the exact 14 questions you should ask yourself in order when designing any system.
#SectionWhat question it answers
1One-Line PositioningWhat actually is this thing?
2Business EssenceWhat real problem does it solve? Who pays for it?
3Core Requirements & ConstraintsWhat must it do (functional)? How well must it do it (quality attributes)?
4High-Level Architecture DiagramWhat does the whole system look like? (An ASCII diagram)
5Component ResponsibilitiesWhat does each part do, and why does it need to exist?
6Key Data FlowsHow do requests and data move step by step in core scenarios?
7Data Model & Storage ChoicesWhat is stored, and why in this type of store?
8Key Architecture Decisions & Trade-offsWhere are the forks in the road, and what was given up?
9Scaling & BottlenecksWhen traffic grows 100×, what breaks first?
10Security & ComplianceWhere is the attack surface? Which data must never be mishandled?
11Common Pitfalls / Anti-PatternsWhere do newcomers most often get this wrong?
12Evolution PathMVP → Growth → Maturity: what does the architecture look like at each stage?
13Reusable TakeawaysWhich architectural ideas here transfer to other systems?
14Reference Prototypes & Further ReadingWhich real open-source projects and engineering papers is this based on?

Reading Tips ​

  • Don't memorize the diagrams. Remember why the boxes are connected that way, not how many boxes there are. Change the scale or the constraints, and the diagram for the exact same system changes completely.
  • Focus on Sections 8, 9, and 11. These three sections (trade-offs, bottlenecks, pitfalls) concentrate real-world scars and are the most valuable parts for both interviews and production work.
  • Compare yourself against Section 12 (Evolution Path). What you are building right now probably does not need the heavy maturity-stage architecture. Know which stage you are in and avoid over-engineering.

A Note on Realism ​

These templates are distilled from publicly shared architecture principles, engineering blogs, technical talks, and industry-standard practices of the representative products. Their purpose is teaching: capturing the shared architectural essence and key trade-offs of each class of system.

They are not internal blueprints of any specific company; concrete numbers and component names have been generalized. Read them as "what a typical architecture for this class of system looks like," not "how Company X implements it internally."


Want to Contribute a New Template? ​

  1. Copy _TEMPLATE.md into a new directory, e.g., templates/your-system/README.md.
  2. Fill in all 14 sections (including real, verified reference prototype links) and stay strictly at the architecture level — the moment you write "use library YY in language XX," stop and ask: is this an architectural decision, or an implementation detail?
  3. Draw diagrams in ASCII (plain text, viewable everywhere, never breaks).
  4. Add a row to the catalog tables.

The bar: an engineer who has never worked in this domain should be able to read your template and clearly explain "why this class of system is designed this way, and where it breaks at scale."

💬 Comments