A meta language to express and transform your ideas to reality.
model Product {
title String
@unique @is.required @form.text @view.title
detail Text
@anything @is.possible(true)
coolness Integer
@is.gt(0) @is.lte(100) @default(100)
}
plugin "./to-database" { url "postgress://" }
plugin "./to-backend" { with "nestjs" }
plugin "./to-frontend" { with "nextjs" }
plugin "./to-docs" { path "/api" }
The .idea
file format is a declarative schema definition language designed to simplify application development by providing a single source of truth for data structures, relationships, and code generation. It enables developers to define their application's data model once and generate multiple outputs including database schemas, TypeScript interfaces, API documentation, forms, and more.
Think of it as the bridge between AI prompting and full-stack code generation - where a simple schema definition can automatically generate everything from database tables to React components, API endpoints to documentation sites.
Define your data model once, use it everywhere. No more maintaining separate schemas for your database, frontend types, API documentation, and validation rules. One .idea
file generates them all.
Generate type-safe code across multiple languages and frameworks. From TypeScript interfaces to Python data classes, from GraphQL schemas to Rust structs - maintain consistency and catch errors at compile time.
Automatically generate boilerplate code, forms, documentation, and more. What used to take hours or days of manual coding now happens in seconds with a single command.
Ensure consistent data structures across your entire application stack. When you update your schema, all generated code updates automatically, eliminating sync issues between frontend and backend.
The plugin system allows custom code generation for any target technology. Create plugins for new frameworks, languages, or tools - the possibilities are limitless.
Perfect for AI-driven development workflows. Describe your data model to an AI, get a .idea
schema, and instantly generate production-ready code across your entire stack.
The true power of .idea
lies in its plugin system - a bridge from simple schema definitions to full-stack applications.
Plugins can generate code for any programming language:
- TypeScript/JavaScript: Interfaces, types, validation schemas
- Python: Data classes, Pydantic models, SQLAlchemy schemas
- Rust: Structs, enums, serialization code
- Go: Structs, JSON tags, validation
- Java: POJOs, JPA entities, validation annotations
- C#: Classes, Entity Framework models
- PHP: Classes, Eloquent models, validation rules
- And many more...
Generate framework-specific code:
- React: Components, forms, hooks, contexts
- Vue: Components, composables, stores
- Angular: Components, services, models
- Svelte: Components, stores, actions
- Next.js: API routes, pages, middleware
- Express: Routes, middleware, controllers
- FastAPI: Routes, models, documentation
- Django: Models, serializers, views
Generate schemas for any database:
- SQL: PostgreSQL, MySQL, SQLite, SQL Server
- NoSQL: MongoDB, DynamoDB, Firestore
- Graph: Neo4j, ArangoDB
- Time-series: InfluxDB, TimescaleDB
- Search: Elasticsearch, Solr
Automatically generate:
- API Documentation: OpenAPI/Swagger specs
- Database Documentation: Schema diagrams, table docs
- Form Generators: HTML forms with validation
- Test Data: Realistic mock data and fixtures
- Migration Scripts: Database migration files
- Configuration Files: Environment configs, CI/CD setups
Here's how a simple e-commerce schema transforms into a full application:
// schema.idea
enum UserRole {
ADMIN "Administrator"
CUSTOMER "Customer"
VENDOR "Vendor"
}
type Address {
street String @required
city String @required
country String @default("US")
}
model User {
id String @id @default("nanoid()")
email String @unique @required @field.input(Email)
name String @required @field.input(Text)
role UserRole @default("CUSTOMER")
address Address?
orders Order[] @relation(Order.userId)
created Date @default("now()")
}
model Product {
id String @id @default("nanoid()")
name String @required @field.input(Text)
price Number @required @field.input(Currency)
description String @field.textarea
category String @field.select
inStock Boolean @default(true)
}
model Order {
id String @id @default("nanoid()")
userId String @relation(User.id)
user User @relation(User, userId)
items OrderItem[] @relation(OrderItem.orderId)
total Number @required
status OrderStatus @default("PENDING")
created Date @default("now()")
}
// Plugin configurations
plugin "./plugins/typescript-generator.js" {
output "./src/types/schema.ts"
}
plugin "./plugins/database-generator.js" {
output "./database/schema.sql"
dialect "postgresql"
}
plugin "./plugins/react-forms.js" {
output "./src/components/forms/"
framework "react"
styling "tailwind"
}
plugin "./plugins/api-generator.js" {
output "./src/api/"
framework "express"
includeValidation true
}
From this single schema, generate:
- β TypeScript interfaces and types
- β PostgreSQL database schema
- β React form components with Tailwind CSS
- β Express.js API routes with validation
- β OpenAPI documentation
- β Test data and fixtures
- β Database migration files
- β Validation schemas (Zod, Joi, etc.)
The .idea
format is perfect for AI-driven development:
- Describe your application to an AI assistant
- Generate a
.idea
schema from the description - Configure plugins for your target technologies
- Execute the transformation to generate full-stack code
- Iterate by updating the schema and regenerating
This workflow enables rapid prototyping and development, making it possible to go from idea to working application in minutes rather than days.
$ npm i -D @stackpress/idea
Create a schema.idea
file:
model User {
id String @id @default("nanoid()")
name String @required
email String @unique @required
created Date @default("now()")
}
plugin "./plugins/typescript-generator.js" {
output "./generated/types.ts"
}
npx idea transform --input schema.idea
Check the generated files in your output directories!
This documentation is organized into several sections:
π Specifications
Complete reference for the .idea
file format syntax, data types, and schema structure.
π Plugin Development
Comprehensive guides for creating custom plugins, including tutorials for:
- Database schema generators
- Form generators
- API documentation generators
- TypeScript interface generators
- And many more...
π§ Parser Documentation
API documentation for the parser library that processes .idea
files.
API documentation for the transformer library that executes plugins and generates code.
The .idea
file format represents a paradigm shift in how we build applications:
- From Manual to Automated: Stop writing boilerplate, start defining intent
- From Fragmented to Unified: One schema, infinite outputs
- From Reactive to Proactive: Catch errors before they happen
- From Slow to Instant: Generate entire application layers in seconds
With the plugin system, you can generate:
- Mobile Apps: React Native, Flutter, native iOS/Android
- Desktop Apps: Electron, Tauri, native applications
- Microservices: Docker configs, Kubernetes manifests
- Infrastructure: Terraform, CloudFormation, Pulumi
- Documentation: Websites, PDFs, interactive guides
- Testing: Unit tests, integration tests, load tests
- Monitoring: Dashboards, alerts, metrics
- And anything else you can imagine...
Ready to transform your development workflow?
- Read the Specifications to understand the syntax
- Explore Plugin Tutorials to see what's possible
- Build Something Amazing with the power of declarative development
The future of application development is declarative, type-safe, and automated. Welcome to the .idea
revolution! π
The line of code thatβs the fastest to write, that never breaks, that doesnβt need maintenance, is the line you never had to write. - Steve Jobs