Skip to content
108 changes: 108 additions & 0 deletions docs/research/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Research Summary: Similar Zod Code-Generation Projects

I've completed comprehensive research on similar Zod-related code generation projects on GitHub. Here are the key findings:

## Overview

**Total Projects Analyzed**: 25
**Projects with 1000+ Stars**: 6
**Projects with 100+ Stars**: 14

## Top Projects by Category

### 1. Schema Serialization (Zod → Code)
- **zod-codepen** (this project) - Runtime Zod → code serialization
- **zod-to-code** (lucaconlaq) - Similar goal, less feature-rich
- **drizzle-zod-to-code** - Drizzle ORM → Zod code

### 2. TypeScript ↔ Zod Conversion
- **ts-to-zod** ⭐ (1,568 stars) - Generate Zod from TypeScript types
- **zod-to-ts** (396 stars) - Generate TypeScript from Zod
- **vscode-zodschema-generator** - VS Code extension

### 3. JSON Schema Integration
- **zod-to-json-schema** ⭐ (1,222 stars) - Zod → JSON Schema
- **json-schema-to-zod** (514 stars) - JSON Schema → Zod

### 4. Prisma Integration
- **zod-prisma** (906 stars) - Prisma → Zod schemas
- **zod-prisma-types** (860 stars) - Advanced Prisma Zod generator
- **prisma-zod-generator** (775 stars) - Another Prisma generator
- **prisma-trpc-generator** (733 stars) - Prisma → tRPC + Zod

### 5. OpenAPI/REST Integration
- **zodios** ⭐ (1,878 stars) - HTTP client/server with Zod
- **kubb** ⭐ (1,446 stars) - Ultimate API toolkit
- **zod-to-openapi** (1,422 stars) - Zod → OpenAPI docs
- **openapi-zod-client** (1,096 stars) - OpenAPI → Zodios client
- **zod-openapi** (574 stars) - Zod → OpenAPI v3.x

### 6. Full-Stack tRPC Solutions
- **feTS** (706 stars) - TypeScript HTTP framework
- **fullstack-starter-template** (304 stars) - Complete starter
- **t3-blog** (141 stars) - Real-world full-stack app
- **next-trpc-typescript-zod** (69 stars) - Tutorial project

## Key Insights

### What Makes zod-codepen Unique

**zod-codepen** occupies a unique position in the ecosystem by:

✅ **Runtime serialization**: Converts live Zod schema objects → code strings
✅ **Dual version support**: Both Zod v3 and v4
✅ **Module generation**: Complete TypeScript modules with exports
✅ **Extensibility**: Custom handler registration
✅ **Formatted output**: Pretty-printed, readable code

Most other projects focus on:
- TypeScript → Zod (ts-to-zod)
- Zod → JSON Schema/OpenAPI
- Database/ORM → Zod

### Ecosystem Trends

1. **Full-stack type safety** is the dominant pattern
2. **Prisma + Zod + tRPC** is a popular stack
3. **OpenAPI integration** is essential for REST APIs
4. Most projects support **Zod v3**; v4 support is emerging
5. **Runtime serialization** (like zod-codepen) fills a unique gap

## Use Cases for zod-codepen

Based on the research, zod-codepen is particularly valuable for:

1. **Developer Tools**: Schema inspection and debugging
2. **Documentation**: Auto-generate schema examples
3. **Code Generation**: Export schemas to files
4. **Migration Tools**: Schema versioning and comparison
5. **IDE Extensions**: Schema visualization
6. **Testing Tools**: Snapshot testing for schemas

## Recommendations

### Positioning
- Emphasize the unique **runtime serialization** capability
- Highlight **dual Zod v3/v4 support** as a competitive advantage
- Position as essential **developer tooling**

### Integration Opportunities
- Prisma generator plugin (output schemas as code)
- tRPC router visualization
- VS Code extension for schema inspection
- Documentation generation tools

### Future Features
- CLI tool for batch processing
- Online playground (like TypeScript Playground)
- Export to multiple formats (CommonJS, ESM, JSON)
- Schema diff/comparison tools

## Full Research Document

For complete details including all 25 projects, detailed analysis, and recommendations, see:
📄 **[docs/research/similar-projects.md](./docs/research/similar-projects.md)**

---

The research confirms that **zod-codepen** fills an important gap in the Zod ecosystem by providing runtime schema-to-code serialization with excellent version support and extensibility. This makes it uniquely positioned for developer tooling, debugging, and documentation use cases.
Loading