Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 123 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ObjectStack Starter Template

A starter template for building [ObjectStack](https://objectstack.ai) applications. This template demonstrates the basic structure and conventions for creating metadata-driven low-code applications using the ObjectStack framework.
A multi-package starter template for building [ObjectStack](https://objectstack.ai) applications. This monorepo demonstrates the structure and conventions for creating metadata-driven low-code applications using the ObjectStack framework, with multiple examples covering different use cases.

[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)
[![ObjectStack Spec](https://img.shields.io/badge/@objectstack/spec-0.3.3-green.svg)](https://www.npmjs.com/package/@objectstack/spec)
Expand All @@ -15,84 +15,136 @@ A starter template for building [ObjectStack](https://objectstack.ai) applicatio
git clone https://github.com/objectstack-ai/objectstack-starter.git
cd objectstack-starter

# Install dependencies
# Install dependencies (installs all workspace packages)
npm install

# Build the project
# Build all packages
npm run build
```

### Running Examples

This template includes multiple example applications demonstrating different use cases:

```bash
# Run the basic example (core objects)
npm run example:basic

# Run the e-commerce example
npm run example:ecommerce

# Run the blog example
npm run example:blog

# Run the CRM example
npm run example:crm
```

### Development

```bash
# Watch mode - automatically rebuild on changes
# Watch mode - automatically rebuild all packages on changes
npm run dev

# Build specific package
npm run build:core
npm run build:examples

# Type checking
npm run type-check

# Clean build artifacts
npm run clean
```

### Running the Example
## 📦 What's Included

The template includes an example file demonstrating how to use the defined objects and views:
This starter template is organized as a monorepo with multiple packages:

```bash
# Build the project
npm run build
### Package: @objectstack-starter/core

# Run the example
node dist/example.js
```
Core package with base objects and views:

This will show you how to import and work with the ObjectStack definitions.
**Data Objects:**
- **Project Task** - Task management with status, priority, assignments, and time tracking
- **Contact** - Contact management with CRM capabilities

## 📦 What's Included
**UI Views:**
- Task list view (grid)
- Task kanban board
- Contact list view (grid)
- Main app definition

This starter template includes:
### Package: @objectstack-starter/examples

### Data Objects (`src/data/`)
Example applications demonstrating different use cases:

- **Project Task** (`project-task.object.ts`) - Task management with status, priority, assignments, and time tracking
- **Contact** (`contact.object.ts`) - Contact management with CRM capabilities
**E-commerce:**
- Product object - Product catalog management
- Order object - Order processing and tracking
- Product and order list views

### UI Views (`src/ui/`)
**Blog:**
- Blog Post object - Content management
- Author object - Author management
- Blog post and author list views

- **Task Views** (`task.view.ts`)
- Grid view for task lists
- Kanban board for visual task management
- **Contact Views** (`contact.view.ts`)
- Grid view for contact management
- **App Definition** (`app.ts`) - Main application structure and navigation
**CRM:**
- Account object - Business account management
- Opportunity object - Sales pipeline tracking
- Account list view, opportunity list/kanban views

### Configuration

- `objectstack.config.ts` - ObjectStack manifest with app metadata, navigation, and permissions
- `tsconfig.json` - TypeScript configuration
- `package.json` - Project dependencies and scripts
- `package.json` - Workspace configuration
- `packages/*/tsconfig.json` - TypeScript configuration per package
- `packages/*/package.json` - Package dependencies and scripts

## 🏗️ Project Structure

```
objectstack-starter/
├── src/
│ ├── data/ # Data object definitions
│ │ ├── project-task.object.ts
│ │ └── contact.object.ts
│ ├── ui/ # UI views and app definitions
│ │ ├── task.view.ts
│ │ ├── contact.view.ts
│ │ └── app.ts
│ ├── system/ # System configurations (future)
│ ├── ai/ # AI agents and prompts (future)
│ ├── api/ # API definitions (future)
│ └── index.ts # Main export file
├── objectstack.config.ts # ObjectStack manifest
├── tsconfig.json # TypeScript configuration
├── package.json # Project configuration
└── README.md # This file
objectstack-starter/ # Monorepo root
├── packages/
│ ├── core/ # @objectstack-starter/core
│ │ ├── src/
│ │ │ ├── data/ # Core data objects
│ │ │ │ ├── project-task.object.ts
│ │ │ │ └── contact.object.ts
│ │ │ ├── ui/ # Core UI views
│ │ │ │ ├── task.view.ts
│ │ │ │ ├── contact.view.ts
│ │ │ │ └── app.ts
│ │ │ ├── objectstack.config.ts
│ │ │ ├── example.ts
│ │ │ └── index.ts
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ └── README.md
│ │
│ └── examples/ # @objectstack-starter/examples
│ ├── src/
│ │ ├── data/ # Example data objects
│ │ │ ├── product.object.ts # E-commerce
│ │ │ ├── order.object.ts # E-commerce
│ │ │ ├── blog-post.object.ts # Blog
│ │ │ ├── author.object.ts # Blog
│ │ │ ├── account.object.ts # CRM
│ │ │ └── opportunity.object.ts # CRM
│ │ ├── ui/ # Example UI views
│ │ │ ├── ecommerce.view.ts
│ │ │ ├── blog.view.ts
│ │ │ └── crm.view.ts
│ │ ├── basic-example.ts
│ │ ├── ecommerce-example.ts
│ │ ├── blog-example.ts
│ │ ├── crm-example.ts
│ │ └── index.ts
│ ├── package.json
│ ├── tsconfig.json
│ └── README.md
├── package.json # Workspace root configuration
└── README.md # This file
```

## 📚 ObjectStack Concepts
Expand Down Expand Up @@ -186,37 +238,48 @@ This project is licensed under the MIT License - see the LICENSE file for detail

## 🌟 Features

- ✅ Monorepo structure with npm workspaces
- ✅ Multiple packages: core and examples
- ✅ TypeScript support with strict type checking
- ✅ Based on the latest @objectstack/spec (v0.3.3)
- ✅ Example data objects following ObjectStack conventions
- ✅ Example UI views (grid and kanban)
- ✅ Core objects: Task and Contact management
- ✅ E-commerce example: Product and Order management
- ✅ Blog example: Post and Author management
- ✅ CRM example: Account and Opportunity tracking
- ✅ Multiple view types (grid and kanban)
- ✅ Proper project structure and configuration
- ✅ Ready to extend with AI, API, and System protocols

## 🔧 Extending This Template

### Adding a New Object
### Adding a New Object to Core Package

1. Create a new file in `src/data/` (e.g., `account.object.ts`)
1. Create a new file in `packages/core/src/data/` (e.g., `account.object.ts`)
2. Define your object following the Data Protocol
3. Export it from `src/index.ts`
4. Add navigation for it in `objectstack.config.ts`
3. Export it from `packages/core/src/index.ts`
4. Add navigation for it in `packages/core/src/objectstack.config.ts`

### Adding a New View
### Adding a New View to Core Package

1. Create a new file in `src/ui/` (e.g., `account.view.ts`)
1. Create a new file in `packages/core/src/ui/` (e.g., `account.view.ts`)
2. Define your view following the UI Protocol
3. Export it from `src/index.ts`
3. Export it from `packages/core/src/index.ts`

### Adding AI Capabilities
### Creating a New Example Package

1. Create files in `src/ai/` for agents and prompts
2. Use the AI Protocol from `@objectstack/spec/ai`
1. Create a new directory in `packages/` (e.g., `packages/my-example`)
2. Add `package.json` with dependencies
3. Create `src/` directory with objects and views
4. Add example runner files
5. Update workspace configuration in root `package.json`

### Adding API Endpoints
### Adding More Examples to Examples Package

1. Create files in `src/api/` for endpoint definitions
2. Use the API Protocol from `@objectstack/spec/api`
1. Create new object files in `packages/examples/src/data/`
2. Create corresponding view files in `packages/examples/src/ui/`
3. Create example runner file (e.g., `my-example.ts`)
4. Export from `packages/examples/src/index.ts`
5. Add script to `packages/examples/package.json`

## 💡 Tips

Expand Down
28 changes: 17 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{
"name": "objectstack-starter",
"version": "0.1.0",
"description": "ObjectStack Starter Template - A metadata-driven low-code platform starter",
"description": "ObjectStack Starter Template - A metadata-driven low-code platform starter (Multi-package Monorepo)",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"clean": "rm -rf dist",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@objectstack/spec": "^0.3.3"
"build": "npm run build --workspaces",
"build:core": "npm run build -w @objectstack-starter/core",
"build:examples": "npm run build -w @objectstack-starter/examples",
"dev": "npm run dev --workspaces --if-present",
"clean": "npm run clean --workspaces --if-present",
"type-check": "npm run type-check --workspaces",
"example:basic": "npm run example:basic -w @objectstack-starter/examples",
"example:ecommerce": "npm run example:ecommerce -w @objectstack-starter/examples",
"example:blog": "npm run example:blog -w @objectstack-starter/examples",
"example:crm": "npm run example:crm -w @objectstack-starter/examples"
},
"devDependencies": {
"@types/node": "^20.10.0",
Expand All @@ -25,7 +30,8 @@
"objectstack",
"low-code",
"metadata-driven",
"starter-template"
"starter-template",
"monorepo"
],
"license": "MIT"
}
83 changes: 83 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# @objectstack-starter/core

Core package for ObjectStack Starter - includes base objects and views for task and contact management.

## What's Included

### Data Objects

- **Project Task** (`project_task`) - Task management with status, priority, assignments, and time tracking
- **Contact** (`contact`) - Contact management with CRM capabilities

### UI Views

- **Task Views**
- Grid view for task lists
- Kanban board for visual task management
- **Contact Views**
- Grid view for contact management
- **App Definition** - Main application structure and navigation

## Installation

```bash
npm install @objectstack-starter/core
```

## Usage

```typescript
import {
config,
projectTaskObject,
contactObject,
taskListView,
taskKanbanView,
contactListView,
mainApp
} from '@objectstack-starter/core';

console.log('Task Fields:', Object.keys(projectTaskObject.fields));
console.log('Contact Fields:', Object.keys(contactObject.fields));
```

## API

### Exports

- `config` - ObjectStack manifest configuration
- `projectTaskObject` - Project task data object definition
- `contactObject` - Contact data object definition
- `taskListView` - Task grid view definition
- `taskKanbanView` - Task kanban view definition
- `contactListView` - Contact grid view definition
- `mainApp` - Main application definition

### Type Exports

Re-exports all types from `@objectstack/spec`:
- `Data` - Data Protocol types
- `UI` - UI Protocol types
- `System` - System Protocol types
- `AI` - AI Protocol types
- `API` - API Protocol types

## Development

```bash
# Build the package
npm run build

# Watch mode
npm run dev

# Type checking
npm run type-check

# Clean build artifacts
npm run clean
```

## License

MIT
Loading