Skip to content

Commit a499e0a

Browse files
authored
Merge pull request #139 from objectstack-ai/copilot/optimize-document-titles-descriptions
2 parents 3a03848 + aa2fe6d commit a499e0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+563
-208
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: Data Access
3+
description: Learn how to query and access data using ObjectQL's type-safe SDK and JSON-based protocol
4+
---
5+
6+
ObjectQL provides powerful data access capabilities through a **JSON-based Protocol** that works seamlessly across different database backends. Unlike SQL strings or Query Builders, ObjectQL queries are structured data that are type-safe, serializable, and perfect for AI agents.
7+
8+
## Overview
9+
10+
The data access layer in ObjectQL is designed to be:
11+
12+
- **Type-Safe**: Full TypeScript support with auto-generated types from your schema
13+
- **Database Agnostic**: The same query works on MongoDB, PostgreSQL, SQLite, and more
14+
- **AI-Friendly**: Structured JSON format prevents hallucinations and syntax errors
15+
- **Serializable**: Queries can be sent over HTTP, stored in files, or logged for debugging
16+
17+
## Key Topics
18+
19+
### [Querying Data](/docs/data-access/querying)
20+
21+
Learn the fundamentals of querying data with ObjectQL:
22+
- Find operations and filters
23+
- Sorting and pagination
24+
- Field selection and data expansion
25+
- Aggregations and grouping
26+
- Complex queries with nested conditions
27+
28+
### [Client SDK](/docs/data-access/sdk)
29+
30+
Use the TypeScript SDK for type-safe data access:
31+
- Installation and setup
32+
- Basic CRUD operations
33+
- Advanced querying techniques
34+
- Error handling
35+
- TypeScript integration
36+
37+
### [Query Best Practices](/docs/data-access/best-practices)
38+
39+
Optimize your queries for performance:
40+
- Query optimization strategies
41+
- Avoiding N+1 problems
42+
- Efficient data loading
43+
- Caching strategies
44+
- Performance benchmarks
45+
46+
## Quick Example
47+
48+
```typescript
49+
import { ObjectQL } from '@objectql/core';
50+
51+
// Initialize ObjectQL
52+
const app = new ObjectQL({
53+
datasources: {
54+
default: driver
55+
}
56+
});
57+
58+
await app.init();
59+
const ctx = app.createContext({ isSystem: true });
60+
61+
// Query data with filters
62+
const products = await ctx.object('product').find({
63+
fields: ['name', 'price', 'category'],
64+
filters: [
65+
['category', '=', 'electronics'],
66+
'and',
67+
['price', '<', 1000]
68+
],
69+
sort: [['price', 'asc']],
70+
top: 10
71+
});
72+
73+
console.log('Products:', products);
74+
```
75+
76+
## JSON Query Protocol
77+
78+
All queries in ObjectQL follow a consistent JSON structure:
79+
80+
```json
81+
{
82+
"op": "find",
83+
"object": "product",
84+
"args": {
85+
"fields": ["name", "price"],
86+
"filters": [["category", "=", "electronics"]],
87+
"top": 10
88+
}
89+
}
90+
```
91+
92+
This structure makes it easy for frontends, AI agents, and external systems to generate safe, valid queries.
93+
94+
## Next Steps
95+
96+
- Start with **[Querying Data](/docs/data-access/querying)** to learn the basics
97+
- Explore the **[Client SDK](/docs/data-access/sdk)** for type-safe access
98+
- Review **[Best Practices](/docs/data-access/best-practices)** for optimization strategies
99+
- Check the **[API Reference](/docs/reference/api)** for complete documentation
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: Server & Deployment
3+
description: Learn how to configure, integrate, and deploy ObjectQL applications
4+
---
5+
6+
ObjectQL is designed to be **framework-agnostic** and can be integrated with any Node.js server or deployed to various environments. This section covers server configuration, integration patterns, and deployment strategies.
7+
8+
## Overview
9+
10+
The server layer in ObjectQL provides:
11+
12+
- **Multiple Framework Support**: Express, Next.js, Fastify, and more
13+
- **API Styles**: REST, JSON-RPC, GraphQL, and WebSocket support
14+
- **Configuration Management**: Environment-based configuration
15+
- **Plugin System**: Extend functionality with plugins
16+
- **Microservices**: Federation and distributed architectures
17+
18+
## Key Topics
19+
20+
### [Configuration](/docs/server/configuration)
21+
22+
Configure your ObjectQL application:
23+
- Database connections
24+
- Environment variables
25+
- Metadata loading
26+
- Driver configuration
27+
- Runtime options
28+
29+
### [Server Integration](/docs/server/integration)
30+
31+
Integrate ObjectQL with web frameworks:
32+
- Express.js setup
33+
- Next.js integration
34+
- Fastify adapter
35+
- Custom server setup
36+
- HTTP API exposure
37+
38+
### [Microservices & Federation](/docs/server/microservices)
39+
40+
Build distributed systems with ObjectQL:
41+
- Service federation
42+
- Remote data sources
43+
- Cross-service queries
44+
- Load balancing
45+
- Service discovery
46+
47+
### [Plugin System](/docs/server/plugins)
48+
49+
Extend ObjectQL with plugins:
50+
- Creating custom plugins
51+
- Plugin lifecycle
52+
- Bundling behavior
53+
- Sharing plugins
54+
- Official plugins
55+
56+
## Quick Setup
57+
58+
### Express Integration
59+
60+
```typescript
61+
import express from 'express';
62+
import { ObjectQL } from '@objectql/core';
63+
import { SqlDriver } from '@objectql/driver-sql';
64+
import { createNodeHandler } from '@objectql/server';
65+
66+
const app = express();
67+
68+
// Initialize ObjectQL
69+
const objectql = new ObjectQL({
70+
datasources: {
71+
default: new SqlDriver({
72+
client: 'postgresql',
73+
connection: process.env.DATABASE_URL
74+
})
75+
}
76+
});
77+
78+
await objectql.init();
79+
80+
// Mount ObjectQL handler
81+
app.use('/api/objectql', createNodeHandler(objectql));
82+
83+
// Start server
84+
app.listen(3000, () => {
85+
console.log('Server running on http://localhost:3000');
86+
});
87+
```
88+
89+
### Configuration File
90+
91+
```typescript
92+
// objectql.config.ts
93+
import { defineConfig } from '@objectql/core';
94+
95+
export default defineConfig({
96+
datasources: {
97+
default: {
98+
driver: 'sql',
99+
client: 'postgresql',
100+
connection: {
101+
host: process.env.DB_HOST,
102+
database: process.env.DB_NAME,
103+
user: process.env.DB_USER,
104+
password: process.env.DB_PASSWORD
105+
}
106+
}
107+
},
108+
modules: [
109+
'src/objects',
110+
'@objectql/module-auth'
111+
]
112+
});
113+
```
114+
115+
## Deployment Patterns
116+
117+
### Traditional Server
118+
119+
Deploy to VPS, EC2, or dedicated servers:
120+
- Process management with PM2
121+
- Nginx reverse proxy
122+
- Environment configuration
123+
- Database migrations
124+
125+
### Serverless
126+
127+
Deploy to serverless platforms:
128+
- AWS Lambda
129+
- Vercel Functions
130+
- Cloudflare Workers
131+
- Database connection pooling
132+
133+
### Containers
134+
135+
Deploy with Docker:
136+
- Dockerfile configuration
137+
- Docker Compose setup
138+
- Kubernetes deployment
139+
- Health checks and monitoring
140+
141+
## Next Steps
142+
143+
- Configure your application with **[Configuration](/docs/server/configuration)**
144+
- Integrate with your framework using **[Server Integration](/docs/server/integration)**
145+
- Scale with **[Microservices](/docs/server/microservices)**
146+
- Extend with the **[Plugin System](/docs/server/plugins)**
147+
- Review **[API Reference](/docs/reference/api)** for complete documentation

