Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit b60a526

Browse files
committed
Mermaid in README
1 parent ba1da03 commit b60a526

File tree

2 files changed

+99
-18
lines changed

2 files changed

+99
-18
lines changed

README.md

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ HackOps is a competitive hackathon where teams showcase their DevOps expertise b
3939
- Runtime orchestration via **Docker Compose** on a VPS
4040
- Observability with **OpenTelemetry** and structured logging
4141

42-
4342
## Monorepo Structure
4443

4544
```
@@ -56,6 +55,56 @@ HackOps is a competitive hackathon where teams showcase their DevOps expertise b
5655
- **PNPM workspaces** ensure efficient installs and consistent deps
5756
- **Strict TypeScript** settings guarantee type safety across boundaries
5857

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+
```
59108
60109
## Docker Implementation
61110
@@ -98,11 +147,10 @@ COPY packages/server .
98147
RUN pnpm build
99148
100149
# Runtime images...
101-
```
150+
````
102151

103152
</details>
104153

105-
106154
## CI/CD Pipeline (GitHub Actions)
107155

108156
Triggered on pushes to `main` and on pull requests:
@@ -158,15 +206,13 @@ jobs:
158206
159207
</details>
160208
161-
162209
## Testing Strategy
163210
164211
- **Jest** for unit & integration tests (both client & server)
165212
- **Playwright** for cross-browser end-to-end tests
166213
- **Stress testing** script to validate performance under load
167214
- All tests run in CI before deployment
168215
169-
170216
## Container Orchestration
171217
172218
- **Docker Compose** defines services:
@@ -176,39 +222,34 @@ jobs:
176222
- Resource limits: 512 MB memory for the server
177223
- Restart policy: `unless-stopped`
178224

179-
180225
## Monitoring and Observability
181226

182227
- **OpenTelemetry** integrated for distributed tracing
183228
- `/api/health` endpoint for liveness checks
184229
- **Morgan** middleware for HTTP request logging
185230
- Stress test hooks to ensure observability under load
186231

187-
188232
## Dependency Management
189233

190234
- **PNPM** ensures disk-efficient, fast installs
191235
- **Dependabot** configured for weekly dependency and action updates
192236
- Separate schedules for updating npm packages vs. GitHub Actions
193237
- **Husky** + **lint-staged** to enforce code quality on commits
194238

195-
196239
## Performance Optimizations
197240

198241
- Debounced Socket.IO broadcasts to reduce noise
199242
- Explicit cleanup of timers & subscriptions in server to avoid leaks
200243
- Docker layer caching optimizations in the build
201244
- **Tailwind CSS v4** with Vite for on-demand styles
202245

203-
204246
## Security Considerations
205247

206248
- **CORS** properly scoped in production
207249
- Secrets managed via environment variables (no hard-coded creds)
208250
- Production builds minified & stripped of dev tooling
209251
- Regular dependency updates via Dependabot
210252

211-
212253
## Deployment Process
213254

214255
1. Merge code into `main`
@@ -244,7 +285,6 @@ The deployment is configured to work with the domain `hackops.dracodev.me`. Make
244285

245286
- Create an A record for `hackops.dracodev.me` pointing to your VPS IP address
246287

247-
248288
## Configuration Files
249289

250290
- `docker-compose.yml`: service definitions & orchestration
@@ -255,7 +295,6 @@ The deployment is configured to work with the domain `hackops.dracodev.me`. Make
255295
- `.npmrc`: PNPM settings & registry
256296
- `.gitignore`: excludes logs, `node_modules`, build artifacts
257297

258-
259298
## Environment Variables
260299

261300
- `NODE_ENV` (production/development)
@@ -264,37 +303,32 @@ The deployment is configured to work with the domain `hackops.dracodev.me`. Make
264303
- `DISABLE_TRACING` (toggle OpenTelemetry)
265304
- `STRESS_TEST` (enable performance tests)
266305

267-
268306
## Network Configuration
269307

270308
- Client exposed on `3000`
271309
- Server exposed on `3001`
272310
- Client ↔ Server communication via REST & WebSockets
273311
- `CORS` patterns: permissive in dev, locked-down in prod
274312

275-
276313
## Resource Management
277314

278315
- Server container capped at **512 MB** RAM
279316
- Only production deps in final Docker layers
280317
- Alpine base images for minimal footprint
281318

282-
283319
## Scaling Considerations
284320

285321
- Real-time events via **Socket.IO** (Redis adapter required for multi-instance)
286322
- In-memory data store is ephemeral—swap for a persistent DB in prod
287323
- Health checks to auto-recover unhealthy containers
288324
- Defined resource limits for predictable performance
289325

290-
291326
## Technical Debt & Known Issues
292327

293328
- Tracing module temporarily disabled (commented out)
294329
- Uses in-memory store—no database persistence
295330
- No authentication/authorization implemented
296331

297-
298332
## Commands
299333

300334
### Local Development
@@ -315,4 +349,3 @@ docker-compose down # Stop containers
315349
docker pull [image] # Pull latest image
316350
docker logs [container] # Inspect logs
317351
```
318-

devops-flow.mmd

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
flowchart TD
2+
subgraph Development
3+
dev[Developer Codes] --> commit[Commit to GitHub]
4+
commit --> pr[Create Pull Request]
5+
end
6+
7+
subgraph "CI/CD Pipeline"
8+
pr --> validate[GitHub Actions: Validate Job]
9+
validate --> tests[Run Tests]
10+
tests --> build[Build Application]
11+
12+
subgraph Testing
13+
tests --> lint[ESLint]
14+
tests --> typecheck[TypeScript Check]
15+
tests --> unittest[Jest Unit Tests]
16+
tests --> e2e[Playwright E2E Tests]
17+
end
18+
19+
build --> merge[Merge to Main]
20+
merge --> deploy[GitHub Actions: Deploy Job]
21+
end
22+
23+
subgraph Dockerization
24+
deploy --> docker_build[Build Docker Images]
25+
docker_build --> client_img[Client Image]
26+
docker_build --> server_img[Server Image]
27+
client_img --> push_registry[Push to GitHub Container Registry]
28+
server_img --> push_registry
29+
end
30+
31+
subgraph "VPS Deployment"
32+
push_registry --> ssh_vps[SSH into VPS]
33+
ssh_vps --> pull_images[Pull Latest Images]
34+
pull_images --> compose[Create docker-compose.yml]
35+
compose --> restart[Restart Containers]
36+
restart --> nginx[Configure Nginx]
37+
nginx --> ssl[Set Up SSL with Certbot]
38+
end
39+
40+
classDef dev fill:#d4f1f9,stroke:#05a,stroke-width:2px
41+
classDef ci fill:#ffe6cc,stroke:#d79b00,stroke-width:2px
42+
classDef docker fill:#d5e8d4,stroke:#82b366,stroke-width:2px
43+
classDef vps fill:#e1d5e7,stroke:#9673a6,stroke-width:2px
44+
45+
class Development dev
46+
class "CI/CD Pipeline" ci
47+
class Dockerization docker
48+
class "VPS Deployment" vps

0 commit comments

Comments
 (0)