@zohodesk/i18n 1.0.0-beta.34 → 1.0.0-beta.36-murphy

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/docs/murphy/01-MURPHY_OVERVIEW.md +148 -0
  2. package/docs/murphy/02-MURPHY_ARCHITECTURE.md +283 -0
  3. package/docs/murphy/03-MURPHY_BACKEND_CONFIG.md +337 -0
  4. package/docs/murphy/04-MURPHY_FRONTEND_INIT.md +437 -0
  5. package/docs/murphy/05-MURPHY_DESK_CLIENT_USAGE.md +467 -0
  6. package/docs/murphy/06-MURPHY_I18N_INTEGRATION.md +402 -0
  7. package/docs/murphy/07-MURPHY_WHY_I18N_APPROACH.md +391 -0
  8. package/es/components/DateTimeDiffFormat.js +5 -19
  9. package/es/components/FormatText.js +2 -2
  10. package/es/components/HOCI18N.js +32 -43
  11. package/es/components/I18N.js +2 -13
  12. package/es/components/I18NProvider.js +0 -9
  13. package/es/components/PluralFormat.js +3 -5
  14. package/es/components/UserTimeDiffFormat.js +5 -9
  15. package/es/components/__tests__/DateTimeDiffFormat.spec.js +157 -221
  16. package/es/components/__tests__/FormatText.spec.js +2 -2
  17. package/es/components/__tests__/HOCI18N.spec.js +2 -4
  18. package/es/components/__tests__/I18N.spec.js +6 -4
  19. package/es/components/__tests__/I18NProvider.spec.js +4 -4
  20. package/es/components/__tests__/PluralFormat.spec.js +2 -2
  21. package/es/components/__tests__/UserTimeDiffFormat.spec.js +249 -348
  22. package/es/index.js +1 -0
  23. package/es/utils/__tests__/jsxTranslations.spec.js +3 -7
  24. package/es/utils/errorReporter.js +35 -0
  25. package/es/utils/index.js +42 -92
  26. package/es/utils/jsxTranslations.js +34 -52
  27. package/lib/I18NContext.js +2 -7
  28. package/lib/components/DateTimeDiffFormat.js +46 -87
  29. package/lib/components/FormatText.js +18 -41
  30. package/lib/components/HOCI18N.js +24 -59
  31. package/lib/components/I18N.js +27 -64
  32. package/lib/components/I18NProvider.js +27 -63
  33. package/lib/components/PluralFormat.js +24 -50
  34. package/lib/components/UserTimeDiffFormat.js +43 -72
  35. package/lib/components/__tests__/DateTimeDiffFormat.spec.js +95 -165
  36. package/lib/components/__tests__/FormatText.spec.js +3 -10
  37. package/lib/components/__tests__/HOCI18N.spec.js +3 -14
  38. package/lib/components/__tests__/I18N.spec.js +4 -12
  39. package/lib/components/__tests__/I18NProvider.spec.js +8 -23
  40. package/lib/components/__tests__/PluralFormat.spec.js +3 -11
  41. package/lib/components/__tests__/UserTimeDiffFormat.spec.js +157 -225
  42. package/lib/index.js +25 -23
  43. package/lib/utils/__tests__/jsxTranslations.spec.js +1 -12
  44. package/lib/utils/errorReporter.js +44 -0
  45. package/lib/utils/index.js +49 -125
  46. package/lib/utils/jsxTranslations.js +61 -100
  47. package/package.json +1 -1
  48. package/src/index.js +5 -0
  49. package/src/utils/errorReporter.js +41 -0
  50. package/src/utils/index.js +8 -1
  51. package/src/utils/jsxTranslations.js +8 -1
