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
61 changes: 15 additions & 46 deletions examples/app-crm/objectstack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import * as views from './src/views/index.js';
import * as apps from './src/apps/index.js';
import * as dashboards from './src/dashboards/index.js';
import * as datasets from './src/datasets/index.js';
import * as reports from './src/reports/index.js';
import * as pages from './src/pages/index.js';
import * as actions from './src/actions/index.js';
import * as emails from './src/emails/index.js';
import { allHooks } from './src/hooks/index.js';
import { allFlows } from './src/flows/index.js';
import {
Expand All @@ -24,29 +22,19 @@ import {
WonDealActivitySharingRule,
} from './src/security/index.js';
import { CrmSeedData } from './src/data/index.js';
import { LeadCsvImportMapping, ContactJsonSyncMapping } from './src/data/crm-mappings.js';
import { CrmDatasource, CrmAnalyticsDatasource } from './src/datasources/crm.datasource.js';
import { CrmTranslationBundle } from './src/translations/crm.translation.js';
import { ContactExtension } from './src/extensions/contact.extension.js';
import { CustomerPortal } from './src/portals/customer.portal.js';
import { CrmLightTheme, CrmDarkTheme } from './src/themes/crm.theme.js';
import { LeadScoringJob, PipelineReportJob, RenewalSweepJob } from './src/jobs/crm-jobs.js';
import {
PipelineSummaryEndpoint,
LeadConvertEndpoint,
MarketingWebhookEndpoint,
} from './src/api/crm-endpoints.js';
import { OpportunityChangedWebhook, DealWonSlackWebhook } from './src/webhooks/crm-webhooks.js';
import { PipelineCube, LeadFunnelCube } from './src/analytics/crm.cube.js';
import { HubSpotConnector, SlackConnector } from './src/connectors/crm-connectors.js';

/**
* CRM example — exercises the full metadata loading pipeline with at
* least one record of every form-bearing metadata type so the Studio
* metadata-admin UI can be developed and validated against real data.
* CRM example — a MINIMAL, realistic relational bundle that smoke-tests the
* metadata application loading pipeline: objects/relationships → views →
* app → dashboard (dataset-backed) → hook → one screen-flow wizard → seed.
* Deliberately small so `pnpm dev:crm` boots fast for backend debugging.
*
* For a full enterprise reference (10+ objects, RAG, sharing rules,
* etc.) see https://github.com/objectstack-ai/hotcrm
* NOT a feature showcase: capability breadth (cubes, extensions, apis,
* webhooks, portals, themes, reports, jobs, emails, automation variety)
* lives in examples/app-showcase, whose coverage manifest enforces it.
* For a full enterprise reference see https://github.com/objectstack-ai/hotcrm
*/
export default defineStack({
manifest: {
Expand All @@ -58,12 +46,10 @@ export default defineStack({
description: 'Minimal CRM workspace used by the framework to validate the metadata loading pipeline end-to-end.',
},

// Auto-resolved by the CLI; `ui` enables the Studio shell, `automation` loads
// AutomationServicePlugin + node packs so screen flows can execute, and
// `approvals` loads ApprovalsServicePlugin so the `approval` flow node is
// contributed to the engine (ADR-0019) — required for the discount-approval
// flow to compile/register and to surface the node in the designer palette.
requires: ['ui', 'automation', 'approvals'],
// Auto-resolved by the CLI; `ui` enables the Studio shell, `automation`
// loads AutomationServicePlugin + node packs so the convert-lead screen
// flow can execute.
requires: ['ui', 'automation'],

// Infrastructure
datasources: [CrmDatasource, CrmAnalyticsDatasource],
Expand All @@ -85,28 +71,22 @@ export default defineStack({

// Data
objects: Object.values(objects),
objectExtensions: [ContactExtension],

// UI
apps: Object.values(apps),
portals: [CustomerPortal],
views: Object.values(views),
pages: Object.values(pages),
dashboards: Object.values(dashboards),
datasets: Object.values(datasets),
reports: Object.values(reports),
actions: Object.values(actions),
themes: [CrmLightTheme, CrmDarkTheme],

// Logic
hooks: allHooks,
// ADR-0020: `workflows` retired — record state machines are now a
// ADR-0020: `workflows` retired — record state machines are a
// `state_machine` validation rule on the object (see
// src/objects/opportunity.object.ts) and side-effecting automation is
// modelled as Flows (high-value-deal, stale-opportunity in allFlows).
// src/objects/opportunity.object.ts). One flow only: the convert-lead
// screen wizard the smoke test drives.
flows: allFlows,
jobs: [LeadScoringJob, PipelineReportJob, RenewalSweepJob],
emailTemplates: Object.values(emails),

// Security
roles: [SalesRepRole, SalesManagerRole, FinanceApproverRole],
Expand All @@ -117,17 +97,6 @@ export default defineStack({
WonDealActivitySharingRule,
],

// API
apis: [PipelineSummaryEndpoint, LeadConvertEndpoint, MarketingWebhookEndpoint],
webhooks: [OpportunityChangedWebhook, DealWonSlackWebhook],

// Data Extensions
mappings: [LeadCsvImportMapping, ContactJsonSyncMapping],
analyticsCubes: [PipelineCube, LeadFunnelCube],

// Integrations
connectors: [HubSpotConnector, SlackConnector],

// Seed data
data: CrmSeedData,
});
1 change: 0 additions & 1 deletion examples/app-crm/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.

export { ConvertLeadAction } from './convert-lead.action.js';
export { ParkLeadAction } from './park-lead.action.js';
35 changes: 0 additions & 35 deletions examples/app-crm/src/actions/park-lead.action.ts

This file was deleted.

122 changes: 0 additions & 122 deletions examples/app-crm/src/analytics/crm.cube.ts

This file was deleted.

54 changes: 0 additions & 54 deletions examples/app-crm/src/api/crm-endpoints.ts

This file was deleted.

Loading