Skip to content

Commit 2af8e99

Browse files
authored
Merge pull request #539 from objectstack-ai/copilot/migrate-crm-docs-to-website
2 parents 3d93b4f + 288e62d commit 2af8e99

9 files changed

Lines changed: 3755 additions & 4 deletions

File tree

content/docs/developer/ai-capabilities.mdx

Lines changed: 823 additions & 0 deletions
Large diffs are not rendered by default.

content/docs/developer/business-logic.mdx

Lines changed: 729 additions & 0 deletions
Large diffs are not rendered by default.

content/docs/developer/data-modeling.mdx

Lines changed: 668 additions & 0 deletions
Large diffs are not rendered by default.

content/docs/developer/index.mdx

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
---
2+
title: CRM Application Guide
3+
description: A comprehensive, enterprise-grade Customer Relationship Management system demonstrating the full capabilities of the ObjectStack Protocol
4+
---
5+
6+
# ObjectStack CRM Application - Complete Guide
7+
8+
Welcome to the **ObjectStack CRM Application**, a comprehensive, enterprise-grade Customer Relationship Management system demonstrating the full capabilities of the ObjectStack Protocol.
9+
10+
## 🎯 Overview
11+
12+
This CRM application showcases:
13+
14+
- **128+ Protocol Modules** across 15 categories
15+
- **Enterprise-grade architecture** following Salesforce and ServiceNow best practices
16+
- **AI-powered automation** with agents and RAG pipelines
17+
- **Comprehensive security** with profiles, roles, and sharing rules
18+
- **Complete business process automation** with flows and workflows
19+
20+
## 📚 Documentation Structure
21+
22+
This guide is organized into specialized sections:
23+
24+
### 1. [Data Modeling](./data-modeling)
25+
Learn how to design robust data models with objects, fields, relationships, and validations.
26+
27+
**Topics:**
28+
- Object schema design patterns
29+
- Field types and configurations
30+
- Relationship modeling (lookup, master-detail)
31+
- Validation rules and formulas
32+
- Database indexing strategies
33+
34+
### 2. [Business Logic](./business-logic)
35+
Implement business rules, validations, and automated processes.
36+
37+
**Topics:**
38+
- Validation rules (script, unique, required)
39+
- Workflow rules and field updates
40+
- Approval processes
41+
- Record triggers
42+
- Business process automation
43+
44+
### 3. [Security Model](./security)
45+
Implement enterprise-grade security with fine-grained permissions.
46+
47+
**Topics:**
48+
- Profiles and permission sets
49+
- Object and field-level security
50+
- Sharing rules and role hierarchy
51+
- Organization-wide defaults
52+
- Territory management
53+
54+
### 4. [AI Capabilities](./ai-capabilities)
55+
Leverage AI agents and RAG pipelines for intelligent automation.
56+
57+
**Topics:**
58+
- AI agent types (assistant, worker, analyst)
59+
- RAG pipeline configuration
60+
- Knowledge base integration
61+
- Natural language queries
62+
- Predictive analytics
63+
64+
### 5. [Development Standards](./standards)
65+
Best practices and coding standards for developing enterprise applications.
66+
67+
**Topics:**
68+
- Folder structure standards
69+
- Naming conventions
70+
- Code organization patterns
71+
- Testing strategies
72+
- Documentation guidelines
73+
74+
## 🏗️ Application Architecture
75+
76+
### Domain-Driven Design
77+
78+
The CRM application is organized by business domains:
79+
80+
```
81+
src/
82+
├── domains/
83+
│ ├── sales/ # Sales objects (Account, Opportunity, Lead, Quote, Contract)
84+
│ ├── service/ # Service objects (Case, Task)
85+
│ ├── marketing/ # Marketing objects (Campaign)
86+
│ ├── products/ # Product catalog
87+
│ └── analytics/ # Analytics and reporting
88+
├── ui/ # User interface definitions
89+
│ ├── dashboards.ts # Dashboard configurations
90+
│ ├── reports.ts # Report definitions
91+
│ └── actions.ts # Custom actions
92+
├── security/ # Security configurations
93+
│ ├── profiles.ts # User profiles
94+
│ └── sharing-rules.ts # Sharing and permissions
95+
├── automation/ # Business process automation
96+
│ └── flows.ts # Flow definitions
97+
├── ai/ # AI and ML configurations
98+
│ ├── agents.ts # AI agents
99+
│ └── rag-pipelines.ts # RAG pipelines
100+
└── integration/ # External integrations
101+
└── connectors.ts # API connectors
102+
```
103+
104+
## 🚀 Quick Start
105+
106+
### 1. Install Dependencies
107+
108+
```bash
109+
pnpm install
110+
```
111+
112+
### 2. Build the Application
113+
114+
```bash
115+
pnpm --filter @example/app-crm build
116+
```
117+
118+
### 3. Run the Application
119+
120+
```bash
121+
pnpm --filter @example/app-crm dev
122+
```
123+
124+
### 4. Deploy to Production
125+
126+
```bash
127+
pnpm --filter @example/app-crm deploy
128+
```
129+
130+
## 📦 Core Objects
131+
132+
### Sales Domain
133+
- **Account** - Companies and organizations
134+
- **Contact** - People at accounts
135+
- **Lead** - Prospective customers
136+
- **Opportunity** - Sales deals in progress
137+
- **Quote** - Price quotes for customers
138+
- **Contract** - Legal agreements
139+
140+
### Service Domain
141+
- **Case** - Customer support tickets
142+
- **Task** - To-do items and activities
143+
144+
### Marketing Domain
145+
- **Campaign** - Marketing campaigns and initiatives
146+
147+
### Product Domain
148+
- **Product** - Product catalog
149+
150+
## 🔧 Configuration
151+
152+
The application is configured in `objectstack.config.ts`:
153+
154+
```typescript
155+
export default defineStack({
156+
manifest: {
157+
id: 'com.example.crm',
158+
version: '2.0.0',
159+
type: 'app',
160+
name: 'CRM App',
161+
},
162+
163+
objects: [...],
164+
apis: [...],
165+
actions: [...],
166+
dashboards: [...],
167+
reports: [...],
168+
apps: [...],
169+
});
170+
```
171+
172+
## 🎓 Best Practices
173+
174+
### Naming Conventions
175+
176+
1. **Configuration Keys (TypeScript Props):** Use `camelCase`
177+
- `maxLength`, `referenceFilters`, `defaultValue`
178+
179+
2. **Machine Names (Data Values):** Use `snake_case`
180+
- `account_number`, `first_name`, `close_date`
181+
182+
3. **Object Names:** Use `snake_case`
183+
- `account`, `opportunity`, `case`
184+
185+
4. **Field Names:** Use `snake_case`
186+
- `account_number`, `annual_revenue`, `is_active`
187+
188+
### Schema Design
189+
190+
Always start with Zod schemas:
191+
192+
```typescript
193+
import { ObjectSchema, Field } from '@objectstack/spec/data';
194+
195+
export const MyObject = ObjectSchema.create({
196+
name: 'my_object',
197+
label: 'My Object',
198+
199+
fields: {
200+
my_field: Field.text({
201+
label: 'My Field',
202+
required: true,
203+
}),
204+
},
205+
});
206+
```
207+
208+
### Type Safety
209+
210+
Use type inference from Zod schemas:
211+
212+
```typescript
213+
import { z } from 'zod';
214+
215+
const MySchema = z.object({
216+
name: z.string(),
217+
});
218+
219+
type MyType = z.infer<typeof MySchema>;
220+
```
221+
222+
## 🔒 Security
223+
224+
The application implements enterprise-grade security:
225+
226+
- **5 User Profiles** (System Admin, Sales Manager, Sales Rep, Service Agent, Marketing User)
227+
- **Role Hierarchy** with 10 roles
228+
- **Sharing Rules** for account, opportunity, and case objects
229+
- **Territory Management** for geographic sales regions
230+
- **Field-Level Security** for sensitive data
231+
232+
## 🤖 AI Features
233+
234+
### AI Agents
235+
236+
- **Sales Assistant** - Lead qualification and opportunity management
237+
- **Service Agent** - Customer support automation
238+
- **Lead Enrichment** - Automatic data enrichment
239+
- **Revenue Intelligence** - Pipeline analysis and forecasting
240+
- **Email Campaign** - Marketing email generation
241+
242+
### RAG Pipelines
243+
244+
- **Sales Knowledge** - Sales playbook and best practices
245+
- **Support Knowledge** - Customer support knowledge base
246+
- **Product Information** - Product catalog and specs
247+
- **Competitive Intelligence** - Market research and competitive analysis
248+
249+
## 📊 Analytics
250+
251+
### Dashboards
252+
253+
- **Sales Dashboard** - Pipeline metrics and trends
254+
- **Service Dashboard** - Support case analytics
255+
- **Executive Dashboard** - High-level business metrics
256+
257+
### Reports
258+
259+
- Opportunities by Stage
260+
- Won Opportunities by Owner
261+
- Accounts by Industry
262+
- Cases by Status and Priority
263+
- SLA Performance
264+
- Leads by Source
265+
- Contacts by Account
266+
- Tasks by Owner
267+
268+
## 🔗 Resources
269+
270+
- [ObjectStack Documentation](https://docs.objectstack.ai)
271+
- [API Reference](https://api.objectstack.ai)
272+
- [Community Forum](https://community.objectstack.ai)
273+
- [GitHub Repository](https://github.com/objectstack-ai/spec)
274+
275+
## 📝 License
276+
277+
This example application is part of the ObjectStack specification repository and is licensed under the MIT License.
278+
279+
## 🤝 Contributing
280+
281+
Contributions are welcome! Please read our [Contributing Guide](https://github.com/objectstack-ai/spec/blob/main/CONTRIBUTING.md) for details.
282+
283+
---
284+
285+
**Next:** Start with [Data Modeling →](./data-modeling)

content/docs/developer/meta.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"title": "Developer Guide",
3+
"pages": [
4+
"index",
5+
"data-modeling",
6+
"business-logic",
7+
"security",
8+
"ai-capabilities",
9+
"standards"
10+
]
11+
}

0 commit comments

Comments
 (0)