-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjectstack.config.ts
More file actions
121 lines (113 loc) · 4.71 KB
/
objectstack.config.ts
File metadata and controls
121 lines (113 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { defineStack } from '@objectstack/spec';
import { AuthPlugin } from '@objectstack/plugin-auth';
import { I18nServicePlugin } from '@objectstack/service-i18n';
import { CRMPlugin } from './packages/crm/dist/plugin.js';
import { FinancePlugin } from './packages/finance/dist/plugin.js';
import { MarketingPlugin } from './packages/marketing/dist/plugin.js';
import { ProductsPlugin } from './packages/products/dist/plugin.js';
import { SupportPlugin } from './packages/support/dist/plugin.js';
import { HRPlugin } from './packages/hr/dist/plugin.js';
import { AnalyticsPlugin } from './packages/analytics/dist/plugin.js';
import { IntegrationPlugin } from './packages/integration/dist/plugin.js';
import { CommunityPlugin } from './packages/community/dist/plugin.js';
import { HealthcarePlugin } from './packages/healthcare/dist/plugin.js';
import { RealEstatePlugin } from './packages/real-estate/dist/plugin.js';
import { EducationPlugin } from './packages/education/dist/plugin.js';
import { FinancialServicesPlugin } from './packages/financial-services/dist/plugin.js';
import { ConsolePlugin } from '@object-ui/console';
// Core system reference datasets (not part of any plugin)
import { CurrencyDataset } from './packages/core/dist/currency.dataset.js';
import { CountryDataset } from './packages/core/dist/country.dataset.js';
import { IndustryDataset } from './packages/core/dist/industry.dataset.js';
import { TimezoneDataset } from './packages/core/dist/timezone.dataset.js';
import { LanguageDataset } from './packages/core/dist/language.dataset.js';
// Translation bundles — aggregated from all business plugins
import { CrmTranslations } from './packages/crm/dist/translations/index.js';
import { FinanceTranslations } from './packages/finance/dist/translations/index.js';
import { MarketingTranslations } from './packages/marketing/dist/translations/index.js';
import { ProductsTranslations } from './packages/products/dist/translations/index.js';
import { SupportTranslations } from './packages/support/dist/translations/index.js';
import { HRTranslations } from './packages/hr/dist/translations/index.js';
/**
* HotCRM Application Configuration
*
* Aggregates all business plugins into a single runtime application.
* This replaces the deprecated @hotcrm/server package.
*
* Note: @hotcrm/ai is a utility library and doesn't need to be registered as a plugin.
*
* ConsolePlugin is embedded in the plugins array so that the CLI `serve`
* command loads the Console UI automatically — no custom server.ts needed.
*/
export default defineStack({
manifest: {
id: 'com.hotcrm.app',
namespace: 'hotcrm',
version: '1.0.0',
type: 'app',
name: 'HotCRM Enterprise',
description: 'AI-Native Enterprise CRM with Sales, Marketing, Products, Finance, Service, and HR clouds',
},
// Internationalization (i18n) configuration
i18n: {
defaultLocale: 'en',
supportedLocales: ['en', 'zh-CN', 'ja-JP'],
fallbackLocale: 'en',
fileOrganization: 'per_locale',
},
// Empty objects array triggers auto-loading of ObjectQL and the memory driver,
// which is required by the AppPlugin at startup.
// Business objects are defined inside each plugin's objects[] property.
objects: [],
// Core system reference data (currencies, countries, industries, timezones, languages)
// Plugin-specific seed data is registered in each plugin's data[] field.
data: [
CurrencyDataset,
CountryDataset,
IndustryDataset,
TimezoneDataset,
LanguageDataset,
],
// Aggregated translations from all business plugins (TranslationBundle[])
// Each plugin also registers its own translations for plugin-level loading.
// The root config merges them for the AppPlugin to load at startup.
translations: [
CrmTranslations,
FinanceTranslations,
MarketingTranslations,
ProductsTranslations,
SupportTranslations,
HRTranslations,
],
// Register all Business Plugins
// Core clouds (6)
plugins: [
CRMPlugin,
FinancePlugin,
MarketingPlugin,
ProductsPlugin,
SupportPlugin,
HRPlugin,
// Cross-functional clouds (3)
AnalyticsPlugin,
IntegrationPlugin,
CommunityPlugin,
// Vertical industry solutions (4)
HealthcarePlugin,
RealEstatePlugin,
EducationPlugin,
FinancialServicesPlugin,
new AuthPlugin({
secret: process.env.AUTH_SECRET || 'hotcrm-dev-secret-change-me-in-production',
trustedOrigins: ['http://localhost:*'],
}),
new I18nServicePlugin({
defaultLocale: 'en',
fallbackLocale: 'en',
registerRoutes: true,
}),
new ConsolePlugin(),
],
// Uses 'as any' because defineStack schema doesn't include runtime plugins
// like ConsolePlugin — consistent with objectstack.shared.ts pattern.
} as any);