docs/.vitepress/config.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ const guideSidebar = [
5454
{
5555
text: 'Low-Code UI',
5656
items: [
57-
{ text: 'Page & Layouts', link: '/guide/page-metadata' },
57+
{ text: 'Pages & Layouts', link: '/spec/page' },
58+
{ text: 'Views', link: '/spec/view' },
59+
{ text: 'Forms', link: '/spec/form' },
5860
]
5961
},
6062
{

docs/IMPLEMENTATION_SUMMARY.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# ObjectQL Attachment API - Implementation Summary
1+
# Attachment API Implementation Summary
22

3-
## Overview
4-
5-
This implementation adds comprehensive file attachment functionality to ObjectQL, enabling seamless file upload, storage, and download capabilities through REST API endpoints.
3+
Implementation documentation for ObjectQL's comprehensive file attachment system. This summary covers file storage abstraction, REST API endpoints, upload/download functionality, and integration with object metadata for seamless file management.
64

75
## What Has Been Implemented
86

docs/METADATA_TYPES_IMPLEMENTATION.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# Metadata Type Definitions - Implementation Summary
1+
# Metadata Type Definitions Implementation
22

3-
## Overview
4-
5-
This PR implements complete TypeScript type definitions for all ObjectQL metadata formats. Previously, only some metadata types (Object, Validation, Permission, etc.) had TypeScript definitions. This implementation adds the missing types to achieve 100% coverage.
3+
Complete TypeScript type definitions for all ObjectQL metadata formats. This implementation document covers the 100% type coverage achievement, including views, forms, pages, reports, menus, apps, actions, hooks, and workflows—ensuring full type safety across the metadata system.
64

75
## New Type Definitions Added
86

docs/ai/building-apps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Building AI-Native Apps
1+
# Building AI-Native Applications
22

3-
ObjectQL is engineered to be the ideal data layer for AI Agents and LLMs. By providing a **Structure-First** protocol (JSON AST) instead of raw strings (SQL), it drastically reduces hallucinations and injection risks.
3+
Learn how to use ObjectQL as the data layer for AI applications. This comprehensive guide covers RAG (Retrieval-Augmented Generation), semantic search, vector databases, and building AI agents with structured data protocols.
44

55
## 1. Why ObjectQL for AI?
66

docs/ai/cli-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AI-Powered CLI
1+
# AI-Powered Command Line Interface
22

3-
The ObjectQL CLI provides AI-powered commands to generate and validate applications using natural language.
3+
Learn how to use ObjectQL's AI-powered CLI for generating applications, validating metadata, and getting interactive assistance through natural language commands powered by large language models.
44

55
## Overview
66

docs/ai/coding-assistant.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# AI Coding Assistant Guide
1+
# AI Coding Assistant Configuration
22

3-
One of the core design goals of ObjectQL is to be the **most LLM-friendly backend protocol**.
4-
5-
If you are using **Cursor**, **GitHub Copilot Chat**, **Windsurf**, or **ChatGPT** for development, please copy the following **System Prompt** into your AI configuration or project rules (e.g., `.cursorrules`).
3+
Learn how to configure AI coding assistants (GitHub Copilot, Cursor, Windsurf) to become ObjectQL experts. This guide provides specialized system prompts that teach LLMs the ObjectQL protocol and best practices.
64
This allows the AI to accurately understand ObjectQL's syntax and best practices.
75

86
## How to Use Effectively

docs/ai/generating-apps.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# Generating Apps with AI
1+
# Generating Applications with AI
22

3-
Because ObjectQL applications are defined primarily by **Metadata** (YAML/JSON) rather than **Code** (Classes/Functions), LLMs can generate complete, working backends in a single pass.
4-
5-
This is "Zero-Shot Microservice Generation".
3+
Learn how to generate complete ObjectQL applications from natural language descriptions. This guide covers zero-shot microservice generation, prompt templates, and best practices for AI-powered app creation using LLMs.
64

75
## The Workflow
86

docs/ai/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# AI-Native Development
22

3-
ObjectQL resides at the intersection of Data and Artificial Intelligence. It is designed to be "AI-Native" in two distinct ways:
4-
5-
1. **For AI Agents**: It serves as the perfect structured memory system (Long-term Memory) and tool interface for AI agents.
6-
2. **By AI Agents**: Its metadata-driven, protocol-first architecture makes it incredibly easy for LLMs to write valid code for it.
3+
ObjectQL bridges Data and Artificial Intelligence with AI-native architecture designed for both AI agents (as a structured memory system and tool interface) and by AI agents (with metadata-driven, LLM-friendly code generation).
74

85
## Overview
96

0 commit comments

Comments
 (0)