Skip to content

Commit b4c361d

Browse files
authored
Merge pull request #287 from objectstack-ai/copilot/organize-phase-2-schema-docs
2 parents eae026b + da7e730 commit b4c361d

File tree

7 files changed

+148
-49
lines changed

7 files changed

+148
-49
lines changed

content/docs/blocks/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"title": "Blocks",
33
"pages": [
4+
"block-schema",
45
"authentication",
56
"dashboard",
67
"forms",

content/docs/core/app-schema.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,16 @@ Use expression syntax to show/hide menu items based on user permissions:
287287
}
288288
```
289289

290+
## Use Cases
291+
292+
AppSchema is ideal for:
293+
294+
- **Multi-page applications** - Configure complex application structures with multiple routes
295+
- **Admin dashboards** - Create comprehensive admin panels with role-based navigation
296+
- **CRM systems** - Build customer relationship management interfaces
297+
- **Internal tools** - Develop enterprise internal tools with centralized navigation
298+
- **SaaS products** - Configure multi-tenant applications with customizable layouts
299+
290300
## Best Practices
291301

292302
1. **Use semantic icons** - Choose Lucide icons that clearly represent the section

content/docs/core/enhanced-actions.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,17 @@ if (result.success) {
403403
}
404404
```
405405

406+
## Use Cases
407+
408+
Enhanced Actions are ideal for:
409+
410+
- **API integration** - Connect to backend services and external APIs
411+
- **Multi-step processes** - Execute complex workflows with multiple stages
412+
- **Form submissions** - Handle form data with validation and callbacks
413+
- **Confirmation dialogs** - Add safety checks for critical operations
414+
- **Event tracking** - Monitor user interactions for analytics
415+
- **Batch operations** - Process multiple items in sequence or parallel
416+
406417
## Best Practices
407418

408419
1. **Use confirm for destructive actions** - Always confirm delete, archive, etc.

content/docs/core/report-schema.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,17 @@ if (result.success) {
391391
}
392392
```
393393

394+
## Use Cases
395+
396+
ReportSchema is perfect for:
397+
398+
- **Analytics dashboards** - Display key business metrics and KPIs
399+
- **Business intelligence** - Generate insights from operational data
400+
- **Automated reporting** - Schedule regular reports for stakeholders
401+
- **Data exports** - Provide data in multiple formats (PDF, Excel, CSV)
402+
- **Compliance reporting** - Generate audit trails and regulatory reports
403+
- **Executive summaries** - Create high-level overviews for management
404+
394405
## Best Practices
395406

396407
1. **Use meaningful aggregations** - Choose aggregation types that make sense for the data

content/docs/core/theme-schema.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,16 @@ if (result.success) {
352352
}
353353
```
354354

355+
## Use Cases
356+
357+
ThemeSchema is perfect for:
358+
359+
- **Brand consistency** - Maintain consistent visual identity across applications
360+
- **White-labeling** - Enable multi-tenant applications with custom branding
361+
- **Accessibility** - Provide light/dark modes for user preference
362+
- **Design systems** - Implement comprehensive design tokens
363+
- **A/B testing** - Test different color schemes and typography
364+
355365
## Best Practices
356366

357367
1. **Use semantic colors** - Stick to the semantic color tokens for consistency

content/docs/guide/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"fields",
1010
"component-registry",
1111
"plugins",
12-
"phase2-schemas"
12+
"schema-overview"
1313
]
1414
}
Lines changed: 104 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
---
2-
title: "Phase 2 Schema Reference"
3-
description: "Complete reference for ObjectUI Phase 2 schemas including App, Theme, Reports, Blocks, and Enhanced Actions"
2+
title: "Schema Overview"
3+
description: "Comprehensive overview of ObjectUI schemas for building enterprise applications"
44
---
55

6-
# Phase 2 Schema Reference
6+
# Schema Overview
77

8-
ObjectUI Phase 2 introduces advanced schemas for enterprise applications, providing comprehensive solutions for theming, reporting, reusable components, and complex action workflows.
8+
ObjectUI provides powerful schemas that enable you to build sophisticated enterprise applications with advanced features like theming, reporting, reusable components, and complex workflows. This guide provides an overview of all available schemas and helps you get started quickly.
99

10-
## New Schemas
10+
## Key Capabilities
11+
12+
ObjectUI includes enterprise-grade capabilities to build production-ready applications:
13+
14+
- **Application Structure** - Define complete multi-page applications with navigation
15+
- **Dynamic Theming** - Brand your applications with custom themes and light/dark modes
16+
- **Advanced Actions** - Build complex workflows with API calls, chaining, and conditions
17+
- **Enterprise Reporting** - Generate, schedule, and export comprehensive reports
18+
- **Reusable Components** - Create and share component blocks across projects
19+
20+
## Core Schemas
1121

