v0.1.0 · semantic metadata compiler

Define facts.
Infer everything else.

Codepurify is a semantic metadata inference engine and template compiler. Describe your domain once — it infers query capabilities, mutation semantics, relation graphs, workflows, and validation rules, then renders any architecture you need.

$npm install codepurify
JSTSPyNode</></>;

Features

Core Features

Stop wasting tokens on repetitive AI prompts. Generate consistent architecture across any language with deterministic, template-driven code generation.

  • Deterministic architecture generation
  • AI-efficient token usage
  • Language-neutral domain modeling
  • Framework agnostic templates
  • Zero architectural drift
  • Single source of truth
  • Consistent code generation
  • Reduced AI hallucinations
  • Scalable across languages
  • Template-driven architecture

Pipeline

How It Works

Define your domain once, generate consistent architecture everywhere. No more repetitive AI prompts or architectural drift.

Create typed entity configs with fields, relationships, and business rules. Use TypeScript to define your domain model once.
Automatically detect entity relationships, foreign keys, and connection patterns. No manual relationship mapping required.
Generate rich context objects with field metadata, validation rules, query capabilities, and mutation semantics.
Use Codepurify templates to render context into any language or framework. Create reusable templates for consistent architecture.
Produce production-ready code with proper typing, validation, and patterns. Generate DTOs, entities, APIs, and more.
Deploy generated code to any platform. Works with Node.js, Python, Java, Go, and any framework you can template.

Examples

Define Once, Generate Everywhere

Single source of truth for your domain. Generate consistent architecture across any language or framework without repetitive AI prompts.

Domain Config

Define your entities once with language-neutral facts

user.entity.config.ts
export default class UserEntityConfig
   implements EntityConfigBase {
  key = "user";

  fields = this.defineFields({
    email: stringField({
      length: 255,
    }),

    status: enumField([
      "active",
      "suspended",
    ]),
  });
}

Template Logic

Simple Codepurify templates render your deterministic context

dto.create.codepurify
type I{{entity.name.casing.pascal}} = {

  // Each field becomes a property

  };

class {{entity.name.casing.pascal}}Repo{

  async create(dto: I{|...pascal|}) {
    return this.create(dto);
  }
  ...more methods
};

Generated Code

Consistent output across any language or framework

create-user.dto.ts
export type IUser = {
  email: string;
  status: UserStatus;

  // ...other fields
};

class UseryRepo {
  constructor() {}

  async create(dto: IUser) {
    return this.create(dto);
  }

}

Use Cases

Generate anything

One semantic source of truth. Unlimited template-driven outputs.

Backend

  • ORM entities
  • Repositories
  • DTOs
  • Validation layers
  • Query builders

API & Schema

  • GraphQL schemas
  • OpenAPI specs
  • Zod schemas
  • Pydantic models

Frontend

  • React forms
  • Admin panels
  • SDKs
  • Metadata registries

Start generating from semantic facts

MIT licensed. Framework agnostic. One config, infinite architecture outputs. Open source and ready for your contributions.

Open source MIT license

Community driven development

Contributions welcome