Skip to content

stackpress/idea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’‘ Idea



Form an Idea Β Β β€’Β Β  Transform an Idea Β Β β€’Β Β  Code Extension

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" }

What is .idea?

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.

Key Benefits

🎯 Single Source of Truth

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.

πŸ›‘οΈ Type Safety Across Languages

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.

⚑ Rapid Development

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.

πŸ”„ Perfect Consistency

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.

πŸ”Œ Infinite Extensibility

The plugin system allows custom code generation for any target technology. Create plugins for new frameworks, languages, or tools - the possibilities are limitless.

πŸ€– AI-to-Code Bridge

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 Plugin Ecosystem

The true power of .idea lies in its plugin system - a bridge from simple schema definitions to full-stack applications.

🌐 Multi-Language Support

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...

πŸ› οΈ Framework Integration

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

πŸ—„οΈ Database Support

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

πŸ“š Documentation & Tools

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

Real-World Example

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.)

AI-Powered Development Workflow

The .idea format is perfect for AI-driven development:

  1. Describe your application to an AI assistant
  2. Generate a .idea schema from the description
  3. Configure plugins for your target technologies
  4. Execute the transformation to generate full-stack code
  5. 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.

Getting Started

1. Installation

$ npm i -D @stackpress/idea

2. Create Your First Schema

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"
}

3. Generate Code

npx idea transform --input schema.idea

4. Explore the Results

Check the generated files in your output directories!

Documentation Structure

This documentation is organized into several sections:

Complete reference for the .idea file format syntax, data types, and schema structure.

Comprehensive guides for creating custom plugins, including tutorials for:

  • Database schema generators
  • Form generators
  • API documentation generators
  • TypeScript interface generators
  • And many more...

API documentation for the parser library that processes .idea files.

API documentation for the transformer library that executes plugins and generates code.

The Future of Development

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

Endless Possibilities

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...

Start Building Today

Ready to transform your development workflow?

  1. Read the Specifications to understand the syntax
  2. Explore Plugin Tutorials to see what's possible
  3. 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

About

Meta files to express and transform ideas to reality.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5