1222
### Application Configuration
1323

@@ -80,7 +90,7 @@ const action: ActionSchema = {
8090
- **`confirm`** - Confirmation dialogs
8191
- **`dialog`** - Modal/dialog actions
8292

83-
**Advanced Features:**
93+
**Key Features:**
8494
- Action chaining (sequential/parallel)
8595
- Conditional execution (if/then/else)
8696
- Success/failure callbacks
@@ -158,7 +168,7 @@ const block: BlockSchema = {
158168

159169
## View Components
160170

161-
Phase 2 also includes enhanced view components:
171+
ObjectUI also includes enhanced view components:
162172

163173
### [Detail View](/docs/components/detail-view)
164174
Rich detail pages with sections, tabs, and related records.
@@ -172,19 +182,23 @@ Advanced filtering interface with multiple field types.
172182
### [Sort UI](/docs/components/sort-ui)
173183
Sort configuration with multiple fields.
174184

175-
## Getting Started
185+
## Installation & Setup
176186

177-
### Installation
187+
### Package Installation
178188

179-
All Phase 2 schemas are included in `@object-ui/types`:
189+
All schemas are included in `@object-ui/types`. Install it in your project:
180190

181191
```bash
182192
npm install @object-ui/types
183193
# or
184194
pnpm add @object-ui/types
195+
# or
196+
yarn add @object-ui/types
185197
```
186198

187-
### Basic Usage
199+
### TypeScript Usage
200+
201+
Import the type definitions you need:
188202

189203
```typescript
190204
import type {
@@ -198,7 +212,7 @@ import type {
198212

199213
### Runtime Validation
200214

201-
Use Zod schemas for runtime validation:
215+
For runtime validation, use the included Zod schemas:
202216

203217
```typescript
204218
import {
@@ -212,18 +226,21 @@ import {
212226
const result = AppSchema.safeParse(myConfig);
213227
if (result.success) {
214228
// Valid configuration
229+
const app = result.data;
215230
} else {
216231
// Handle validation errors
232+
console.error(result.error);
217233
}
218234
```
219235

220-
## Examples
236+
## Quick Start Example
221237

222-
### Complete Application
238+
Here's a complete example showing how to build a simple CRM application using ObjectUI schemas:
223239

224240
```typescript
225241
import type { AppSchema, ThemeSchema } from '@object-ui/types';
226242

243+
// Define your application structure
227244
const app: AppSchema = {
228245
type: 'app',
229246
name: 'enterprise-crm',
@@ -259,6 +276,7 @@ const app: AppSchema = {
259276
]
260277
};
261278

279+
// Configure your theme
262280
const theme: ThemeSchema = {
263281
type: 'theme',
264282
mode: 'system',
@@ -272,52 +290,90 @@ const theme: ThemeSchema = {
272290
};
273291
```
274292

275-
## Migration Guide
293+
This creates a professional-looking CRM application with:
294+
- A sidebar layout with navigation menu
295+
- Sales section with leads and deals
296+
- User menu with profile and logout options
297+
- Professional theme with light/dark mode support
298+
299+
## Advanced Features
300+
301+
ObjectUI provides advanced schemas and capabilities for enterprise applications:
302+
303+
### Core Schemas
304+
305+
ObjectUI includes these top-level schemas:
306+
307+
- **`AppSchema`** - Define your entire application structure
308+
- **`ThemeSchema`** - Configure themes and color palettes
309+
- **`ReportSchema`** - Create data reports with aggregation
310+
- **`BlockSchema`** - Build reusable component blocks
276311

277-
If you're upgrading from Phase 1, here's what's new:
312+
### Enhanced ActionSchema
278313

279-
### ActionSchema Enhancements
280-
- ✅ New `ajax`, `confirm`, `dialog` action types
281-
- ✅ Action chaining with `chain` array
282-
- ✅ Conditional execution with `condition`
283-
- ✅ Callbacks with `onSuccess` and `onFailure`
284-
- ✅ Tracking with `tracking` config
314+
The `ActionSchema` provides comprehensive action handling:
285315

286-
### New Top-Level Schemas
287-
-`AppSchema` - Application configuration
288-
-`ThemeSchema` - Theming system
289-
-`ReportSchema` - Reporting system
290-
-`BlockSchema` - Reusable blocks
316+
- ✅ Action types: `ajax`, `confirm`, `dialog`
317+
- ✅ Action chaining via the `chain` array (sequential or parallel)
318+
- ✅ Conditional execution with the `condition` property
319+
- ✅ Success/failure callbacks: `onSuccess` and `onFailure`
320+
- ✅ Event tracking with the `tracking` configuration
321+
- ✅ Automatic retry logic
291322

292-
### View Enhancements
293-
-`DetailViewSchema` - Rich detail pages
294-
-`ViewSwitcherSchema` - View mode toggling
295-
-`FilterUISchema` - Enhanced filtering
296-
-`SortUISchema` - Sort configuration
323+
### View Components
297324

298-
## Resources
325+
ObjectUI includes enhanced view components:
326+
327+
- **`DetailViewSchema`** - Rich detail pages with sections and tabs
328+
- **`ViewSwitcherSchema`** - Toggle between list, grid, kanban, calendar views
329+
- **`FilterUISchema`** - Advanced filtering interface
330+
- **`SortUISchema`** - Multi-field sort configuration
331+
332+
## Getting Started
333+
334+
### Installation Steps
335+
336+
1. **Install package** - Add `@object-ui/types` to your project
337+
```bash
338+
npm install @object-ui/types@latest
339+
```
340+
341+
2. **Configure application** - Define your app structure with AppSchema (optional)
342+
343+
3. **Set up theming** - Add a ThemeSchema for consistent styling (optional)
344+
345+
4. **Implement actions** - Use advanced action features like `confirm` and callbacks
346+
347+
5. **Test your application** - Verify all functionality works as expected
348+
349+
## Learning Resources
299350

300351
### Documentation
301-
- [PHASE2_IMPLEMENTATION.md](https://github.com/objectstack-ai/objectui/blob/main/packages/types/PHASE2_IMPLEMENTATION.md) - Complete implementation guide
302-
- [PHASE2_QUICK_START.md](https://github.com/objectstack-ai/objectui/blob/main/PHASE2_QUICK_START.md) - Quick start guide
352+
- **[Implementation Guide](https://github.com/objectstack-ai/objectui/blob/main/packages/types/PHASE2_IMPLEMENTATION.md)** - Complete implementation details and technical specifications
353+
- **[Quick Start Guide](https://github.com/objectstack-ai/objectui/blob/main/PHASE2_QUICK_START.md)** - Step-by-step tutorial for getting started
303354

304355
### API Reference
305-
- [TypeScript Types](https://github.com/objectstack-ai/objectui/tree/main/packages/types/src)
306-
- [Zod Validation](https://github.com/objectstack-ai/objectui/tree/main/packages/types/src/zod)
356+
- **[TypeScript Types](https://github.com/objectstack-ai/objectui/tree/main/packages/types/src)** - Browse all type definitions
357+
- **[Zod Validation Schemas](https://github.com/objectstack-ai/objectui/tree/main/packages/types/src/zod)** - Runtime validation schemas
307358

308-
### Examples
309-
- [Test Suite](https://github.com/objectstack-ai/objectui/blob/main/packages/types/src/__tests__/phase2-schemas.test.ts) - 40+ example configurations
359+
### Code Examples
360+
- **[Test Suite](https://github.com/objectstack-ai/objectui/blob/main/packages/types/src/__tests__/phase2-schemas.test.ts)** - 40+ working examples demonstrating all features
310361

311-
## Support
362+
## Getting Help
312363

313-
Need help? Check out:
314-
- [GitHub Issues](https://github.com/objectstack-ai/objectui/issues)
315-
- [Discussions](https://github.com/objectstack-ai/objectui/discussions)
316-
- [Documentation](https://objectui.com/docs)
364+
### Community Support
365+
- **[GitHub Discussions](https://github.com/objectstack-ai/objectui/discussions)** - Ask questions and share ideas
366+
- **[GitHub Issues](https://github.com/objectstack-ai/objectui/issues)** - Report bugs and request features
367+
368+
### Official Documentation
369+
- **[Documentation Site](https://objectui.com/docs)** - Full documentation and guides
370+
- **[Schema Reference](/docs/core)** - Detailed schema documentation
317371

318372
## Next Steps
319373

320-
1. Review individual schema documentation
321-
2. Check out the [Quick Start Guide](https://github.com/objectstack-ai/objectui/blob/main/PHASE2_QUICK_START.md)
322-
3. Explore [test examples](https://github.com/objectstack-ai/objectui/blob/main/packages/types/src/__tests__/phase2-schemas.test.ts)
323-
4. Build your first Phase 2 application!
374+
Ready to build with ObjectUI? Here's what to do next:
375+
376+
1. **[Review schema documentation](/docs/core)** - Learn about each schema in detail
377+
2. **[Try the Quick Start](https://github.com/objectstack-ai/objectui/blob/main/PHASE2_QUICK_START.md)** - Build your first ObjectUI application
378+
3. **[Explore examples](https://github.com/objectstack-ai/objectui/blob/main/packages/types/src/__tests__/phase2-schemas.test.ts)** - See real-world usage patterns
379+
4. **[Join the community](https://github.com/objectstack-ai/objectui/discussions)** - Connect with other developers

0 commit comments

Comments
 (0)