front-end-dev-standards 1.0.0 → 1.1.0
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.
- package/package.json +1 -1
- package/scripts/validate-package.js +10 -5
- package/standards//342/232/241 performance.md" +138 -0
- package/standards//360/237/205/260/357/270/217 angular.md" +571 -0
- package/standards//360/237/216/250 ui-ux.md" +391 -0
- package/standards//360/237/223/232 documentation.md" +127 -0
- package/standards//360/237/224/214 api-standards.md" +201 -0
- package/standards//360/237/224/220 security.md" +432 -0
- package/standards//360/237/232/200 ci-cd.md" +134 -0
- package/standards//360/237/244/226 ai-development.md" +142 -0
- package/standards//360/237/247/221/342/200/215/360/237/222/273 coding-style.md" +765 -0
- package/standards//360/237/247/252 testing.md" +399 -0
- package/standards//360/237/247/261 architecture.md" +654 -0
- package/standards/angular.md +0 -234
- package/standards/architecture.md +0 -263
- package/standards/coding-style.md +0 -223
- package/standards/security.md +0 -6
- package/standards/testing.md +0 -244
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
# UI/UX Standards
|
|
2
|
+
|
|
3
|
+
Version: 1.0
|
|
4
|
+
Framework: Angular 20+
|
|
5
|
+
Design System: Angular Material 3
|
|
6
|
+
Goal: Consistent, Accessible, Responsive Enterprise User Experience
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 1. UI/UX Principles
|
|
11
|
+
|
|
12
|
+
## Core Principles
|
|
13
|
+
|
|
14
|
+
1. Consistency Over Creativity
|
|
15
|
+
2. Accessibility First
|
|
16
|
+
3. Mobile Responsive by Default
|
|
17
|
+
4. User Feedback for Every Action
|
|
18
|
+
5. Simplicity Over Complexity
|
|
19
|
+
6. Performance Aware Design
|
|
20
|
+
7. Predictable User Experience
|
|
21
|
+
8. Design System Driven Development
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# 2. Design System
|
|
26
|
+
|
|
27
|
+
Approved UI Framework:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Angular Material 3
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Allowed:
|
|
34
|
+
|
|
35
|
+
✓ Angular Material
|
|
36
|
+
|
|
37
|
+
✓ Angular CDK
|
|
38
|
+
|
|
39
|
+
✓ Company Design System Components
|
|
40
|
+
|
|
41
|
+
Avoid:
|
|
42
|
+
|
|
43
|
+
✗ Bootstrap
|
|
44
|
+
|
|
45
|
+
✗ Tailwind Utility-Only Architecture
|
|
46
|
+
|
|
47
|
+
✗ Multiple UI Libraries
|
|
48
|
+
|
|
49
|
+
✗ jQuery UI
|
|
50
|
+
|
|
51
|
+
Only one design system should exist.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
# 3. Layout Standards
|
|
56
|
+
|
|
57
|
+
## Application Layout
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
┌──────────────────────────────┐
|
|
61
|
+
│ Header │
|
|
62
|
+
├───────────┬──────────────────┤
|
|
63
|
+
│ Sidebar │ Content │
|
|
64
|
+
│ │ │
|
|
65
|
+
├───────────┴──────────────────┤
|
|
66
|
+
│ Footer │
|
|
67
|
+
└──────────────────────────────┘
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Required:
|
|
71
|
+
|
|
72
|
+
✓ Header
|
|
73
|
+
|
|
74
|
+
✓ Sidebar Navigation
|
|
75
|
+
|
|
76
|
+
✓ Main Content Area
|
|
77
|
+
|
|
78
|
+
✓ Responsive Behavior
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
# 4. Responsive Breakpoints
|
|
83
|
+
|
|
84
|
+
| Device | Width |
|
|
85
|
+
| ------- | -------------- |
|
|
86
|
+
| Mobile | < 768px |
|
|
87
|
+
| Tablet | 768px - 1024px |
|
|
88
|
+
| Desktop | > 1024px |
|
|
89
|
+
|
|
90
|
+
Design mobile-first whenever possible.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
# 5. Spacing Standards
|
|
95
|
+
|
|
96
|
+
Use 8px Grid System.
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
4px
|
|
100
|
+
8px
|
|
101
|
+
16px
|
|
102
|
+
24px
|
|
103
|
+
32px
|
|
104
|
+
40px
|
|
105
|
+
48px
|
|
106
|
+
64px
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Avoid arbitrary spacing values.
|
|
110
|
+
|
|
111
|
+
Bad:
|
|
112
|
+
|
|
113
|
+
```scss
|
|
114
|
+
margin: 13px;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Good:
|
|
118
|
+
|
|
119
|
+
```scss
|
|
120
|
+
margin: 16px;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
# 6. Typography Standards
|
|
126
|
+
|
|
127
|
+
| Element | Size |
|
|
128
|
+
| ------- | ---- |
|
|
129
|
+
| H1 | 32px |
|
|
130
|
+
| H2 | 28px |
|
|
131
|
+
| H3 | 24px |
|
|
132
|
+
| H4 | 20px |
|
|
133
|
+
| Body | 16px |
|
|
134
|
+
| Caption | 14px |
|
|
135
|
+
|
|
136
|
+
Use Material Typography.
|
|
137
|
+
|
|
138
|
+
Avoid custom font scales.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
# 7. Color Standards
|
|
143
|
+
|
|
144
|
+
Use Design Tokens.
|
|
145
|
+
|
|
146
|
+
Example:
|
|
147
|
+
|
|
148
|
+
```scss
|
|
149
|
+
--primary-color
|
|
150
|
+
--secondary-color
|
|
151
|
+
--error-color
|
|
152
|
+
--success-color
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Never hardcode colors.
|
|
156
|
+
|
|
157
|
+
Bad:
|
|
158
|
+
|
|
159
|
+
```scss
|
|
160
|
+
color: red;
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Good:
|
|
164
|
+
|
|
165
|
+
```scss
|
|
166
|
+
color: var(--error-color);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
# 8. Button Standards
|
|
172
|
+
|
|
173
|
+
Primary Actions:
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<button mat-flat-button>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Secondary Actions:
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
<button mat-stroked-button>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Tertiary Actions:
|
|
186
|
+
|
|
187
|
+
```html
|
|
188
|
+
<button mat-button>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Destructive Actions:
|
|
192
|
+
|
|
193
|
+
```html
|
|
194
|
+
<button mat-flat-button color="warn">
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
# 9. Form Standards
|
|
200
|
+
|
|
201
|
+
Every form must have:
|
|
202
|
+
|
|
203
|
+
✓ Labels
|
|
204
|
+
|
|
205
|
+
✓ Validation
|
|
206
|
+
|
|
207
|
+
✓ Error Messages
|
|
208
|
+
|
|
209
|
+
✓ Required Indicators
|
|
210
|
+
|
|
211
|
+
✓ Loading State
|
|
212
|
+
|
|
213
|
+
✓ Submit State
|
|
214
|
+
|
|
215
|
+
Example:
|
|
216
|
+
|
|
217
|
+
```html
|
|
218
|
+
<mat-form-field>
|
|
219
|
+
<mat-label>Email</mat-label>
|
|
220
|
+
<input matInput />
|
|
221
|
+
</mat-form-field>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
# 10. Validation Standards
|
|
227
|
+
|
|
228
|
+
Display errors:
|
|
229
|
+
|
|
230
|
+
✓ On Blur
|
|
231
|
+
|
|
232
|
+
✓ On Submit
|
|
233
|
+
|
|
234
|
+
Avoid showing errors while typing.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
# 11. Loading States
|
|
239
|
+
|
|
240
|
+
Every async action requires:
|
|
241
|
+
|
|
242
|
+
✓ Loading Spinner
|
|
243
|
+
|
|
244
|
+
✓ Skeleton Loader
|
|
245
|
+
|
|
246
|
+
✓ Progress Indicator
|
|
247
|
+
|
|
248
|
+
Never leave users wondering.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
# 12. Empty States
|
|
253
|
+
|
|
254
|
+
Every table/list requires empty state.
|
|
255
|
+
|
|
256
|
+
Example:
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
No employees found.
|
|
260
|
+
Try adjusting filters.
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Avoid blank screens.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
# 13. Error States
|
|
268
|
+
|
|
269
|
+
Display:
|
|
270
|
+
|
|
271
|
+
✓ User-Friendly Message
|
|
272
|
+
|
|
273
|
+
✓ Retry Option
|
|
274
|
+
|
|
275
|
+
✓ Error Tracking
|
|
276
|
+
|
|
277
|
+
Never expose technical details.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
# 14. Table Standards
|
|
282
|
+
|
|
283
|
+
Required:
|
|
284
|
+
|
|
285
|
+
✓ Pagination
|
|
286
|
+
|
|
287
|
+
✓ Sorting
|
|
288
|
+
|
|
289
|
+
✓ Filtering
|
|
290
|
+
|
|
291
|
+
✓ Empty State
|
|
292
|
+
|
|
293
|
+
✓ Loading State
|
|
294
|
+
|
|
295
|
+
Use Angular Material Table.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
# 15. Dialog Standards
|
|
300
|
+
|
|
301
|
+
Dialogs should:
|
|
302
|
+
|
|
303
|
+
✓ Focus First Element
|
|
304
|
+
|
|
305
|
+
✓ Trap Keyboard Focus
|
|
306
|
+
|
|
307
|
+
✓ Support ESC Close
|
|
308
|
+
|
|
309
|
+
✓ Support Mobile
|
|
310
|
+
|
|
311
|
+
Avoid nested dialogs.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
# 16. Accessibility Standards
|
|
316
|
+
|
|
317
|
+
All components must support:
|
|
318
|
+
|
|
319
|
+
✓ Keyboard Navigation
|
|
320
|
+
|
|
321
|
+
✓ Screen Readers
|
|
322
|
+
|
|
323
|
+
✓ Focus Management
|
|
324
|
+
|
|
325
|
+
✓ ARIA Labels
|
|
326
|
+
|
|
327
|
+
Target:
|
|
328
|
+
|
|
329
|
+
WCAG 2.2 AA
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
# 17. Navigation Standards
|
|
334
|
+
|
|
335
|
+
Current page must be visible.
|
|
336
|
+
|
|
337
|
+
Sidebar must support:
|
|
338
|
+
|
|
339
|
+
✓ Active State
|
|
340
|
+
|
|
341
|
+
✓ Collapse State
|
|
342
|
+
|
|
343
|
+
✓ Mobile State
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
# 18. Notification Standards
|
|
348
|
+
|
|
349
|
+
Use Snackbar for:
|
|
350
|
+
|
|
351
|
+
✓ Success
|
|
352
|
+
|
|
353
|
+
✓ Warning
|
|
354
|
+
|
|
355
|
+
✓ Information
|
|
356
|
+
|
|
357
|
+
✓ Error
|
|
358
|
+
|
|
359
|
+
Messages should be concise.
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
# 19. Dashboard Standards
|
|
364
|
+
|
|
365
|
+
Every dashboard should include:
|
|
366
|
+
|
|
367
|
+
✓ Loading State
|
|
368
|
+
|
|
369
|
+
✓ Error State
|
|
370
|
+
|
|
371
|
+
✓ Empty State
|
|
372
|
+
|
|
373
|
+
✓ Last Updated Timestamp
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
# 20. Definition of UI Quality
|
|
378
|
+
|
|
379
|
+
UI is production-ready when:
|
|
380
|
+
|
|
381
|
+
✓ Responsive
|
|
382
|
+
|
|
383
|
+
✓ Accessible
|
|
384
|
+
|
|
385
|
+
✓ Consistent
|
|
386
|
+
|
|
387
|
+
✓ Tested
|
|
388
|
+
|
|
389
|
+
✓ Design System Compliant
|
|
390
|
+
|
|
391
|
+
✓ User Friendly
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Documentation Standards
|
|
2
|
+
|
|
3
|
+
Version: 1.0
|
|
4
|
+
Goal: Clear, Maintainable, Discoverable Knowledge Base
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 1. Documentation Principles
|
|
9
|
+
|
|
10
|
+
1. Documentation is Part of Code
|
|
11
|
+
2. Keep It Updated
|
|
12
|
+
3. Keep It Simple
|
|
13
|
+
4. Document Why, Not Just What
|
|
14
|
+
5. Avoid Duplication
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# 2. Required Documentation Types
|
|
19
|
+
|
|
20
|
+
Each feature must include:
|
|
21
|
+
|
|
22
|
+
✓ README.md
|
|
23
|
+
✓ API references
|
|
24
|
+
✓ Usage examples
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# 3. Feature Documentation Structure
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
Feature Name
|
|
32
|
+
Purpose
|
|
33
|
+
Routes
|
|
34
|
+
Components
|
|
35
|
+
Services
|
|
36
|
+
Models
|
|
37
|
+
Usage Guide
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# 4. README Standards
|
|
43
|
+
|
|
44
|
+
Each feature README must include:
|
|
45
|
+
|
|
46
|
+
* Overview
|
|
47
|
+
* Setup
|
|
48
|
+
* Usage
|
|
49
|
+
* Dependencies
|
|
50
|
+
* API integration
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
# 5. Code Documentation
|
|
55
|
+
|
|
56
|
+
Use JSDoc:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
/**
|
|
60
|
+
* Fetch employee details by ID
|
|
61
|
+
*/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
# 6. Architecture Documentation
|
|
67
|
+
|
|
68
|
+
Must include:
|
|
69
|
+
|
|
70
|
+
* Feature boundaries
|
|
71
|
+
* Data flow
|
|
72
|
+
* Dependencies
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
# 7. ADR (Architecture Decision Records)
|
|
77
|
+
|
|
78
|
+
Format:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Problem
|
|
82
|
+
Decision
|
|
83
|
+
Alternatives
|
|
84
|
+
Outcome
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
# 8. API Documentation
|
|
90
|
+
|
|
91
|
+
All APIs must be documented with:
|
|
92
|
+
|
|
93
|
+
* Request
|
|
94
|
+
* Response
|
|
95
|
+
* Error formats
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
# 9. Component Documentation
|
|
100
|
+
|
|
101
|
+
Shared components must include:
|
|
102
|
+
|
|
103
|
+
* Inputs
|
|
104
|
+
* Outputs
|
|
105
|
+
* Examples
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
# 10. Change Documentation
|
|
110
|
+
|
|
111
|
+
Any breaking change must be documented.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# 11. Versioning Docs
|
|
116
|
+
|
|
117
|
+
Document all major changes per release.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
# 12. AI Documentation Rules
|
|
122
|
+
|
|
123
|
+
AI-generated code must include:
|
|
124
|
+
|
|
125
|
+
✓ Clear comments
|
|
126
|
+
✓ Usage examples
|
|
127
|
+
✓ Type definitions
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# API Standards
|
|
2
|
+
|
|
3
|
+
Version: 1.0
|
|
4
|
+
Framework: Angular 20+ Frontend Integration
|
|
5
|
+
Goal: Consistent, Secure, Scalable API Communication
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 1. API Design Principles
|
|
10
|
+
|
|
11
|
+
## Core Principles
|
|
12
|
+
|
|
13
|
+
1. Consistency Across All Services
|
|
14
|
+
2. Strong Typing for All Requests/Responses
|
|
15
|
+
3. No Direct API Calls in Components
|
|
16
|
+
4. Backend is Source of Truth
|
|
17
|
+
5. Frontend Must Never Assume Data Shape
|
|
18
|
+
6. Fail Gracefully Always
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# 2. API Layer Architecture
|
|
23
|
+
|
|
24
|
+
All API calls must go through services:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
Component → Service → HTTP Client → Backend
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Never:
|
|
31
|
+
|
|
32
|
+
❌ Call HttpClient directly in components
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
# 3. Endpoint Standards
|
|
37
|
+
|
|
38
|
+
## Naming Convention
|
|
39
|
+
|
|
40
|
+
Use RESTful naming:
|
|
41
|
+
|
|
42
|
+
| Action | Pattern |
|
|
43
|
+
| ------- | --------------------- |
|
|
44
|
+
| Get All | GET /resources |
|
|
45
|
+
| Get One | GET /resources/:id |
|
|
46
|
+
| Create | POST /resources |
|
|
47
|
+
| Update | PUT /resources/:id |
|
|
48
|
+
| Delete | DELETE /resources/:id |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
# 4. DTO Standards
|
|
53
|
+
|
|
54
|
+
## Separate Models
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
Employee
|
|
58
|
+
CreateEmployeeRequest
|
|
59
|
+
UpdateEmployeeRequest
|
|
60
|
+
EmployeeResponse
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Never reuse API models directly in UI logic.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
# 5. Response Wrapper
|
|
68
|
+
|
|
69
|
+
All APIs must follow:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
interface ApiResponse<T> {
|
|
73
|
+
data: T;
|
|
74
|
+
message: string;
|
|
75
|
+
success: boolean;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
# 6. Error Handling
|
|
82
|
+
|
|
83
|
+
Standard API error:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
interface ApiError {
|
|
87
|
+
code: string;
|
|
88
|
+
message: string;
|
|
89
|
+
details?: unknown;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
# 7. Pagination Standards
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
interface PaginatedResponse<T> {
|
|
99
|
+
data: T[];
|
|
100
|
+
total: number;
|
|
101
|
+
page: number;
|
|
102
|
+
pageSize: number;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
# 8. Filtering & Sorting
|
|
109
|
+
|
|
110
|
+
Standard query params:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
?page=1&pageSize=10&sortBy=name&order=asc
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
# 9. HTTP Methods Rules
|
|
119
|
+
|
|
120
|
+
| Method | Usage |
|
|
121
|
+
| ------ | -------------- |
|
|
122
|
+
| GET | Read |
|
|
123
|
+
| POST | Create |
|
|
124
|
+
| PUT | Full Update |
|
|
125
|
+
| PATCH | Partial Update |
|
|
126
|
+
| DELETE | Remove |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
# 10. Authentication Standards
|
|
131
|
+
|
|
132
|
+
* Use Bearer Token
|
|
133
|
+
* Inject via HTTP Interceptor
|
|
134
|
+
* Never manually attach token in services
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
# 11. Caching Strategy
|
|
139
|
+
|
|
140
|
+
Cache allowed for:
|
|
141
|
+
|
|
142
|
+
✓ Master Data
|
|
143
|
+
✓ Dropdown Data
|
|
144
|
+
✓ Static Configs
|
|
145
|
+
|
|
146
|
+
Do NOT cache:
|
|
147
|
+
|
|
148
|
+
❌ Payroll Data
|
|
149
|
+
❌ Sensitive Employee Data
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
# 12. Retry Policy
|
|
154
|
+
|
|
155
|
+
Retry only:
|
|
156
|
+
|
|
157
|
+
* Network failures
|
|
158
|
+
* Timeout errors
|
|
159
|
+
|
|
160
|
+
Never retry:
|
|
161
|
+
|
|
162
|
+
❌ 4xx errors
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
# 13. Logging
|
|
167
|
+
|
|
168
|
+
Log only:
|
|
169
|
+
|
|
170
|
+
✓ API failures
|
|
171
|
+
✓ Performance issues
|
|
172
|
+
|
|
173
|
+
Never log sensitive payloads.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
# 14. Versioning
|
|
178
|
+
|
|
179
|
+
APIs must support versioning:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
/api/v1/employees
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
# 15. Security Rules
|
|
188
|
+
|
|
189
|
+
* Always use HTTPS
|
|
190
|
+
* Validate input on backend
|
|
191
|
+
* Never trust frontend validation alone
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
# 16. AI API Rules
|
|
196
|
+
|
|
197
|
+
AI-generated API calls must:
|
|
198
|
+
|
|
199
|
+
✓ Use typed responses
|
|
200
|
+
✓ Follow DTO structure
|
|
201
|
+
✓ Never bypass interceptors
|