@@ -45,69 +45,54 @@ ObjectQL is organized as a Monorepo to ensure modularity and universal compatibi
4545
4646## ⚡ Quick Start
4747
48- ### 1. Installation
48+ ### 1. Create a New Project
49+
50+ The fastest way to start is using the CLI to scaffold a new project.
4951
5052``` bash
51- # Install core and a driver (e.g., Postgres or SQLite)
52- npm install @objectql/core @objectql/driver-sql sqlite3
53+ # Generate a new project
54+ npm create @objectql@latest my-app
55+
56+ # Choose 'starter' for a complete example or 'hello-world' for minimal setup
5357```
5458
55- ### 2. The Universal Script
59+ ### 2. Install VS Code Extension (Critical 🚨)
5660
57- ObjectQL can run in a single file without complex configuration .
61+ For the best experience, install the official extension. It provides ** Intelligent IntelliSense ** and ** Real-time Validation ** for your YAML models .
5862
59- ``` typescript
60- import { ObjectQL } from ' @objectql/core' ;
61- import { SqlDriver } from ' @objectql/driver-sql' ;
62-
63- async function main() {
64- // 1. Initialize Driver (In-Memory SQLite)
65- const driver = new SqlDriver ({
66- client: ' sqlite3' ,
67- connection: { filename: ' :memory:' },
68- useNullAsDefault: true
69- });
70-
71- // 2. Initialize Engine
72- const app = new ObjectQL ({
73- datasources: { default: driver }
74- });
75-
76- // 3. Define Schema (The "Object")
77- // In a real app, this would be loaded from a .yml file
78- app .registerObject ({
79- name: " users" ,
80- fields: {
81- name: { type: " text" , required: true },
82- email: { type: " email" , unique: true },
83- role: {
84- type: " select" ,
85- options: [" admin" , " user" ],
86- defaultValue: " user"
87- }
88- }
89- });
90-
91- await app .init ();
92-
93- // 4. Enjoy Type-Safe(ish) CRUD
94- const ctx = app .createContext ({ isSystem: true });
95- const repo = ctx .object (' users' );
96-
97- // Create
98- await repo .create ({ name: ' Alice' , email: ' alice@example.com' });
99-
100- // Find
101- const users = await repo .find ({
102- filters: [[' role' , ' =' , ' user' ]]
103- });
104-
105- console .log (users );
106- }
63+ * Search for ** "ObjectQL"** in the VS Code Marketplace.
64+ * Or open your new project, and VS Code will recommend it automatically via ` .vscode/extensions.json ` .
65+
66+ ### 3. Define Metadata (The "Object")
67+
68+ ObjectQL uses ** YAML** as the source of truth. Create a file ` src/objects/story.object.yml ` :
69+
70+ ``` yaml
71+ name : story
72+ label : User Story
73+ fields :
74+ title :
75+ type : text
76+ required : true
77+ status :
78+ type : select
79+ options : [draft, active, done]
80+ default : draft
81+ points :
82+ type : number
83+ scale : 0
84+ default : 1
85+ ` ` `
86+
87+ ### 4. Run & Play
10788
108- main ();
89+ Start the development server. ObjectQL will automatically load your YAML files and generate the database schema.
90+
91+ ` ` ` bash
92+ npm run dev
10993```
11094
95+
11196---
11297
11398## 🔌 The Driver Ecosystem
@@ -210,6 +195,33 @@ ObjectQL supports three distinct query interfaces, each optimized for different
210195
211196---
212197
198+ ## 🛠️ Developer Tools
199+
200+ ### VSCode Extension
201+
202+ Enhance your ObjectQL development experience with our official VSCode extension.
203+
204+ ** Features:**
205+ - 🎯 Intelligent IntelliSense for ` .object.yml ` , ` .validation.yml ` , ` .permission.yml ` , ` .app.yml `
206+ - ✅ Real-time JSON Schema validation with inline errors
207+ - 📝 30+ code snippets for objects, fields, validations, hooks, and actions
208+ - ⚡ Quick commands to create new ObjectQL files from templates
209+ - 🎨 Custom file icons and syntax highlighting
210+ - 🔍 Context-aware auto-completion
211+
212+ ** Installation:**
213+ ``` bash
214+ cd packages/tools/vscode-objectql
215+ npm install
216+ npm run compile
217+ npm run package
218+ # Then install the generated .vsix file in VS Code
219+ ```
220+
221+ See [ ` packages/tools/vscode-objectql/README.md ` ] ( ./packages/tools/vscode-objectql/README.md ) for detailed documentation.
222+
223+ ---
224+
213225## 🛠️ Validation & Logic
214226
215227ObjectQL includes a powerful validation engine that runs universally.
@@ -247,6 +259,44 @@ For a complete status report on ObjectQL's implementation against the documented
247259
248260---
249261
262+ ## 🛠️ Development & Contributing
263+
264+ If you fork or clone the repository to contribute or run examples from source:
265+
266+ 1 . ** Setup Workspace**
267+ ``` bash
268+ git clone https://github.com/objectql/objectql.git
269+ cd objectql
270+ npm install -g pnpm
271+ pnpm install
272+ ```
273+
274+ 2 . ** Build Packages**
275+ You must build the core libraries before running examples, as they rely on local workspace builds.
276+ ``` bash
277+ pnpm build
278+ ```
279+
280+ 3 . ** Run Examples**
281+
282+ These examples run as ** scripts** to demonstrate the ObjectQL Core Engine capabilities (Validation, CRUD, Logic Hooks). They use an in-memory SQLite database.
283+
284+ ** Starter (Project Tracker):**
285+ ``` bash
286+ # Starts the API Server (http://localhost:3000)
287+ pnpm --filter @objectql/example-project-tracker start
288+
289+ # Note: Sample data (projects.data.yml) is automatically loaded on startup
290+ ```
291+
292+ ** Enterprise ERP:**
293+ ``` bash
294+ pnpm --filter @objectql/example-enterprise-erp start
295+ # Output: Plugin initialization, Employee creation logs, Audit trails
296+ ```
297+
298+ ---
299+
250300## ⚖️ License
251301
252302ObjectQL is open-source software licensed under the [ MIT License] ( https://www.google.com/search?q=LICENSE ) .
0 commit comments