Inspiration
Working with an unfamiliar system often starts with incomplete JSON samples, noisy production logs, or scattered notes about how the data should behave. SchemaLens was inspired by the idea of giving developers a fast, local starting point: paste the data you have, identify the concepts inside it, and receive an editable schema instead of a blank migration file.
What it does
SchemaLens is a dependency-free Node.js CLI that reads a JSON file, a log file, or plain English text and infers entities, fields, basic types, and simple relationships. It can generate PostgreSQL-style SQL, TypeScript interfaces, Prisma models, JSON Schema, and Mermaid ER diagrams. The CLI detects the input format automatically and writes the result next to the input file unless the user supplies an output path.
For plain English input, SchemaLens uses an English-focused vocabulary of common product, commerce, support, and operations concepts. Users can extend that vocabulary with JSON plugin files for domain-specific terms such as healthcare, finance, or logistics.
How I built it
I built SchemaLens as a small Node.js command-line application with no runtime dependencies. The core pipeline first attempts JSON parsing, then looks for structured key-value log lines, and finally applies plain-text vocabulary matching. A shared internal data model represents entities and fields before dedicated renderers convert it into SQL, TypeScript, Prisma, JSON Schema, or Mermaid syntax.
The vocabulary plugin system loads one or more local JSON files and merges their entity fields with the built-in English vocabulary. This keeps the core tool lightweight while allowing users to adapt it to their own domain without editing source code. Codex with GPT-5.6 was used to iterate on the CLI design, implementation, documentation, and local validation.
Challenges we ran into
The largest challenge was making one inferred model work across very different sources. JSON contains explicit nesting, logs expose flat event properties, and plain text is inherently ambiguous. I had to make conservative assumptions that produce useful output without pretending that every inferred constraint is certain.
Another challenge was naming. Plural entity names, camelCase keys, foreign-key-looking fields, and output-specific naming rules all need normalization. I also needed the generated Prisma, SQL, TypeScript, JSON Schema, and Mermaid output to remain understandable even when the source data does not fully define relationships.
Accomplishments that we're proud of
I am proud that SchemaLens runs locally with Node.js and does not require an API key, cloud service, or dependency installation to integrate in any platform. It supports five practical output formats from the same command and preserves a simple workflow: point to a file, choose an optional format, and receive an artifact.
I am also proud of the extensible vocabulary approach. Rather than hard-coding every industry term, users can add a small JSON file and immediately teach SchemaLens about their own entities. The project includes an example healthcare vocabulary and text fixture to make that extension path concrete.
What we learned
I learned that schema inference is most valuable when it is positioned as an editable first draft. The tool should expose clear output, use predictable defaults, and encourage review instead of claiming perfect semantic understanding.
I also learned that output formats are not merely serialization choices. SQL emphasizes constraints, TypeScript emphasizes developer ergonomics, Prisma emphasizes model relations, JSON Schema emphasizes validation, and Mermaid emphasizes communication. Keeping a common intermediate model made it possible to support all of them consistently.
What's next for SchemaLens
Next, I want to improve relationship inference across log events and plain-text statements, including cardinality and nullable fields. I also plan to support richer vocabulary metadata, such as explicit field types, required fields, aliases, and relationships.
Other future directions include interactive review prompts, database-dialect options, migration-file generation, stronger validation for generated Prisma schemas, and additional importers for CSV and API specifications. The goal remains the same: help developers move from messy evidence to a trustworthy schema faster.
Built With
- codex
- gpt-5.6
- node.js


Log in or sign up for Devpost to join the conversation.