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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
{
"project": "systemd-networkd simple Web UI",
"version": "0.5",
"goal": "Make a easy to use interface to configure router to teach network basics for high schoolers purposes",
"requirements": {
"functional": [
{
"id": "F-001",
"description": "The system shall provide a structured web-based control panel with application-style layout (navigation menu, panels, command buttons)."
},
{
"id": "F-002",
"description": "The system shall parse `networkctl status --json=short` output and present each interface as a structured panel showing: name, MAC, state, addresses, routes, DNS."
},
{
"id": "F-003",
"description": "The system shall allow browsing of existing network configuration files under `/etc/systemd/network/`."
},
{
"id": "F-004",
"description": "The system shall display each configuration file (`*.network`, `*.netdev`, `*.link`) as editable text with syntax highlighting and validation hooks."
},
{
"id": "F-005",
"description": "The system shall validate edited configuration against systemd-networkd rules before allowing save (e.g., reject unknown keys, missing sections)."
},
{
"id": "F-006",
"description": "The system shall provide versioned backups of configuration files, allowing rollback to earlier revisions."
},
{
"id": "F-007",
"description": "The system shall provide controls to apply changes safely by restarting only `systemd-networkd` (not full reboot)."
},
{
"id": "F-008",
"description": "The system shall provide a full device reboot option for recovery."
},
{
"id": "F-009",
"description": "The system shall provide both raw text editor and structured visual editor for configuration files."
},
{
"id": "F-010",
"description": "The system shall support theme switching between light and dark modes with persistence."
},
{
"id": "F-011",
"description": "The system shall provide an interactive, visual network topology diagram that updates in real-time to reflect configuration changes and tutorial steps."
}
],
"technical": [
{
"id": "T-001",
"description": "The backend shall be implemented in Go, exposing HTTP endpoints for structured data (JSON) and file operations."
},
{
"id": "T-002",
"description": "The backend shall include a parser for systemd-networkd configuration files, mapping sections ([Match], [Link], [Network], etc.) into JSON objects."
},
{
"id": "T-003",
"description": "The frontend shall render interface panels dynamically from backend JSON and allow in-place editing of configuration fields."
},
{
"id": "T-004",
"description": "Configuration edits shall be validated by a backend hook that checks syntax with `systemd-analyze verify` before saving."
},
{
"id": "T-005",
"description": "All changes shall be written atomically to `/etc/systemd/network/`, with `.bak` backup created automatically."
},
{
"id": "T-006",
"description": "The backend shall implement privilege separation: file I/O restricted to `/etc/systemd/network/`, command execution restricted to `systemd-networkd` operations."
},
{
"id": "T-007",
"description": "The frontend shall provide syntax highlighting (via regex) for editing `.network` files."
},
{
"id": "T-008",
"description": "The system shall expose REST API endpoints for: (a) listing configs, (b) retrieving config, (c) validating config, (d) saving config, (e) restarting networkd, (f) rebooting device."
},
{
"id": "T-009",
"description": "The frontend shall use vanilla HTML/CSS/JS with modern ES2024+ features and no heavy frameworks."
},
{
"id": "T-010",
"description": "The system shall implement proper error handling and user feedback for all operations."
}
],
"software_development": [
{
"id": "SD-001",
"description": "Use ES2024+ JavaScript features with strict mode and JSHint annotations for code quality."
},
{
"id": "SD-002",
"description": "Implement modular architecture with clear separation of concerns: Application class orchestrates, static utilities handle pure functions."
},
{
"id": "SD-003",
"description": "Use private class fields and methods (#prefix) for encapsulation following MDN conventions."
},
{
"id": "SD-004",
"description": "Minimize side effects: static methods should be pure functions returning values, side effects isolated to Application class."
},
{
"id": "SD-005",
"description": "Use Symbol-based enumerations for state management with Object.freeze() for immutability."
},
{
"id": "SD-006",
"description": "Implement proper error handling with try/catch blocks and user-friendly error messages."
},
{
"id": "SD-007",
"description": "Use async/await for all asynchronous operations with proper error propagation."
},
{
"id": "SD-008",
"description": "Follow data-driven design: configuration schemas drive UI generation, no hardcoded field knowledge in UI components."
},
{
"id": "SD-009",
"description": "Implement proper type safety with field validation and schema definitions."
},
{
"id": "SD-010",
"description": "Use static factory methods (fromSystemdConfiguration) for object creation instead of constructors with complex logic."
},
{
"id": "SD-011",
"description": "Implement proper getter/setter methods for encapsulated data access."
},
{
"id": "SD-012",
"description": "Use CSS custom properties (variables) for theming and consistent design system."
},
{
"id": "SD-013",
"description": "Follow responsive design principles with mobile-first CSS and touch event support."
},
{
"id": "SD-014",
"description": "Implement proper event delegation and single event handler registration in Application class."
},
{
"id": "SD-015",
"description": "Use CustomEvent for component communication with proper event naming conventions."
},
{
"id": "SD-016",
"description": "Implement proper HTML sanitization for dynamic content to prevent XSS vulnerabilities."
},
{
"id": "SD-017",
"description": "Use template literals for HTML generation with proper escaping and sanitization."
},
{
"id": "SD-018",
"description": "Follow accessibility best practices with proper ARIA labels and keyboard navigation."
},
{
"id": "SD-019",
"description": "Implement proper loading states and user feedback for all asynchronous operations."
},
{
"id": "SD-020",
"description": "Use localStorage for client-side persistence of user preferences (theme, etc.)."
},
{
"id": "SD-021",
"description": "Follow semantic versioning for API compatibility and module exports."
},
{
"id": "SD-022",
"description": "Implement proper code documentation with JSDoc annotations for all public methods."
},
{
"id": "SD-023",
"description": "Use descriptive variable and method names following camelCase convention."
},
{
"id": "SD-024",
"description": "Implement proper separation between business logic and UI rendering layers."
},
{
"id": "SD-025",
"description": "Use dynamic imports for code splitting and lazy loading of non-critical modules."
}
],
"educational": [
{
"id": "E-001",
"description": "Each configuration option shall have beginner-friendly explanation with examples of when to use it."
},
{
"id": "E-002",
"description": "The interface shall include learning progression from basic (IP addresses) to advanced (firewall rules, VLANs)."
},
{
"id": "E-003",
"description": "The system shall provide immediate feedback showing how configuration changes affect network behavior, including updates to the interactive topology graph."
},
{
"id": "E-004",
"description": "Complex concepts shall be broken down with analogies (e.g., 'IP addresses are like street addresses for computers')."
},
{
"id": "E-005",
"description": "The system shall include built-in, scenario-based tutorials for common networking scenarios (home router, school lab, game server, web server)."
},
{
"id": "E-006",
"description": "All networking terms shall have tooltip explanations with <abbr> HTML elements for accessibility."
},
{
"id": "E-007",
"description": "The interface shall provide visual network topology diagrams showing interface relationships, which are interactive and highlight elements referenced in tutorials."
},
{
"id": "E-008",
"description": "The system shall include safe experimentation mode with easy undo/redo capabilities and guided tutorials that prevent breaking the core management connection."
},
{
"id": "E-009",
"description": "Tutorials shall be goal-oriented (e.g., 'Host a Game Server') and break down the goal into concrete, configuration-driven steps."
},
{
"id": "E-010",
"description": "The system shall bridge the gap between the visual/guided interface and the underlying text configuration, explicitly showing users the file being modified in later tutorials."
},
{
"id": "E-011",
"description": "The onboarding experience shall present a primary 'Learn Networking' path for beginners, allowing them to explore concepts before manipulating live configuration."
}
]
},
"javascript_conventions_summary": {
"language_features": [
"ES2024+ features",
"ES modules (import/export)",
"Async/await for all asynchronous operations",
"Optional chaining (?.) and nullish coalescing (??)",
"Template literals for string interpolation",
"Arrow functions for method binding",
"Destructuring assignment"
],
"architecture_patterns": [
"Modular design with single responsibility principle",
"Static utility classes for pure functions",
"Main Application class for orchestration and side effects",
"Data-driven UI generation from schemas",
"Event-driven communication between components",
"Separation of business logic and presentation layers"
],
"encapsulation": [
"Private class fields (#privateField)",
"Private methods (#privateMethod)",
"Getter methods for controlled data access",
"Immutable state with Object.freeze()",
"Symbol-based enumerations for type safety"
],
"error_handling": [
"Try/catch blocks around all async operations",
"User-friendly error messages",
"Proper error propagation",
"Validation at field and schema levels",
"Graceful degradation for missing features"
],
"code_quality": [
"JSHint annotations for linting",
"JSDoc documentation for all public APIs",
"Descriptive naming conventions (camelCase)",
"Consistent code formatting",
"Pure functions without side effects",
"Minimal DOM manipulation in utility classes"
],
"security": [
"HTML sanitization for dynamic content",
"Input validation at API boundaries",
"Proper error message sanitization",
"No eval() or unsafe dynamic code execution",
"Content Security Policy compliance"
],
"performance": [
"Event delegation for efficient event handling",
"Debounced user input where appropriate",
"Efficient DOM updates",
"Lazy loading of non-critical modules",
"Proper memory management"
],
"maintainability": [
"Clear separation between static and stateful code",
"Consistent file and module organization",
"Comprehensive configuration schema system",
"Extensible field type system",
"Well-documented public API surface"
]
}
}
|