You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using `setInterval` with async database queries or API calls, you **must** check connection state **after** the async operation completes to prevent crashes:
-**Regular audits**: Review settings periodically for unused or outdated values
905
905
-**Environment separation**: Use different encryption secrets for different environments
906
906
907
-
### Performance Considerations
907
+
### Performance: In-Memory Cache
908
+
909
+
The global settings system uses an **in-memory cache** to eliminate database queries for read operations. This is critical for high-frequency endpoints like health checks (`/`) and Swagger documentation (`/documentation`).
The current cache implementation is designed for **single-instance deployments**. Multi-instance support (horizontal scaling) with shared cache synchronization is planned for a future release.
Copy file name to clipboardExpand all lines: development/frontend/architecture.mdx
+179-5Lines changed: 179 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,72 @@ views/
65
65
66
66
Components are **reusable UI building blocks** that encapsulate specific functionality and presentation logic.
67
67
68
+
#### Component Organization Structure
69
+
70
+
**MANDATORY**: All feature-specific components must follow a hierarchical directory structure that mirrors the view organization. This creates clear ownership boundaries and improves code discoverability.
│ │ └── index.ts # Export all installation components
101
+
│ └── catalog/
102
+
│ ├── ServerCard.vue
103
+
│ ├── ServerFilters.vue
104
+
│ └── index.ts
105
+
```
106
+
107
+
#### Barrel Export Pattern (Mandatory)
108
+
109
+
Every feature component directory must include an `index.ts` file that exports all components. This creates a clean import API and makes refactoring easier.
- Only place components here if they truly span features
155
+
156
+
#### Component Organization Rules
157
+
158
+
1.**Mirror View Structure**: Component organization should parallel view hierarchy
159
+
2.**Feature Isolation**: Keep feature components within their feature directory
160
+
3.**Mandatory Barrel Exports**: Every feature directory must export via `index.ts`
161
+
4.**No Deep Nesting**: Maximum 3 levels deep (feature/sub-feature/component)
162
+
5.**Colocation**: Related components stay together
163
+
164
+
#### When to Create a New Feature Directory
165
+
166
+
Create a new feature component directory when:
167
+
- You have 3+ components related to the same feature
168
+
- The components are reused across multiple views within the feature
169
+
- The feature has clear boundaries and ownership
170
+
- The components share common types or logic
87
171
88
172
#### Component Design Rules
89
173
@@ -92,6 +176,13 @@ Components are **reusable UI building blocks** that encapsulate specific functio
92
176
3.**Composition Pattern**: Break complex components into smaller parts
93
177
4.**Self-Contained**: Components should work in isolation
94
178
179
+
#### Exceptions to the Structure
180
+
181
+
You may deviate from the structure for:
182
+
-**One-off components**: Components used in a single view can stay in the view file
183
+
-**UI library components**: shadcn-vue components in `/ui` follow their own structure
184
+
-**Extremely small features**: Features with only 1-2 simple components
185
+
95
186
### Services Layer (`/services`)
96
187
97
188
Services handle **all external communication and business logic processing**. They act as the bridge between the frontend and backend APIs.
@@ -115,9 +206,85 @@ Services handle **all external communication and business logic processing**. Th
115
206
116
207
Composables are **reusable logic units** that leverage Vue's Composition API to share stateful logic across components.
117
208
209
+
#### Composable Organization Structure
210
+
211
+
**MANDATORY**: Feature-specific composables must follow a hierarchical directory structure that mirrors the component and view organization. This creates consistency across the codebase and makes related logic easy to find.
│ │ └── index.ts # Export all installation composables
235
+
│ └── catalog/
236
+
│ ├── useCatalogFilters.ts
237
+
│ ├── useCatalogSearch.ts
238
+
│ └── index.ts
239
+
├── useAuth.ts
240
+
└── useEventBus.ts
241
+
```
242
+
243
+
#### Barrel Export Pattern (Mandatory)
244
+
245
+
Every feature composable directory must include an `index.ts` file that exports all composables. This mirrors the component structure and provides a clean import API.
0 commit comments