Skip to content

Commit 4595cf1

Browse files
authored
Merge branch 'stackpress:main' into main
2 parents e18d335 + 6b66776 commit 4595cf1

25 files changed

Lines changed: 2670 additions & 2190 deletions

README.md

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@
1919

2020
> A meta language to express and transform your ideas to reality.
2121
22+
```ts
23+
model Product {
24+
title String
25+
@unique @is.required @form.text @view.title
26+
27+
detail Text
28+
@anything @is.possible(true)
29+
30+
coolness Integer
31+
@is.gt(0) @is.lte(100) @default(100)
32+
}
33+
34+
plugin "./to-database" { url "postgress://" }
35+
plugin "./to-backend" { with "nestjs" }
36+
plugin "./to-frontend" { with "nextjs" }
37+
plugin "./to-docs" { path "/api" }
38+
```
39+
2240
## What is .idea?
2341

2442
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.
@@ -45,27 +63,6 @@ The plugin system allows custom code generation for any target technology. Creat
4563
### 🤖 AI-to-Code Bridge
4664
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.
4765

48-
## Who Should Use This?
49-
50-
### 👨‍💻 Junior Developers
51-
- **Easy-to-understand syntax** with comprehensive examples
52-
- **Rapid prototyping** without deep framework knowledge
53-
- **Learn best practices** through generated code patterns
54-
- **Focus on business logic** instead of boilerplate
55-
56-
### 👩‍💻 Senior Developers
57-
- **Powerful features** for complex applications
58-
- **Extensible plugin system** for custom requirements
59-
- **Cross-platform code generation** for polyglot architectures
60-
- **Maintain consistency** across large codebases
61-
62-
### 👔 CTOs & Technical Leaders
63-
- **Reduce development time** by 60-80% for common tasks
64-
- **Improve code consistency** across teams and projects
65-
- **Lower maintenance costs** with synchronized schemas
66-
- **Accelerate time-to-market** for new features
67-
- **Enable rapid experimentation** and prototyping
68-
6966
## The Plugin Ecosystem
7067

7168
The true power of `.idea` lies in its **plugin system** - a bridge from simple schema definitions to full-stack applications.
@@ -121,7 +118,7 @@ Automatically generate:
121118

122119
Here's how a simple e-commerce schema transforms into a full application:
123120

124-
```typescript
121+
```js
125122
// schema.idea
126123
enum UserRole {
127124
ADMIN "Administrator"
@@ -130,38 +127,38 @@ enum UserRole {
130127
}
131128

132129
type Address {
133-
street String @required
134-
city String @required
130+
street String @required
131+
city String @required
135132
country String @default("US")
136133
}
137134

138135
model User {
139-
id String @id @default("nanoid()")
140-
email String @unique @required @field.input(Email)
141-
name String @required @field.input(Text)
142-
role UserRole @default("CUSTOMER")
136+
id String @id @default("nanoid()")
137+
email String @unique @required @field.input(Email)
138+
name String @required @field.input(Text)
139+
role UserRole @default("CUSTOMER")
143140
address Address?
144-
orders Order[] @relation(Order.userId)
145-
created Date @default("now()")
141+
orders Order[] @relation(Order.userId)
142+
created Date @default("now()")
146143
}
147144

148145
model Product {
149-
id String @id @default("nanoid()")
150-
name String @required @field.input(Text)
151-
price Number @required @field.input(Currency)
152-
description String @field.textarea
153-
category String @field.select
154-
inStock Boolean @default(true)
146+
id String @id @default("nanoid()")
147+
name String @required @field.input(Text)
148+
price Number @required @field.input(Currency)
149+
description String @field.textarea
150+
category String @field.select
151+
inStock Boolean @default(true)
155152
}
156153

157154
model Order {
158-
id String @id @default("nanoid()")
159-
userId String @relation(User.id)
160-
user User @relation(User, userId)
161-
items OrderItem[] @relation(OrderItem.orderId)
162-
total Number @required
155+
id String @id @default("nanoid()")
156+
userId String @relation(User.id)
157+
user User @relation(User, userId)
158+
items OrderItem[] @relation(OrderItem.orderId)
159+
total Number @required
163160
status OrderStatus @default("PENDING")
164-
created Date @default("now()")
161+
created Date @default("now()")
165162
}
166163

167164
// Plugin configurations
@@ -222,7 +219,7 @@ $ npm i -D @stackpress/idea
222219
223220
Create a `schema.idea` file:
224221
225-
```typescript
222+
```js
226223
model User {
227224
id String @id @default("nanoid()")
228225
name String @required
@@ -252,12 +249,6 @@ This documentation is organized into several sections:
252249
### 📋 [Specifications](https://github.com/stackpress/idea/blob/main/docs/Specifications.md)
253250
Complete reference for the `.idea` file format syntax, data types, and schema structure.
254251
255-
### 🔧 [Parser Documentation](https://github.com/stackpress/idea/blob/main/docs/parser/)
256-
Technical documentation for the parser library that processes `.idea` files.
257-
258-
### 🔄 [Transformer Documentation](https://github.com/stackpress/idea/blob/main/docs/transformer/)
259-
Documentation for the transformer library that executes plugins and generates code.
260-
261252
### 🔌 [Plugin Development](https://github.com/stackpress/idea/blob/main/docs/plugins/)
262253
Comprehensive guides for creating custom plugins, including tutorials for:
263254
- Database schema generators
@@ -266,6 +257,12 @@ Comprehensive guides for creating custom plugins, including tutorials for:
266257
- TypeScript interface generators
267258
- And many more...
268259
260+
### 🔧 [Parser Documentation](https://github.com/stackpress/idea/blob/main/docs/api/parser/)
261+
API documentation for the parser library that processes `.idea` files.
262+
263+
### 🔄 [Transformer Documentation](https://github.com/stackpress/idea/blob/main/docs/api/transformer/)
264+
API documentation for the transformer library that executes plugins and generates code.
265+
269266
## The Future of Development
270267
271268
The `.idea` file format represents a paradigm shift in how we build applications:

0 commit comments

Comments
 (0)