{"id":44569196,"url":"https://github.com/woolkingx/schema-driven-development","last_synced_at":"2026-02-14T02:00:42.046Z","repository":{"id":335851798,"uuid":"1147261371","full_name":"woolkingx/schema-driven-development","owner":"woolkingx","description":"The Type System Revolution: Stop wasting 70% of your time on types, focus on business logic","archived":false,"fork":false,"pushed_at":"2026-02-01T13:24:49.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-01T23:08:52.022Z","etag":null,"topics":["api-contract","contract-testing","cross-language","json-schema","runtime-validation","rust","schema-driven","tdd","type-system","typescript"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woolkingx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-01T13:23:55.000Z","updated_at":"2026-02-01T13:25:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/woolkingx/schema-driven-development","commit_stats":null,"previous_names":["woolkingx/schema-driven-development"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/woolkingx/schema-driven-development","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woolkingx%2Fschema-driven-development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woolkingx%2Fschema-driven-development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woolkingx%2Fschema-driven-development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woolkingx%2Fschema-driven-development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woolkingx","download_url":"https://codeload.github.com/woolkingx/schema-driven-development/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woolkingx%2Fschema-driven-development/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29431593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"online","status_checked_at":"2026-02-14T02:00:07.626Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-contract","contract-testing","cross-language","json-schema","runtime-validation","rust","schema-driven","tdd","type-system","typescript"],"created_at":"2026-02-14T02:00:21.519Z","updated_at":"2026-02-14T02:00:42.036Z","avatar_url":"https://github.com/woolkingx.png","language":null,"readme":"# Schema-Driven Development\n\n\u003e The Type System Revolution: Stop wasting 70% of your time on types, focus on business logic\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n[中文文档](./docs/zh-CN/README.md) | [日本語](./docs/ja/README.md)\n\n## 🎯 The Problem\n\n**Programming has only two essentials**: Data Types (50%) + Business Logic (50%)\n\n**Reality**: We spend 70%+ time on types, only 30% on actual business logic.\n\n**Why?** Because we define types in *code* (language-specific, scattered everywhere).\n\n**Solution**: Define types in *data* (JSON Schema - language-agnostic, single source of truth).\n\n## 💡 Core Philosophy\n\n```\nSchema = Contract = Test = Doc = Object\n```\n\nOne JSON Schema file serves as:\n- ✅ **API Contract**: Frontend/backend agreement\n- ✅ **Automated Tests**: Modify schema = modify all tests\n- ✅ **Type Definitions**: Auto-generate TypeScript/Rust/Python types\n- ✅ **Documentation**: Always-correct API docs\n- ✅ **Dynamic Objects**: JSON-as-Object pattern, natural field alignment\n\n## 🚀 Quick Example\n\n### Traditional Way (2.5 hours)\n\n**TypeScript**:\n```typescript\n// Define types (30 min)\ninterface User {\n  id: string;\n  email: string;\n  name: string;\n}\n\n// Write validation (30 min)\nfunction validateUser(data: any): data is User {\n  if (typeof data.id !== 'string') return false;\n  if (typeof data.email !== 'string') return false;\n  // ... 50 more lines\n}\n\n// Write docs (20 min)\n// Write tests (40 min)\n// Sync with backend (20 min)\n// Business logic (30 min)\n```\n\n**Rust**:\n```rust\n// Duplicate everything in Rust (1 hour)\nstruct User { /* ... */ }\nfn validate_user() { /* ... */ }\n```\n\n### Schema-DD Way (40 minutes)\n\n**One Schema** (10 min):\n```json\n{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"User\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"id\": {\"type\": \"string\"},\n    \"email\": {\"type\": \"string\", \"format\": \"email\"},\n    \"name\": {\"type\": \"string\", \"minLength\": 1}\n  },\n  \"required\": [\"id\", \"email\", \"name\"]\n}\n```\n\n**Auto-Generated** (0 min):\n- ✅ TypeScript types\n- ✅ Rust validation\n- ✅ Python Pydantic models\n- ✅ Documentation\n- ✅ Storybook stories\n- ✅ Test cases\n\n**Business Logic** (30 min):\n```typescript\n// Just focus on business logic!\nfunction createUser(data: User) {\n  // Your actual value-adding code here\n}\n```\n\n**Result**: **4-5x faster**, focus on what matters!\n\n## 🌟 Real-World Success Stories\n\n### Case 1: Claude TUI RS (Streaming Events)\n\n**Challenge**: Terminal UI with 14 streaming event types\n\n**Solution**: JSON-as-Object Pattern + DynamicEvent API\n\n**Results**:\n- ✅ **40x faster** development (3 min vs 2 hours per event type)\n- ✅ **100% doc accuracy** (schema auto-generates docs)\n- ✅ **Zero type errors** (runtime validation + dynamic property access)\n- ✅ **9 passing tests** (schema = tests)\n\n[Details →](./case-studies/claude-tui-rs/)\n\n### Case 2: UI Component Library ⭐ Killer App\n\n**Challenge**: Cross-platform UI library, 50+ components, perfect frontend/backend alignment\n\n**Solution**: Schema Registry + Component Library Pattern\n\n**Results**:\n- ✅ **4-6x faster** development (30 min vs 2-3 hours per component)\n- ✅ **88% maintenance cost** reduction (5h vs 40h per month)\n- ✅ **100% design system** consistency (enforced, can't violate)\n- ✅ **Perfect cross-platform** sync (Web/Mobile/Backend same schema)\n\n**Killer Features**:\n- One Schema = Props + Validation + Docs + Storybook\n- Add component: Write 10 lines JSON → auto-generate everything\n- Design system enforcement: `$ref: colors.schema.json` → impossible to violate\n- Frontend/backend alignment: Same schema, all platforms\n\n[Details →](./case-studies/ui-component-library/)\n\n## 📚 Documentation Structure\n\n```\nschema-driven-development/\n├── README.md                          # You are here\n├── SKILL.md                           # Core methodology (879 lines)\n│\n├── methodology/                       # Design patterns\n│   ├── type-system-revolution.md     # ⭐ Why 70% time on types?\n│   ├── json-as-object.md             # JSON = Object pattern\n│   └── component-library-pattern.md  # Component killer app\n│\n├── references/                        # Language implementations\n│   ├── quick-start.md                # 5-minute tutorial\n│   ├── rust/\n│   │   └── jsonschema-runtime.md     # Runtime validation\n│   ├── typescript/\n│   │   └── ajv-validation.md         # Frontend validation\n│   ├── python/\n│   └── swift/\n│\n├── examples/                          # Runnable examples\n│   ├── schema-registry.rs            # Rust Registry (260 lines)\n│   └── ci-cd-workflow.yml            # GitHub Actions (360 lines)\n│\n├── case-studies/                      # Real projects\n│   ├── claude-tui-rs/                # Streaming events (40x)\n│   └── ui-component-library/         # Components (4-6x)\n│\n└── docs/\n    └── zh-CN/                         # Chinese documentation\n```\n\n## 🎓 Learning Path\n\n### Beginner (30 minutes)\n1. Read [Quick Start](./references/quick-start.md) (5 min)\n2. Understand [Core Concept](./SKILL.md#core-concept) (10 min)\n3. Try [First Example](./examples/user-api/) (15 min)\n\n### Intermediate (2 hours)\n1. Study [JSON-as-Object Pattern](./methodology/json-as-object.md)\n2. Implement [Schema Registry](./examples/schema-registry.rs)\n3. Setup [CI/CD Automation](./examples/ci-cd-workflow.yml)\n\n### Advanced (1 day)\n1. Analyze [Claude TUI RS](./case-studies/claude-tui-rs/) (how 40x achieved)\n2. Study [Component Library](./case-studies/ui-component-library/)\n3. Design team collaboration workflow\n\n## 💡 The Type System Revolution\n\n### Why 70% Time on Types?\n\n**Traditional Programming**:\n```\nTime Breakdown:\n  - Define types: 30-40%\n  - Write validation: 20-30%\n  - Sync types (frontend/backend): 10-15%\n  - Type-related total: 60-85%\n  - Business logic: 15-40% ← Real value!\n```\n\n**Schema-DD**:\n```\nTime Breakdown:\n  - Define schema: 10 min\n  - Auto-generate types: 0 min\n  - Auto-validation: 0 min\n  - Business logic: 30 min ← 75% of time!\n```\n\n**Revolutionary Change**:\n```\nFrom \"types in code\"     → \"types in data\"\nFrom \"70% on types\"      → \"25% on types, 75% on logic\"\nFrom \"frontend/backend   → \"single source of truth,\n      out of sync\"           perfect sync\"\n```\n\n[Read full analysis →](./methodology/type-system-revolution.md)\n\n## 🔧 Tech Stack\n\n### Backend (Rust)\n- `jsonschema` - JSON Schema validation (10-100x faster than Python)\n- `serde_json` - JSON processing\n- `axum` - Web framework\n- `lazy_static` - Global variables\n\n### Frontend (TypeScript)\n- `ajv` - JSON Schema validation\n- `json-schema-to-typescript` - Type generation\n\n### CI/CD\n- GitHub Actions\n- `ajv-cli` - Schema validation\n- `spectral` - Schema linting\n- `specmatic` - Contract testing\n\n### Documentation\n- `json-schema-to-markdown`\n- Swagger UI / ReDoc\n- OpenAPI Generator\n\n## 🎯 Use Cases\n\n### Perfect For\n- ✅ REST API development\n- ✅ Microservices architecture\n- ✅ Frontend/backend separation\n- ✅ Multi-team collaboration\n- ✅ UI component libraries\n- ✅ Low-code platforms\n- ✅ Enterprise applications\n\n### Not For\n- ❌ Monolithic apps (too heavy)\n- ❌ Quick prototypes (initial overhead)\n- ❌ Non-API projects\n- ❌ Fully dynamic APIs\n\n## 🤝 Contributing\n\nWe welcome contributions!\n\n- Report bugs\n- Suggest improvements\n- Share your success stories\n- Contribute language examples (Go, Java, C#, etc.)\n- Add real-world case studies\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## 📄 License\n\nMIT License\n\n## 🎉 Why Schema-DD?\n\n### Traditional Pain Points\n- ❌ Frontend/backend API contracts out of sync\n- ❌ Manually writing repetitive validation tests\n- ❌ Outdated API documentation\n- ❌ Type definitions scattered everywhere\n- ❌ Difficult version evolution\n\n### Schema-DD Solutions\n- ✅ **Single Source of Truth**: One schema rules them all\n- ✅ **TDD 2.0**: Modify schema = modify all tests\n- ✅ **Runtime Validation**: Rust 10-100x faster than Python\n- ✅ **Full Automation**: CI/CD handles everything\n- ✅ **Cross-Language**: Perfect frontend/backend sync\n\n### Efficiency Gains\n- **Development Speed**: 4-10x improvement\n- **Documentation Accuracy**: 100% (auto-generated)\n- **Error Rate**: 100x reduction\n- **Maintenance Cost**: 80-90% reduction\n\n---\n\n**Get Started**: [Quick Start Guide](./references/quick-start.md)\n\n**Deep Dive**: [Full Methodology (SKILL.md)](./SKILL.md)\n\n**Real Examples**: [Case Studies](./case-studies/)\n\n**Language References**: [References](./references/)\n\n---\n\nMade with ❤️ by Schema-DD Community\n\n**Star ⭐ this repo if you believe in the Type System Revolution!**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoolkingx%2Fschema-driven-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoolkingx%2Fschema-driven-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoolkingx%2Fschema-driven-development/lists"}