@@ -0,0 +1,148 @@
1
+ # Murphy SDK Overview
2
+
3
+ ## What is Murphy?
4
+
5
+ Murphy is Zoho's internal **error tracking and monitoring SDK**. It's similar to popular monitoring tools like:
6
+ - Sentry
7
+ - Datadog
8
+ - LogRocket
9
+ - Bugsnag
10
+
11
+ Murphy is specifically designed for Zoho's ecosystem and integrates seamlessly with Zoho's infrastructure across all datacenters.
12
+
13
+ ---
14
+
15
+ ## Why Murphy in Zoho Desk?
16
+
17
+ Murphy helps us monitor the health of our JavaScript applications in production:
18
+
19
+ ```
20
+ ┌─────────────────────────────────────────────────────────────┐
21
+ │ Without Murphy │ With Murphy │
22
+ ├────────────────────────────────┼────────────────────────────┤
23
+ │ │ │
24
+ │ User sees error │ User sees error │
25
+ │ ↓ │ ↓ │
26
+ │ User reports to support │ Murphy logs automatically │
27
+ │ ↓ │ ↓ │
28
+ │ Support creates ticket │ Team sees in dashboard │
29
+ │ ↓ │ ↓ │
30
+ │ Dev tries to reproduce │ Full stack trace + context│
31
+ │ ↓ │ ↓ │
32
+ │ "Works on my machine" 😫 │ Fix deployed quickly 🎉 │
33
+ │ │ │
34
+ └────────────────────────────────┴────────────────────────────┘
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Murphy SDK Capabilities
40
+
41
+ ```
42
+ ┌─────────────────────────────────────────────────────────────┐
43
+ │ MURPHY SDK FEATURES │
44
+ ├─────────────────────────────────────────────────────────────┤
45
+ │ │
46
+ │ ┌─────────────────────┐ ┌─────────────────────┐ │
47
+ │ │ Error Tracking │ │ Performance Monitor │ │
48
+ │ ├─────────────────────┤ ├─────────────────────┤ │
49
+ │ │ murphy.error() │ │ murphy.clientmetrics│ │
50
+ │ │ murphy.addCustom │ │ Time to Interactive │ │
51
+ │ │ Tracking() │ │ Soft Navigation │ │
52
+ │ │ Custom error tags │ │ Web Vitals │ │
53
+ │ └─────────────────────┘ └─────────────────────┘ │
54
+ │ │
55
+ │ ┌─────────────────────┐ ┌─────────────────────┐ │
56
+ │ │ User Behavior │ │ Logging │ │
57
+ │ ├─────────────────────┤ ├─────────────────────┤ │
58
+ │ │ Rage Clicks │ │ murphy.appLog() │ │
59
+ │ │ Rage Requests │ │ INFO level │ │
60
+ │ │ Session Telemetry │ │ WARN level │ │
61
+ │ │ User Actions │ │ SEVERE level │ │
62
+ │ └─────────────────────┘ └─────────────────────┘ │
63
+ │ │
64
+ └─────────────────────────────────────────────────────────────┘
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Key Murphy Methods
70
+
71
+ ### 1. Error Tracking
72
+ ```javascript
73
+ // Report JavaScript errors
74
+ murphy.error(error, undefined, {
75
+ customTags: {
76
+ module: 'tickets',
77
+ action: 'save'
78
+ }
79
+ });
80
+ ```
81
+
82
+ ### 2. Application Logging
83
+ ```javascript
84
+ // Log application events
85
+ murphy.appLog('INFO', 'User clicked save button', {
86
+ ticketId: '12345'
87
+ });
88
+ ```
89
+
90
+ ### 3. Custom Tracking
91
+ ```javascript
92
+ // Track custom events
93
+ murphy.addCustomTracking({
94
+ event: 'feature_used',
95
+ feature: 'bulk_update'
96
+ });
97
+ ```
98
+
99
+ ### 4. Performance Metrics
100
+ ```javascript
101
+ // Track page load performance
102
+ murphy.clientmetrics.setTimeToInteractive();
103
+
104
+ // Track route changes
105
+ murphy.clientmetrics.startSoftNavigation('tickets-list');
106
+ murphy.clientmetrics.endSoftNavigation('tickets-list');
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Murphy Dashboard
112
+
113
+ All logged data appears in the Murphy dashboard where teams can:
114
+
115
+ - **View error trends** - See error frequency over time
116
+ - **Group similar errors** - Automatic grouping by stack trace
117
+ - **Filter by tags** - Find errors by module, user, datacenter
118
+ - **Track performance** - Monitor load times and web vitals
119
+ - **Set alerts** - Get notified when error rates spike
120
+
121
+ ---
122
+
123
+ ## Murphy in Zoho Infrastructure
124
+
125
+ Murphy is deployed across all Zoho datacenters:
126
+
127
+ | Datacenter | Murphy Domain |
128
+ |------------|---------------|
129
+ | US | murphy.zoho.com |
130
+ | EU | murphy.zoho.eu |
131
+ | IN | murphy.zoho.in |
132
+ | JP | murphy.zoho.jp |
133
+ | CN | murphy.zoho.com.cn |
134
+ | AU | murphy.zoho.com.au |
135
+ | CA | murphy.zoho.ca |
136
+
137
+ Each datacenter has its own Murphy instance for data residency compliance.
138
+
139
+ ---
140
+
141
+ ## Related Documents
142
+
143
+ - [02-MURPHY_ARCHITECTURE.md](./02-MURPHY_ARCHITECTURE.md) - Full architecture diagrams
144
+ - [03-MURPHY_BACKEND_CONFIG.md](./03-MURPHY_BACKEND_CONFIG.md) - Server configuration
145
+ - [04-MURPHY_FRONTEND_INIT.md](./04-MURPHY_FRONTEND_INIT.md) - Client initialization
146
+ - [05-MURPHY_DESK_CLIENT_USAGE.md](./05-MURPHY_DESK_CLIENT_USAGE.md) - Usage in desk client
147
+ - [06-MURPHY_I18N_INTEGRATION.md](./06-MURPHY_I18N_INTEGRATION.md) - i18n library integration
148
+ - [07-MURPHY_WHY_I18N_APPROACH.md](./07-MURPHY_WHY_I18N_APPROACH.md) - Why i18n approach
@@ -0,0 +1,283 @@
1
+ # Murphy Architecture in Zoho Desk
2
+
3
+ ## Complete Architecture Diagram
4
+
5
+ ```
6
+ ┌──────────────────────────────────────────────────────────────────────────────┐
7
+ │ MURPHY ARCHITECTURE IN ZOHO DESK │
8
+ ├──────────────────────────────────────────────────────────────────────────────┤
9
+ │ │
10
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
11
+ │ │ SERVER SIDE (Java Backend) │ │
12
+ │ ├────────────────────────────────────────────────────────────────────────┤ │
13
+ │ │ │ │
14
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
15
+ │ │ │ dcurl.properties (Region-specific credentials) │ │ │
16
+ │ │ │ /product_package/conf/ZohoSupport/dcurl.properties │ │ │
17
+ │ │ │ │ │ │
18
+ │ │ │ dcurl.desk.murphy.appkey_US = 755747375 │ │ │
19
+ │ │ │ dcurl.desk.murphy.appkey_JP = 90001069766 │ │ │
20
+ │ │ │ dcurl.desk.murphy.appkey_IN = 60013588960 │ │ │
21
+ │ │ │ dcurl.desk.murphy.appdomain_US = murphy.zoho.com │ │ │
22
+ │ │ │ dcurl.desk.murphy.appdomain_JP = murphy.zoho.jp │ │ │
23
+ │ │ │ dcurl.desk.murphy.authKey_US = BPEEOUVxexAB... │ │ │
24
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
25
+ │ │ │ │ │
26
+ │ │ ▼ │ │
27
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
28
+ │ │ │ MurphyConstants.java │ │ │
29
+ │ │ │ /com/adventnet/support/common/util/MurphyConstants.java │ │ │
30
+ │ │ │ │ │ │
31
+ │ │ │ APP_KEY = Configuration.getString("...murphy.appkey") │ │ │
32
+ │ │ │ AUTH_KEY = Configuration.getString("...murphy.authKey") │ │ │
33
+ │ │ │ APP_DOMAIN = Configuration.getString("...murphy.appdomain") │ │ │
34
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
35
+ │ │ │ │ │
36
+ │ │ ▼ │ │
37
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
38
+ │ │ │ ClientInitUtil.java │ │ │
39
+ │ │ │ /com/zoho/desk/client/util/ClientInitUtil.java │ │ │
40
+ │ │ │ │ │ │
41
+ │ │ │ getDeskUrls(request) { │ │ │
42
+ │ │ │ deskUrls.put("murphyAppKey", MurphyConstants.APP_KEY); │ │ │
43
+ │ │ │ deskUrls.put("murphyAppDomain", MurphyConstants.APP_DOMAIN); │ │ │
44
+ │ │ │ deskUrls.put("murphyAuthKey", MurphyConstants.AUTH_KEY); │ │ │
45
+ │ │ │ } │ │ │
46
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
47
+ │ │ │ │ │
48
+ │ └───────────────────────────────│─────────────────────────────────────────┘ │
49
+ │ │ │
50
+ │ ▼ HTTP Response with embedded <script> │
51
+ │ │
52
+ │ ┌────────────────────────────────────────────────────────────────────────┐ │
53
+ │ │ CLIENT SIDE (Browser) │ │
54
+ │ ├────────────────────────────────────────────────────────────────────────┤ │
55
+ │ │ │ │
56
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
57
+ │ │ │ index.html (Server-rendered) │ │ │
58
+ │ │ │ │ │ │
59
+ │ │ │ <script nonce="..."> │ │ │
60
+ │ │ │ var desk_urls = { │ │ │
61
+ │ │ │ murphyAppKey: "755747375", │ │ │
62
+ │ │ │ murphyAppDomain: "murphy.zoho.com", │ │ │
63
+ │ │ │ murphyAuthKey: "BPEEOUVxexAB..." │ │ │
64
+ │ │ │ }; │ │ │
65
+ │ │ │ </script> │ │ │
66
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
67
+ │ │ │ │ │
68
+ │ │ ▼ │ │
69
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
70
+ │ │ │ Murphy SDK (CDN loaded) │ │ │
71
+ │ │ │ https://static.zoho.com/murphysdk/3.0.0/murphy.min.js │ │ │
72
+ │ │ │ │ │ │
73
+ │ │ │ Creates global: window.murphy │ │ │
74
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
75
+ │ │ │ │ │
76
+ │ │ ▼ │ │
77
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
78
+ │ │ │ murphy/initial_html/utils.js │ │ │
79
+ │ │ │ │ │ │
80
+ │ │ │ murphyInit() { │ │ │
81
+ │ │ │ murphy.install({ │ │ │
82
+ │ │ │ config: { │ │ │
83
+ │ │ │ appKey: desk_urls.murphyAppKey, │ │ │
84
+ │ │ │ appDomain: desk_urls.murphyAppDomain, │ │ │
85
+ │ │ │ authKey: desk_urls.murphyAuthKey │ │ │
86
+ │ │ │ } │ │ │
87
+ │ │ │ }); │ │ │
88
+ │ │ │ } │ │ │
89
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
90
+ │ │ │ │ │
91
+ │ │ ▼ │ │
92
+ │ │ ┌───────────────────────────────────────────────────────────────────┐ │ │
93
+ │ │ │ Global murphy object ready for use! │ │ │
94
+ │ │ │ │ │ │
95
+ │ │ │ murphy.error(...) → Track errors │ │ │
96
+ │ │ │ murphy.appLog(...) → Application logs │ │ │
97
+ │ │ │ murphy.clientmetrics → Performance monitoring │ │ │
98
+ │ │ └───────────────────────────────────────────────────────────────────┘ │ │
99
+ │ │ │ │
100
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
101
+ │ │
102
+ └───────────────────────────────────────────────────────────────────────────────┘
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Multi-Datacenter Architecture
108
+
109
+ One of Murphy's key features is multi-datacenter support. The same code runs in all datacenters, but configuration is injected at runtime.
110
+
111
+ ```
112
+ ┌───────────────────────────────────────────────────────────────────────────────┐
113
+ │ SAME CODE → DIFFERENT DATACENTERS │
114
+ ├───────────────────────────────────────────────────────────────────────────────┤
115
+ │ │
116
+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
117
+ │ │ ONE CODEBASE (Git Repository) │ │
118
+ │ │ │ │
119
+ │ │ desk client app │ i18n library │ murphy.error() call │ │
120
+ │ │ │ │
121
+ │ │ Same JavaScript code deployed everywhere │ │
122
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
123
+ │ │ │
124
+ │ ┌───────────────┼───────────────┐ │
125
+ │ │ │ │ │
126
+ │ ▼ ▼ ▼ │
127
+ │ ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
128
+ │ │ US Datacenter │ │ JP Datacenter │ │ IN Datacenter │ │
129
+ │ │ │ │ │ │ │ │
130
+ │ │ desk_urls = { │ │ desk_urls = { │ │ desk_urls = { │ │
131
+ │ │ appKey: "755.." │ │ appKey: "900.." │ │ appKey: "600.." │ │
132
+ │ │ appDomain: │ │ appDomain: │ │ appDomain: │ │
133
+ │ │ "murphy.zoho │ │ "murphy.zoho │ │ "murphy.zoho │ │
134
+ │ │ .com" │ │ .jp" │ │ .in" │ │
135
+ │ │ } │ │ } │ │ } │ │
136
+ │ └─────────┬─────────┘ └─────────┬─────────┘ └─────────┬─────────┘ │
137
+ │ │ │ │ │
138
+ │ ▼ ▼ ▼ │
139
+ │ ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
140
+ │ │ murphy.zoho.com │ │ murphy.zoho.jp │ │ murphy.zoho.in │ │
141
+ │ │ (US Murphy) │ │ (JP Murphy) │ │ (IN Murphy) │ │
142
+ │ └───────────────────┘ └───────────────────┘ └───────────────────┘ │
143
+ │ │
144
+ │ KEY INSIGHT: Code doesn't care about DC - config is injected at runtime! │
145
+ │ │
146
+ └───────────────────────────────────────────────────────────────────────────────┘
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Data Flow Summary
152
+
153
+ ```
154
+ ┌───────────────────────────────────────────────────────────────────────────────┐
155
+ │ DATA FLOW: Error Reporting │
156
+ ├───────────────────────────────────────────────────────────────────────────────┤
157
+ │ │
158
+ │ 1. ERROR OCCURS │
159
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
160
+ │ │ // In i18n library │ │
161
+ │ │ getI18NValue('missing.key') → Key not found! │ │
162
+ │ └──────────────────────────────────────────────────────────────────────┘ │
163
+ │ │ │
164
+ │ ▼ │
165
+ │ 2. REPORT TO MURPHY │
166
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
167
+ │ │ reportI18NError(I18N_ERROR_TYPES.MISSING_KEY, 'missing.key'); │ │
168
+ │ │ │ │
169
+ │ │ // Internally calls: │ │
170
+ │ │ murphy.error(error, undefined, { customTags: {...} }); │ │
171
+ │ └──────────────────────────────────────────────────────────────────────┘ │
172
+ │ │ │
173
+ │ ▼ │
174
+ │ 3. MURPHY SDK SENDS DATA │
175
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
176
+ │ │ HTTP POST to murphy.zoho.com (or regional endpoint) │ │
177
+ │ │ │ │
178
+ │ │ { │ │
179
+ │ │ error: "i18n I18N_MISSING_KEY: missing.key", │ │
180
+ │ │ stackTrace: "...", │ │
181
+ │ │ customTags: { │ │
182
+ │ │ errorType: "I18N_MISSING_KEY", │ │
183
+ │ │ i18nKey: "missing.key", │ │
184
+ │ │ category: "i18n" │ │
185
+ │ │ }, │ │
186
+ │ │ buildId: "1.2.3", │ │
187
+ │ │ userId: "12345", │ │
188
+ │ │ orgId: "67890" │ │
189
+ │ │ } │ │
190
+ │ └──────────────────────────────────────────────────────────────────────┘ │
191
+ │ │ │
192
+ │ ▼ │
193
+ │ 4. MURPHY DASHBOARD │
194
+ │ ┌──────────────────────────────────────────────────────────────────────┐ │
195
+ │ │ • Error logged with full context │ │
196
+ │ │ • Grouped with similar errors │ │
197
+ │ │ • Searchable by tags │ │
198
+ │ │ • Alerts if threshold exceeded │ │
199
+ │ └──────────────────────────────────────────────────────────────────────┘ │
200
+ │ │
201
+ └───────────────────────────────────────────────────────────────────────────────┘
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Component Layers
207
+
208
+ ```
209
+ ┌───────────────────────────────────────────────────────────────────────────────┐
210
+ │ COMPONENT LAYERS │
211
+ ├───────────────────────────────────────────────────────────────────────────────┤
212
+ │ │
213
+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
214
+ │ │ LAYER 1: Configuration Storage │ │
215
+ │ │ ────────────────────────────────────────────────────────────────────── │ │
216
+ │ │ dcurl.properties │ │
217
+ │ │ • Stores Murphy credentials per datacenter │ │
218
+ │ │ • Region suffix: _US, _JP, _IN, _EU, _CN, _AU, _CA, _SA │ │
219
+ │ │ • Three keys: appkey, appdomain, authKey │ │
220
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
221
+ │ │ │
222
+ │ ▼ │
223
+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
224
+ │ │ LAYER 2: Java Configuration API │ │
225
+ │ │ ────────────────────────────────────────────────────────────────────── │ │
226
+ │ │ MurphyConstants.java │ │
227
+ │ │ • Reads properties via Configuration.getString() │ │
228
+ │ │ • Auto-detects datacenter region │ │
229
+ │ │ • Exposes as static final constants │ │
230
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
231
+ │ │ │
232
+ │ ▼ │
233
+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
234
+ │ │ LAYER 3: Frontend Injection │ │
235
+ │ │ ────────────────────────────────────────────────────────────────────── │ │
236
+ │ │ ClientInitUtil.java │ │
237
+ │ │ • Creates desk_urls JSON object │ │
238
+ │ │ • Injects into HTML via <script> tag │ │
239
+ │ │ • XSS protection via IAMEncoder │ │
240
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
241
+ │ │ │
242
+ │ ▼ │
243
+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
244
+ │ │ LAYER 4: Murphy SDK │ │
245
+ │ │ ────────────────────────────────────────────────────────────────────── │ │
246
+ │ │ murphy.min.js (CDN loaded) │ │
247
+ │ │ • Creates global murphy object │ │
248
+ │ │ • Configured via murphy.install() │ │
249
+ │ │ • Exposes error(), appLog(), clientmetrics APIs │ │
250
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
251
+ │ │ │
252
+ │ ▼ │
253
+ │ ┌─────────────────────────────────────────────────────────────────────────┐ │
254
+ │ │ LAYER 5: Application Code │ │
255
+ │ │ ────────────────────────────────────────────────────────────────────── │ │
256
+ │ │ desk client app / i18n library │ │
257
+ │ │ • Uses global murphy object │ │
258
+ │ │ • Calls murphy.error(), murphy.appLog(), etc. │ │
259
+ │ │ • No need to know about datacenter configuration │ │
260
+ │ └─────────────────────────────────────────────────────────────────────────┘ │
261
+ │ │
262
+ └───────────────────────────────────────────────────────────────────────────────┘
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Key Files Summary
268
+
269
+ | Layer | File | Purpose |
270
+ |-------|------|---------|
271
+ | Config Storage | `dcurl.properties` | Store DC-specific Murphy keys |
272
+ | Java API | `MurphyConstants.java` | Read config as Java constants |
273
+ | Injection | `ClientInitUtil.java` | Inject config into HTML |
274
+ | SDK Init | `murphy/initial_html/utils.js` | Call murphy.install() |
275
+ | Usage | App code / i18n lib | Call murphy.error(), etc. |
276
+
277
+ ---
278
+
279
+ ## Related Documents
280
+
281
+ - [01-MURPHY_OVERVIEW.md](./01-MURPHY_OVERVIEW.md) - Murphy introduction
282
+ - [03-MURPHY_BACKEND_CONFIG.md](./03-MURPHY_BACKEND_CONFIG.md) - Backend config details
283
+ - [04-MURPHY_FRONTEND_INIT.md](./04-MURPHY_FRONTEND_INIT.md) - Frontend initialization