ciyidogan commited on
Commit
59aa0c4
Β·
verified Β·
1 Parent(s): dced8da

Delete flare-ui-tasarim.md

Browse files
Files changed (1) hide show
  1. flare-ui-tasarim.md +0 -605
flare-ui-tasarim.md DELETED
@@ -1,605 +0,0 @@
1
- # Flare Administration UI - GΓΌncel TasarΔ±m DokΓΌmanΔ±
2
-
3
- ## πŸ“Œ Genel Bakış
4
-
5
- Flare Administration UI, Flare platformunun web tabanlı yânetim arayüzüdür. Angular 16+ ile geliştirilmiş, Material Design prensiplerine uygun, responsive ve modern bir single-page application'dır.
6
-
7
- ## πŸ— Teknik AltyapΔ±
8
-
9
- ### Frontend Stack
10
- ```json
11
- {
12
- "framework": "Angular 16+",
13
- "ui_library": "Angular Material",
14
- "styling": "SCSS + Tailwind CSS (utility classes)",
15
- "state_management": "RxJS + Services",
16
- "http": "HttpClient with Interceptors",
17
- "icons": "Material Icons + Lucide",
18
- "editor": "CodeMirror (JSON/JSONC)",
19
- "charts": "Chart.js",
20
- "build": "Standalone Components"
21
- }
22
- ```
23
-
24
- ### Backend Integration
25
- - RESTful API endpoints
26
- - JWT Authentication (`X-Auth-Token` header)
27
- - Real-time updates (WebSocket - planned)
28
- - File upload/download (import/export)
29
-
30
- ## 🎨 UI Yapısı
31
-
32
- ### 1. Layout Structure
33
- ```
34
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
35
- β”‚ Flare Admin [Environment] [User β–Ό] [Logout] β”‚ <- Header
36
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
37
- β”‚ Projects | APIs | Users | Logs | [Config βš™] β”‚ <- Tab Bar
38
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
39
- β”‚ β”‚
40
- β”‚ [Tab Content] β”‚ <- Content Area
41
- β”‚ β”‚
42
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
43
- ```
44
-
45
- ### 2. Login Component
46
- - Material card design
47
- - Username/Password fields
48
- - "Remember Me" checkbox
49
- - Error handling with snackbar
50
- - Auto-redirect after login
51
-
52
- ### 3. Projects Tab
53
-
54
- #### Project List View
55
- ```typescript
56
- interface ProjectDisplay {
57
- id: number;
58
- name: string;
59
- caption: string;
60
- icon: string;
61
- enabled: boolean;
62
- versionCount: number;
63
- lastUpdate?: string;
64
- }
65
- ```
66
-
67
- **Features:**
68
- - Grid layout (responsive cards)
69
- - Quick actions: Edit, Toggle Enable, Delete
70
- - Version count badge
71
- - Status indicator (enabled/disabled)
72
- - Search/Filter toolbar
73
- - "New Project" FAB
74
-
75
- #### Project Edit Dialog
76
- **Tabs Structure:**
77
- 1. **Basic Info**
78
- - Name, Caption, Icon selector
79
- - Description (textarea)
80
- - Locale settings (default + supported)
81
- - Timezone and region
82
-
83
- 2. **Versions**
84
- - Version list with status badges
85
- - Actions: Edit, Copy, Publish, Delete
86
- - Published versions are read-only
87
- - Version comparison (planned)
88
-
89
- 3. **Settings**
90
- - Advanced project settings
91
- - Integration configs
92
-
93
- #### Version Editor
94
- **Split-panel Layout:**
95
- ```
96
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
97
- β”‚ Intent List β”‚ Intent Details β”‚
98
- β”‚ ─────────────── β”‚ ─────────────────── β”‚
99
- β”‚ βœ“ searchFlights β”‚ Name: searchFlights β”‚
100
- β”‚ bookFlight β”‚ Caption: UΓ§uş Arama β”‚
101
- β”‚ checkBooking β”‚ [Requires Approval: β–‘] β”‚
102
- β”‚ + Add Intent β”‚ Examples: [...] β”‚
103
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
104
- ```
105
-
106
- **Version Fields:**
107
- - General Prompt (CodeMirror editor)
108
- - Welcome Prompt (with LLM preview)
109
- - LLM Configuration
110
- - Model selection
111
- - Generation config (expandable)
112
- - Fine-tune settings
113
-
114
- #### Intent Editor
115
- **Sections:**
116
- 1. **Basic Info**
117
- - Name (auto-slug)
118
- - Caption
119
- - requiresApproval toggle
120
- - Dependencies (multi-select)
121
-
122
- 2. **Examples** (Multilingual)
123
- ```typescript
124
- interface ExampleEditor {
125
- locale: string;
126
- examples: string[];
127
- }
128
- ```
129
- - Tab per locale
130
- - Add/Remove examples
131
- - Bulk import
132
-
133
- 3. **Parameters**
134
- - Drag-drop reordering
135
- - Inline editing
136
- - Type-specific validators
137
- - Multi-language captions
138
-
139
- 4. **Action**
140
- - API selection dropdown
141
- - API preview panel
142
- - Test action (planned)
143
-
144
- #### Parameter Editor Component
145
- ```html
146
- <app-parameter-editor
147
- [parameter]="param"
148
- [locales]="['tr', 'en']"
149
- [availableVariables]="variables"
150
- (change)="onParameterChange($event)">
151
- </app-parameter-editor>
152
- ```
153
-
154
- **Features:**
155
- - Smart variable name generation
156
- - Type-specific controls
157
- - Regex validator with tester
158
- - Multi-language support
159
-
160
- ### 4. APIs Tab
161
-
162
- #### API List
163
- **DataTable Columns:**
164
- - Name | URL | Method | Auth | Response | Actions
165
-
166
- **Features:**
167
- - Sorting and filtering
168
- - Inline status indicators
169
- - Batch operations
170
- - Export to CSV
171
-
172
- #### API Edit Dialog
173
- **Advanced Tab Structure:**
174
-
175
- 1. **Basic Configuration**
176
- ```typescript
177
- interface APIBasic {
178
- name: string;
179
- description?: string; // For approval messages
180
- url: string;
181
- method: 'GET' | 'POST' | 'PUT' | 'DELETE';
182
- }
183
- ```
184
-
185
- 2. **Headers & Body**
186
- - JSON editor with syntax highlighting
187
- - Variable autocomplete (`{{variables.xxx}}`)
188
- - Template validation
189
- - Format/Beautify button
190
-
191
- 3. **Authentication**
192
- - Enable/Disable toggle
193
- - Token endpoint configuration
194
- - Token path (JSON path)
195
- - Refresh mechanism setup
196
-
197
- 4. **Response Configuration**
198
- - Response prompt editor
199
- - Response mappings builder
200
- - JSON path tester
201
- - Sample response upload
202
-
203
- 5. **Advanced Settings**
204
- - Timeout configuration
205
- - Retry strategy
206
- - Proxy settings
207
-
208
- #### Response Mapping Builder
209
- ```typescript
210
- interface ResponseMapping {
211
- variable_name: string;
212
- caption: string;
213
- type: string;
214
- json_path: string;
215
- }
216
- ```
217
-
218
- **Visual JSON Path Builder:**
219
- - Upload sample response
220
- - Click to build path
221
- - Real-time validation
222
- - Type inference
223
-
224
- ### 5. Environment Configuration
225
-
226
- #### Provider Management
227
- ```
228
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
229
- β”‚ LLM Provider β”‚
230
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
231
- β”‚ β”‚ ⚑ Spark LLM [Configure β–Ό] β”‚ β”‚
232
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
233
- β”‚ β”‚
234
- β”‚ TTS Provider β”‚
235
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
236
- β”‚ β”‚ πŸ”Š ElevenLabs [Configure β–Ό] β”‚ β”‚
237
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
238
- β”‚ β”‚
239
- β”‚ STT Provider β”‚
240
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
241
- β”‚ β”‚ 🎀 Google STT [Configure β–Ό] β”‚ β”‚
242
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
243
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
244
- ```
245
-
246
- **Provider Configuration:**
247
- - Dynamic form based on provider requirements
248
- - API key encryption indicator
249
- - Endpoint validation
250
- - Test connection button
251
-
252
- #### Internal Prompt Editor
253
- - Full-screen CodeMirror
254
- - Placeholder hints
255
- - Template variables sidebar
256
- - Save with validation
257
-
258
- ### 6. Activity Logs
259
-
260
- #### Timeline View
261
- ```typescript
262
- interface ActivityLog {
263
- timestamp: string;
264
- username: string;
265
- action: string;
266
- entity_type: string;
267
- entity_name?: string;
268
- details?: string;
269
- }
270
- ```
271
-
272
- **Features:**
273
- - Infinite scroll
274
- - Real-time updates
275
- - Filter by action/user/date
276
- - Export functionality
277
- - Detailed view dialog
278
-
279
- ### 7. Test Console
280
-
281
- #### Chat Test Interface
282
- ```
283
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
284
- β”‚ Project: [pegasus_airlines β–Ό] v[1 β–Ό] β”‚
285
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
286
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
287
- β”‚ β”‚ πŸ’¬ Chat Messages β”‚ β”‚
288
- β”‚ β”‚ ───────────────────── β”‚ β”‚
289
- β”‚ β”‚ πŸ€– Hoş geldiniz! β”‚ β”‚
290
- β”‚ β”‚ πŸ‘€ UΓ§uş aramak istiyorum β”‚ β”‚
291
- β”‚ β”‚ πŸ€– [Intent: searchFlights] β”‚ β”‚
292
- β”‚ β”‚ Nereden nereye? β”‚ β”‚
293
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
294
- β”‚ [Message input] [🎀] [Send] β”‚
295
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
296
- β”‚ Session Info | Variables | API Calls β”‚
297
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
298
- ```
299
-
300
- **Debug Panel Tabs:**
301
- - Session state and variables
302
- - Intent detection details
303
- - API call history
304
- - Raw LLM responses
305
-
306
- ## 🧩 Reusable Components
307
-
308
- ### 1. Multi-Language Input
309
- ```typescript
310
- @Component({
311
- selector: 'app-multilang-input',
312
- template: `
313
- <mat-tab-group>
314
- <mat-tab *ngFor="let locale of locales">
315
- <ng-template mat-tab-label>
316
- {{ getLocaleName(locale) }}
317
- </ng-template>
318
- <mat-form-field>
319
- <input matInput [(ngModel)]="values[locale]">
320
- </mat-form-field>
321
- </mat-tab>
322
- </mat-tab-group>
323
- `
324
- })
325
- export class MultilangInputComponent {
326
- @Input() locales: string[];
327
- @Input() values: LocalizedValue[];
328
- @Output() change = new EventEmitter();
329
- }
330
- ```
331
-
332
- ### 2. Variable Selector
333
- ```typescript
334
- interface Variable {
335
- name: string;
336
- source: 'intent' | 'api' | 'system';
337
- type: string;
338
- }
339
- ```
340
-
341
- **Features:**
342
- - Categorized dropdown
343
- - Search functionality
344
- - Type indicators
345
- - Copy to clipboard
346
-
347
- ### 3. JSON Editor Wrapper
348
- ```typescript
349
- @Component({
350
- selector: 'app-json-editor',
351
- template: `
352
- <div class="editor-container">
353
- <codemirror
354
- [(ngModel)]="value"
355
- [options]="editorOptions"
356
- (change)="onChange()">
357
- </codemirror>
358
- <button mat-icon-button (click)="format()">
359
- <mat-icon>format_align_left</mat-icon>
360
- </button>
361
- </div>
362
- `
363
- })
364
- ```
365
-
366
- ### 4. Confirmation Dialog
367
- ```typescript
368
- interface ConfirmData {
369
- title: string;
370
- message: string;
371
- confirmText?: string;
372
- cancelText?: string;
373
- dangerous?: boolean;
374
- }
375
- ```
376
-
377
- ## 🎯 Services Architecture
378
-
379
- ### Core Services
380
- ```typescript
381
- // API communication
382
- @Injectable()
383
- export class ApiService {
384
- // Project CRUD
385
- getProjects(): Observable<Project[]>
386
- createProject(data: ProjectData): Observable<Project>
387
- updateProject(id: number, data: ProjectData): Observable<Project>
388
-
389
- // Version management
390
- createVersion(projectId: number): Observable<Version>
391
- publishVersion(projectId: number, versionId: number): Observable<Version>
392
-
393
- // Environment
394
- getEnvironment(): Observable<EnvironmentConfig>
395
- updateEnvironment(config: EnvironmentConfig): Observable<void>
396
- }
397
-
398
- // Authentication
399
- @Injectable()
400
- export class AuthService {
401
- login(credentials: LoginData): Observable<AuthResponse>
402
- logout(): void
403
- getToken(): string | null
404
- isAuthenticated(): boolean
405
- }
406
-
407
- // Environment state
408
- @Injectable()
409
- export class EnvironmentService {
410
- ttsEnabled$: BehaviorSubject<boolean>
411
- sttEnabled$: BehaviorSubject<boolean>
412
- currentProvider$: BehaviorSubject<ProviderInfo>
413
- }
414
- ```
415
-
416
- ### HTTP Interceptor
417
- ```typescript
418
- @Injectable()
419
- export class AuthInterceptor implements HttpInterceptor {
420
- intercept(req: HttpRequest<any>, next: HttpHandler) {
421
- const token = this.authService.getToken();
422
- if (token) {
423
- req = req.clone({
424
- setHeaders: { 'X-Auth-Token': token }
425
- });
426
- }
427
- return next.handle(req);
428
- }
429
- }
430
- ```
431
-
432
- ## 🎨 Theming and Styling
433
-
434
- ### Material Theme
435
- ```scss
436
- // Custom theme
437
- $primary: mat-palette($mat-indigo);
438
- $accent: mat-palette($mat-pink, A200);
439
- $warn: mat-palette($mat-red);
440
-
441
- $theme: mat-light-theme((
442
- color: (
443
- primary: $primary,
444
- accent: $accent,
445
- warn: $warn
446
- )
447
- ));
448
-
449
- // Dark theme
450
- $dark-theme: mat-dark-theme((
451
- color: (
452
- primary: $primary,
453
- accent: $accent,
454
- warn: $warn
455
- )
456
- ));
457
- ```
458
-
459
- ### Component Styling Pattern
460
- ```scss
461
- .component-container {
462
- @apply p-4 h-full flex flex-col;
463
-
464
- .header {
465
- @apply flex justify-between items-center mb-4;
466
- }
467
-
468
- .content {
469
- @apply flex-1 overflow-auto;
470
- }
471
-
472
- .actions {
473
- @apply mt-4 flex justify-end gap-2;
474
- }
475
- }
476
- ```
477
-
478
- ## πŸ“± Responsive Design
479
-
480
- ### Breakpoints
481
- ```scss
482
- $mobile: 640px;
483
- $tablet: 768px;
484
- $desktop: 1024px;
485
- $wide: 1280px;
486
- ```
487
-
488
- ### Mobile Adaptations
489
- - Collapsible sidebar
490
- - Bottom sheet dialogs
491
- - Touch-optimized controls
492
- - Simplified layouts
493
-
494
- ## πŸš€ Performance Optimizations
495
-
496
- ### Lazy Loading
497
- ```typescript
498
- const routes: Routes = [
499
- {
500
- path: 'projects',
501
- loadChildren: () => import('./projects/projects.module')
502
- .then(m => m.ProjectsModule)
503
- }
504
- ];
505
- ```
506
-
507
- ### Change Detection
508
- ```typescript
509
- @Component({
510
- changeDetection: ChangeDetectionStrategy.OnPush
511
- })
512
- ```
513
-
514
- ### Virtual Scrolling
515
- ```html
516
- <cdk-virtual-scroll-viewport itemSize="50">
517
- <div *cdkVirtualFor="let item of items">
518
- {{ item }}
519
- </div>
520
- </cdk-virtual-scroll-viewport>
521
- ```
522
-
523
- ## πŸ”’ Security Considerations
524
-
525
- ### XSS Prevention
526
- - Sanitized HTML rendering
527
- - Template validation
528
- - CSP headers
529
-
530
- ### Authentication Flow
531
- ```
532
- Login β†’ JWT Token β†’ Local Storage β†’ HTTP Header β†’ API Validation
533
- ↓ ↓
534
- Redirect Auto Logout
535
- ```
536
-
537
- ### Sensitive Data
538
- - Encrypted API keys (visual: `β€’β€’β€’β€’β€’β€’β€’xyz`)
539
- - No plaintext passwords
540
- - Secure cookie options
541
-
542
- ## πŸ§ͺ Testing Strategy
543
-
544
- ### Unit Tests
545
- - Component logic
546
- - Service methods
547
- - Pipe transformations
548
-
549
- ### E2E Tests
550
- - User workflows
551
- - API integration
552
- - Error scenarios
553
-
554
- ## πŸ“Š Analytics and Monitoring
555
-
556
- ### User Activity Tracking
557
- - Feature usage metrics
558
- - Performance timing
559
- - Error reporting
560
-
561
- ### Dashboard Metrics
562
- - Active projects count
563
- - API call statistics
564
- - User engagement
565
-
566
- ## 🚦 Deployment
567
-
568
- ### Build Configuration
569
- ```json
570
- {
571
- "production": {
572
- "optimization": true,
573
- "sourceMap": false,
574
- "namedChunks": false,
575
- "extractLicenses": true,
576
- "vendorChunk": false
577
- }
578
- }
579
- ```
580
-
581
- ### Environment Files
582
- ```typescript
583
- // environment.prod.ts
584
- export const environment = {
585
- production: true,
586
- apiUrl: '/api',
587
- wsUrl: 'wss://flare.example.com'
588
- };
589
- ```
590
-
591
- ## πŸ”„ Future Enhancements
592
-
593
- ### Planned Features
594
- 1. **Visual Flow Builder**: Drag-drop intent flow designer
595
- 2. **A/B Testing**: Version comparison framework
596
- 3. **Analytics Dashboard**: Usage statistics and insights
597
- 4. **Collaboration**: Multi-user editing with presence
598
- 5. **Plugin System**: Extensible architecture
599
- 6. **Mobile App**: Native mobile management app
600
-
601
- ### Technical Debt
602
- - Migrate to signals (Angular 17+)
603
- - Implement state management (NgRx)
604
- - Add comprehensive error boundaries
605
- - Improve test coverage to 80%+