Skip to content

Commit fd5ec56

Browse files
authored
Merge pull request #2 from objectstack-ai/copilot/initialize-project-template
2 parents e9d29af + f36982a commit fd5ec56

File tree

13 files changed

+739
-8
lines changed

13 files changed

+739
-8
lines changed

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
package-lock.json
8+
9+
# Build outputs
10+
dist/
11+
build/
12+
*.tsbuildinfo
13+
14+
# TypeScript build artifacts in root (if any)
15+
/*.js
16+
/*.js.map
17+
/*.d.ts
18+
/*.d.ts.map
19+
20+
# Environment files
21+
.env
22+
.env.local
23+
.env.*.local
24+
25+
# IDE
26+
.vscode/
27+
.idea/
28+
*.swp
29+
*.swo
30+
*~
31+
32+
# OS
33+
.DS_Store
34+
Thumbs.db
35+
36+
# Logs
37+
logs/
38+
*.log
39+
40+
# Test coverage
41+
coverage/
42+
.nyc_output/
43+
44+
# Temporary files
45+
tmp/
46+
temp/
47+
*.tmp

README.md

Lines changed: 231 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,232 @@
1-
# Welcome to your organization's demo respository
2-
This code repository (or "repo") is designed to demonstrate the best GitHub has to offer with the least amount of noise.
1+
# ObjectStack Starter Template
2+
3+
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.
4+
5+
[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)
6+
[![ObjectStack Spec](https://img.shields.io/badge/@objectstack/spec-0.3.3-green.svg)](https://www.npmjs.com/package/@objectstack/spec)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8+
9+
## 🚀 Quick Start
10+
11+
### Installation
12+
13+
```bash
14+
# Clone this repository
15+
git clone https://github.com/objectstack-ai/objectstack-starter.git
16+
cd objectstack-starter
17+
18+
# Install dependencies
19+
npm install
20+
21+
# Build the project
22+
npm run build
23+
```
24+
25+
### Development
26+
27+
```bash
28+
# Watch mode - automatically rebuild on changes
29+
npm run dev
30+
31+
# Type checking
32+
npm run type-check
33+
34+
# Clean build artifacts
35+
npm run clean
36+
```
37+
38+
### Running the Example
39+
40+
The template includes an example file demonstrating how to use the defined objects and views:
41+
42+
```bash
43+
# Build the project
44+
npm run build
45+
46+
# Run the example
47+
node dist/example.js
48+
```
49+
50+
This will show you how to import and work with the ObjectStack definitions.
51+
52+
## 📦 What's Included
53+
54+
This starter template includes:
55+
56+
### Data Objects (`src/data/`)
57+
58+
- **Project Task** (`project-task.object.ts`) - Task management with status, priority, assignments, and time tracking
59+
- **Contact** (`contact.object.ts`) - Contact management with CRM capabilities
60+
61+
### UI Views (`src/ui/`)
62+
63+
- **Task Views** (`task.view.ts`)
64+
- Grid view for task lists
65+
- Kanban board for visual task management
66+
- **Contact Views** (`contact.view.ts`)
67+
- Grid view for contact management
68+
- **App Definition** (`app.ts`) - Main application structure and navigation
69+
70+
### Configuration
71+
72+
- `objectstack.config.ts` - ObjectStack manifest with app metadata, navigation, and permissions
73+
- `tsconfig.json` - TypeScript configuration
74+
- `package.json` - Project dependencies and scripts
75+
76+
## 🏗️ Project Structure
77+
78+
```
79+
objectstack-starter/
80+
├── src/
81+
│ ├── data/ # Data object definitions
82+
│ │ ├── project-task.object.ts
83+
│ │ └── contact.object.ts
84+
│ ├── ui/ # UI views and app definitions
85+
│ │ ├── task.view.ts
86+
│ │ ├── contact.view.ts
87+
│ │ └── app.ts
88+
│ ├── system/ # System configurations (future)
89+
│ ├── ai/ # AI agents and prompts (future)
90+
│ ├── api/ # API definitions (future)
91+
│ └── index.ts # Main export file
92+
├── objectstack.config.ts # ObjectStack manifest
93+
├── tsconfig.json # TypeScript configuration
94+
├── package.json # Project configuration
95+
└── README.md # This file
96+
```
97+
98+
## 📚 ObjectStack Concepts
99+
100+
### Data Protocol (ObjectQL)
101+
102+
Define your data structures using the ObjectStack Data Protocol:
103+
104+
```typescript
105+
import type { Data } from '@objectstack/spec';
106+
107+
export const myObject: Data.ObjectDefinition = {
108+
name: 'my_object', // snake_case for machine names
109+
label: 'My Object',
110+
fields: {
111+
my_field: {
112+
name: 'my_field',
113+
label: 'My Field',
114+
type: 'text',
115+
required: true
116+
}
117+
},
118+
enable: {
119+
apiEnabled: true,
120+
trackHistory: true
121+
}
122+
};
123+
```
124+
125+
### UI Protocol (ObjectUI)
126+
127+
Define views for your data:
128+
129+
```typescript
130+
import type { UI } from '@objectstack/spec';
131+
132+
export const myListView: UI.ListView = {
133+
name: 'my_list',
134+
label: 'My List',
135+
type: 'grid',
136+
object: 'my_object',
137+
columns: [
138+
{ field: 'my_field', width: 200 }
139+
]
140+
};
141+
```
142+
143+
### System Protocol (ObjectOS)
144+
145+
Configure your application:
146+
147+
```typescript
148+
import type { System } from '@objectstack/spec';
149+
150+
export const config: System.Manifest = {
151+
name: 'my-app',
152+
type: 'app',
153+
displayName: 'My Application',
154+
navigation: [
155+
{
156+
type: 'object',
157+
object: 'my_object',
158+
label: 'My Objects'
159+
}
160+
]
161+
};
162+
```
163+
164+
## 🎯 Naming Conventions
165+
166+
ObjectStack follows strict naming conventions:
167+
168+
- **Configuration Keys** (TypeScript properties): `camelCase`
169+
- Example: `maxLength`, `defaultValue`, `referenceFilters`
170+
- **Machine Names** (data values): `snake_case`
171+
- Example: `project_task`, `first_name`, `my_object`
172+
173+
## 📖 Learn More
174+
175+
- [ObjectStack Spec](https://www.npmjs.com/package/@objectstack/spec) - The protocol specification
176+
- [ObjectStack Documentation](https://objectstack.ai) - Full documentation
177+
- [ObjectStack GitHub](https://github.com/objectstack-ai) - Source code and examples
178+
179+
## 🤝 Contributing
180+
181+
Contributions are welcome! Please feel free to submit a Pull Request.
182+
183+
## 📄 License
184+
185+
This project is licensed under the MIT License - see the LICENSE file for details.
186+
187+
## 🌟 Features
188+
189+
- ✅ TypeScript support with strict type checking
190+
- ✅ Based on the latest @objectstack/spec (v0.3.3)
191+
- ✅ Example data objects following ObjectStack conventions
192+
- ✅ Example UI views (grid and kanban)
193+
- ✅ Proper project structure and configuration
194+
- ✅ Ready to extend with AI, API, and System protocols
195+
196+
## 🔧 Extending This Template
197+
198+
### Adding a New Object
199+
200+
1. Create a new file in `src/data/` (e.g., `account.object.ts`)
201+
2. Define your object following the Data Protocol
202+
3. Export it from `src/index.ts`
203+
4. Add navigation for it in `objectstack.config.ts`
204+
205+
### Adding a New View
206+
207+
1. Create a new file in `src/ui/` (e.g., `account.view.ts`)
208+
2. Define your view following the UI Protocol
209+
3. Export it from `src/index.ts`
210+
211+
### Adding AI Capabilities
212+
213+
1. Create files in `src/ai/` for agents and prompts
214+
2. Use the AI Protocol from `@objectstack/spec/ai`
215+
216+
### Adding API Endpoints
217+
218+
1. Create files in `src/api/` for endpoint definitions
219+
2. Use the API Protocol from `@objectstack/spec/api`
220+
221+
## 💡 Tips
222+
223+
- Use the TypeScript language server for IntelliSense and type checking
224+
- Refer to the `@objectstack/spec` package for the complete protocol reference
225+
- Follow the naming conventions strictly (camelCase for config, snake_case for data)
226+
- Enable capabilities like `trackHistory` and `apiEnabled` as needed
227+
- Use the `prompts/` directory in `@objectstack/spec` for AI context
228+
229+
---
230+
231+
Built with ❤️ using [ObjectStack](https://objectstack.ai)
3232

4-
The repo includes an `index.html` file (so it can render a web page), two GitHub Actions workflows, and a CSS stylesheet dependency.

index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
{
2-
"name": "demo-repo",
3-
"version": "0.2.0",
4-
"description": "A sample package.json",
2+
"name": "objectstack-starter",
3+
"version": "0.1.0",
4+
"description": "ObjectStack Starter Template - A metadata-driven low-code platform starter",
5+
"type": "module",
6+
"main": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"scripts": {
9+
"build": "tsc",
10+
"dev": "tsc --watch",
11+
"clean": "rm -rf dist",
12+
"type-check": "tsc --noEmit"
13+
},
514
"dependencies": {
6-
"@primer/css": "17.0.1"
15+
"@objectstack/spec": "^0.3.3"
16+
},
17+
"devDependencies": {
18+
"@types/node": "^20.10.0",
19+
"typescript": "^5.3.0"
20+
},
21+
"engines": {
22+
"node": ">=18.0.0"
723
},
24+
"keywords": [
25+
"objectstack",
26+
"low-code",
27+
"metadata-driven",
28+
"starter-template"
29+
],
830
"license": "MIT"
931
}

0 commit comments

Comments
 (0)