@@ -39,7 +39,6 @@ HackOps is a competitive hackathon where teams showcase their DevOps expertise b
39
39
- Runtime orchestration via ** Docker Compose** on a VPS
40
40
- Observability with ** OpenTelemetry** and structured logging
41
41
42
-
43
42
## Monorepo Structure
44
43
45
44
```
@@ -56,6 +55,56 @@ HackOps is a competitive hackathon where teams showcase their DevOps expertise b
56
55
- ** PNPM workspaces** ensure efficient installs and consistent deps
57
56
- ** Strict TypeScript** settings guarantee type safety across boundaries
58
57
58
+ ```` mermaid
59
+ flowchart TD
60
+ subgraph Development
61
+ dev[Developer Codes] --> commit[Commit to GitHub]
62
+ commit --> pr[Create Pull Request]
63
+ end
64
+
65
+ subgraph "CI/CD Pipeline"
66
+ pr --> validate[GitHub Actions: Validate Job]
67
+ validate --> tests[Run Tests]
68
+ tests --> build[Build Application]
69
+
70
+ subgraph Testing
71
+ tests --> lint[ESLint]
72
+ tests --> typecheck[TypeScript Check]
73
+ tests --> unittest[Jest Unit Tests]
74
+ tests --> e2e[Playwright E2E Tests]
75
+ end
76
+
77
+ build --> merge[Merge to Main]
78
+ merge --> deploy[GitHub Actions: Deploy Job]
79
+ end
80
+
81
+ subgraph Dockerization
82
+ deploy --> docker_build[Build Docker Images]
83
+ docker_build --> client_img[Client Image]
84
+ docker_build --> server_img[Server Image]
85
+ client_img --> push_registry[Push to GitHub Container Registry]
86
+ server_img --> push_registry
87
+ end
88
+
89
+ subgraph "VPS Deployment"
90
+ push_registry --> ssh_vps[SSH into VPS]
91
+ ssh_vps --> pull_images[Pull Latest Images]
92
+ pull_images --> compose[Create docker-compose.yml]
93
+ compose --> restart[Restart Containers]
94
+ restart --> nginx[Configure Nginx]
95
+ nginx --> ssl[Set Up SSL with Certbot]
96
+ end
97
+
98
+ classDef dev fill:#d4f1f9,stroke:#05a,stroke-width:2px
99
+ classDef ci fill:#ffe6cc,stroke:#d79b00,stroke-width:2px
100
+ classDef docker fill:#d5e8d4,stroke:#82b366,stroke-width:2px
101
+ classDef vps fill:#e1d5e7,stroke:#9673a6,stroke-width:2px
102
+
103
+ class Development dev
104
+ class "CI/CD Pipeline" ci
105
+ class Dockerization docker
106
+ class "VPS Deployment" vps
107
+ ```
59
108
60
109
## Docker Implementation
61
110
@@ -98,11 +147,10 @@ COPY packages/server .
98
147
RUN pnpm build
99
148
100
149
# Runtime images...
101
- ```
150
+ ````
102
151
103
152
</details >
104
153
105
-
106
154
## CI/CD Pipeline (GitHub Actions)
107
155
108
156
Triggered on pushes to ` main ` and on pull requests:
@@ -158,15 +206,13 @@ jobs:
158
206
159
207
</details>
160
208
161
-
162
209
## Testing Strategy
163
210
164
211
- **Jest** for unit & integration tests (both client & server)
165
212
- **Playwright** for cross-browser end-to-end tests
166
213
- **Stress testing** script to validate performance under load
167
214
- All tests run in CI before deployment
168
215
169
-
170
216
## Container Orchestration
171
217
172
218
- **Docker Compose** defines services:
@@ -176,39 +222,34 @@ jobs:
176
222
- Resource limits : 512 MB memory for the server
177
223
- Restart policy : ` unless-stopped`
178
224
179
-
180
225
# # Monitoring and Observability
181
226
182
227
- **OpenTelemetry** integrated for distributed tracing
183
228
- ` /api/health` endpoint for liveness checks
184
229
- **Morgan** middleware for HTTP request logging
185
230
- Stress test hooks to ensure observability under load
186
231
187
-
188
232
# # Dependency Management
189
233
190
234
- **PNPM** ensures disk-efficient, fast installs
191
235
- **Dependabot** configured for weekly dependency and action updates
192
236
- Separate schedules for updating npm packages vs. GitHub Actions
193
237
- **Husky** + **lint-staged** to enforce code quality on commits
194
238
195
-
196
239
# # Performance Optimizations
197
240
198
241
- Debounced Socket.IO broadcasts to reduce noise
199
242
- Explicit cleanup of timers & subscriptions in server to avoid leaks
200
243
- Docker layer caching optimizations in the build
201
244
- **Tailwind CSS v4** with Vite for on-demand styles
202
245
203
-
204
246
# # Security Considerations
205
247
206
248
- **CORS** properly scoped in production
207
249
- Secrets managed via environment variables (no hard-coded creds)
208
250
- Production builds minified & stripped of dev tooling
209
251
- Regular dependency updates via Dependabot
210
252
211
-
212
253
# # Deployment Process
213
254
214
255
1. Merge code into `main`
@@ -244,7 +285,6 @@ The deployment is configured to work with the domain `hackops.dracodev.me`. Make
244
285
245
286
- Create an A record for `hackops.dracodev.me` pointing to your VPS IP address
246
287
247
-
248
288
# # Configuration Files
249
289
250
290
- `docker-compose.yml` : service definitions & orchestration
@@ -255,7 +295,6 @@ The deployment is configured to work with the domain `hackops.dracodev.me`. Make
255
295
- `.npmrc` : PNPM settings & registry
256
296
- `.gitignore` : excludes logs, `node_modules`, build artifacts
257
297
258
-
259
298
# # Environment Variables
260
299
261
300
- ` NODE_ENV` (production/development)
@@ -264,37 +303,32 @@ The deployment is configured to work with the domain `hackops.dracodev.me`. Make
264
303
- ` DISABLE_TRACING` (toggle OpenTelemetry)
265
304
- ` STRESS_TEST` (enable performance tests)
266
305
267
-
268
306
# # Network Configuration
269
307
270
308
- Client exposed on `3000`
271
309
- Server exposed on `3001`
272
310
- Client ↔ Server communication via REST & WebSockets
273
311
- `CORS` patterns : permissive in dev, locked-down in prod
274
312
275
-
276
313
# # Resource Management
277
314
278
315
- Server container capped at **512 MB** RAM
279
316
- Only production deps in final Docker layers
280
317
- Alpine base images for minimal footprint
281
318
282
-
283
319
# # Scaling Considerations
284
320
285
321
- Real-time events via **Socket.IO** (Redis adapter required for multi-instance)
286
322
- In-memory data store is ephemeral—swap for a persistent DB in prod
287
323
- Health checks to auto-recover unhealthy containers
288
324
- Defined resource limits for predictable performance
289
325
290
-
291
326
# # Technical Debt & Known Issues
292
327
293
328
- Tracing module temporarily disabled (commented out)
294
329
- Uses in-memory store—no database persistence
295
330
- No authentication/authorization implemented
296
331
297
-
298
332
# # Commands
299
333
300
334
# ## Local Development
@@ -315,4 +349,3 @@ docker-compose down # Stop containers
315
349
docker pull [image] # Pull latest image
316
350
docker logs [container] # Inspect logs
317
351
` ` `
318
-
0 commit comments