Skip to content

Commit 86152cc

Browse files
Merge pull request #23 from beginwebdev2002/feat/backend-arch-expansion-9281158822798433561
feat(backend): Autonomous Backend Documentation Evolution
2 parents 4ffd2aa + 742c12b commit 86152cc

19 files changed

Lines changed: 554 additions & 2 deletions

backend/expressjs/architecture.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for Express.js within the backend domain.
3+
technology: Express.js
4+
domain: backend
5+
level: Senior/Architect
6+
complexity: Advanced
7+
topic: Express.js Architecture
8+
vibe_coding_ready: true
9+
version: "4.x / 5.x"
10+
tags: [best-practices, clean-code, expressjs, vibe-coding, cursor-rules, javascript, typescript, software-architecture, system-design, mvc, production-ready, programming-standards, node-js, design-patterns, scalable-code, windsurf-rules, ai-coding, enterprise-patterns, backend]
11+
ai_role: Senior Express.js Architecture Expert
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🏗️ Express.js Architecture Best Practices

backend/expressjs/readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,41 @@ last_updated: 2026-03-23
2929
3030
---
3131

32+
33+
## 🔄 Architecture Data Flow
34+
35+
```mermaid
36+
sequenceDiagram
37+
participant Client
38+
participant Router as Express Router
39+
participant AuthMW as Auth Middleware
40+
participant ValMW as Validation Middleware
41+
participant Controller as Controller
42+
participant Service as Service Layer
43+
participant ErrorMW as Global Error Handler
44+
45+
Client->>Router: HTTP Request
46+
Router->>AuthMW: Authenticate
47+
AuthMW-->>Router: Authorized
48+
Router->>ValMW: Validate Request
49+
ValMW-->>Router: Validated
50+
Router->>Controller: Route Request
51+
Controller->>Service: Execute Logic
52+
53+
alt Success
54+
Service-->>Controller: Return Result
55+
Controller-->>Client: HTTP Response
56+
else Failure
57+
Service-->>ErrorMW: Throw Error
58+
ErrorMW-->>Client: Standardized Error Response
59+
end
60+
```
61+
62+
## 📚 Specialized Documentation
63+
- [architecture.md](./architecture.md)
64+
- [security-best-practices.md](./security-best-practices.md)
65+
66+
---
3267
## 1. Controller / Route Decoupling
3368
### ❌ Bad Practice
3469
```javascript
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for Express.js Security within the backend domain.
3+
technology: Express.js
4+
domain: backend
5+
level: Senior/Architect
6+
complexity: Advanced
7+
topic: Express.js Security
8+
vibe_coding_ready: true
9+
version: "4.x / 5.x"
10+
tags: [best-practices, clean-code, security-patterns, vibe-coding, cursor-rules, expressjs, software-architecture, system-design, solid-principles, production-ready, programming-standards, node-js, security, scalable-code, windsurf-rules, ai-coding, enterprise-patterns]
11+
ai_role: Senior Express.js Security Expert
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🔒 Express.js Security Best Practices
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for Microservices API Design within the backend domain.
3+
technology: Microservices
4+
domain: backend
5+
level: Architect
6+
complexity: Architect
7+
topic: Microservices API Design
8+
vibe_coding_ready: true
9+
version: Agnostic
10+
tags: [best-practices, clean-code, architecture-patterns, vibe-coding, microservices, distributed-systems, system-design, solid-principles, production-ready, scalable-code]
11+
ai_role: Senior Microservices Architect
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🧩 Microservices API Design
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for Microservices Architecture within the backend domain.
3+
technology: Microservices
4+
domain: backend
5+
level: Architect
6+
complexity: Architect
7+
topic: Microservices Architecture
8+
vibe_coding_ready: true
9+
version: Agnostic
10+
tags: [best-practices, clean-code, architecture-patterns, vibe-coding, microservices, distributed-systems, system-design, solid-principles, production-ready, scalable-code]
11+
ai_role: Senior Microservices Architect
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🧩 Microservices Architecture

backend/microservices/readme.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for Microservices within the backend domain.
3+
technology: Microservices
4+
domain: backend
5+
level: Architect
6+
complexity: Architect
7+
topic: Microservices
8+
vibe_coding_ready: true
9+
version: Agnostic
10+
tags: [best-practices, clean-code, architecture-patterns, vibe-coding, microservices, distributed-systems, system-design, solid-principles, production-ready, scalable-code]
11+
ai_role: Senior Microservices Architect
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
<div align="center">
17+
<img src="https://raw.githubusercontent.com/tandpfun/skill-icons/main/icons/Docker.svg" width="100" alt="Microservices Logo">
18+
19+
# 🧩 Microservices Production-Ready Best Practices
20+
</div>
21+
22+
---
23+
24+
This document establishes **best practices** for designing and maintaining a Microservices architecture. These constraints guarantee a scalable, highly secure, and clean system suitable for an enterprise-level, production-ready backend.
25+
26+
# ⚙️ Context & Scope
27+
- **Primary Goal:** Provide an uncompromising set of rules and architectural constraints for distributed system environments.
28+
- **Target Tooling:** AI-agents (Cursor, Windsurf, Copilot, Antigravity) and System Architects.
29+
- **Tech Stack Version:** Agnostic
30+
31+
> [!IMPORTANT]
32+
> **Architectural Standard (Contract):** Ensure loose coupling and high cohesion. Each microservice must own its domain data. Use asynchronous messaging (e.g., Kafka, RabbitMQ) for inter-service communication to prevent cascading failures.
33+
34+
---
35+
36+
## 🏗️ 1. Architecture & Design
37+
38+
### Domain-Driven Design (DDD)
39+
- Define clear Bounded Contexts for every service to avoid spaghetti dependencies.
40+
- Implement the API Gateway pattern to route external requests to internal microservices, handling cross-cutting concerns (auth, rate limiting).
41+
42+
### 🔄 Data Flow Lifecycle
43+
44+
```mermaid
45+
sequenceDiagram
46+
participant Client
47+
participant Gateway as API Gateway
48+
participant Auth as Auth Service
49+
participant User as User Service
50+
participant Msg as Message Broker (Kafka)
51+
participant Notification as Notification Service
52+
53+
Client->>Gateway: POST /users (Create User)
54+
Gateway->>Auth: Validate Token
55+
Auth-->>Gateway: Token Valid
56+
Gateway->>User: Create User Request
57+
User-->>User: Persist User to DB
58+
User->>Msg: Publish "UserCreated" Event
59+
User-->>Gateway: Return 201 Created
60+
Gateway-->>Client: Respond with Success
61+
62+
Msg->>Notification: Consume "UserCreated" Event
63+
Notification-->>Notification: Send Welcome Email
64+
```
65+
66+
## 🔒 2. Security Best Practices
67+
68+
### Service-to-Service Authentication
69+
- Implement Zero Trust architecture. Internal services must authenticate each other using mTLS (Mutual TLS) or signed JWTs.
70+
- Secrets must never be hardcoded. Utilize a secret manager (HashiCorp Vault, AWS Secrets Manager).
71+
72+
### Data Isolation
73+
- Enforce "Database per Service" pattern. Services must never share a single database to ensure independent scaling and deployment.
74+
75+
## 🚀 3. Reliability Optimization
76+
77+
### Resilience Patterns
78+
- Implement Circuit Breakers (e.g., resilience4j) to fail fast and recover when a dependent service goes down.
79+
- Implement retries with exponential backoff for transient network errors.
80+
- Ensure Idempotency for critical operations to handle duplicated requests gracefully.
81+
82+
### Observability
83+
- Distributed Tracing is mandatory (OpenTelemetry). All requests must pass a Correlation ID across service boundaries.
84+
- Centralized Logging (ELK, Datadog) is required for debugging complex distributed issues.
85+
86+
## 📚 Specialized Documentation
87+
- [architecture.md](./architecture.md)
88+
- [security-best-practices.md](./security-best-practices.md)
89+
- [api-design.md](./api-design.md)
90+
91+
---
92+
93+
[Back to Top](#)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for Microservices Security within the backend domain.
3+
technology: Microservices
4+
domain: backend
5+
level: Architect
6+
complexity: Architect
7+
topic: Microservices Security
8+
vibe_coding_ready: true
9+
version: Agnostic
10+
tags: [best-practices, clean-code, architecture-patterns, vibe-coding, microservices, distributed-systems, system-design, solid-principles, production-ready, scalable-code]
11+
ai_role: Senior Microservices Architect
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🧩 Microservices Security Best Practices

backend/nestjs/architecture.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for NestJS within the backend domain.
3+
technology: NestJS
4+
domain: backend
5+
level: Senior/Architect
6+
complexity: Advanced
7+
topic: NestJS Architecture
8+
vibe_coding_ready: true
9+
version: "11+"
10+
tags: [best-practices, clean-code, architecture-patterns, vibe-coding, cursor-rules, typescript, software-architecture, system-design, solid-principles, production-ready, programming-standards, react-best-practices, node-js, design-patterns, scalable-code, windsurf-rules, ai-coding, fsd, ddd, enterprise-patterns]
11+
ai_role: Senior NestJS Architecture Expert
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🏗️ NestJS 11+ Architecture Best Practices

backend/nestjs/readme.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Vibe coding guidelines and architectural constraints for NestJS wit
33
technology: NestJS
44
domain: backend
55
level: Senior/Architect
6-
version: "10+"
6+
version: "11+"
77
tags: [best-practices, clean-code, architecture-patterns, vibe-coding, cursor-rules, typescript, software-architecture, system-design, solid-principles, production-ready, programming-standards, react-best-practices, node-js, design-patterns, scalable-code, windsurf-rules, ai-coding, fsd, ddd, enterprise-patterns]
88
ai_role: Senior NestJS Architecture Expert
99
last_updated: 2026-03-23
@@ -22,13 +22,46 @@ last_updated: 2026-03-23
2222
## 🎯 Context & Scope
2323
- **Primary Goal:** Предоставить строгие архитектурные правила и 30 паттернов разработки на NestJS.
2424
- **Target Tooling:** AI-агенты (Cursor, Windsurf, Copilot) и Senior-разработчики.
25-
- **Tech Stack Version:** NestJS 10+
25+
- **Tech Stack Version:** NestJS 11+
2626

2727
> [!IMPORTANT]
2828
> **Архитектурный стандарт (Contract):** Используйте строгую типизацию TypeScript, DI (Dependency Injection) и модульную структуру. Бизнес-логика должна быть изолирована от деталей HTTP-уровня и баз данных.
2929
3030
---
3131

32+
33+
## 🔄 Architecture Data Flow
34+
35+
```mermaid
36+
sequenceDiagram
37+
participant Client
38+
participant Controller as Controller (Thin)
39+
participant Pipe as ValidationPipe (Global)
40+
participant Guard as AuthGuard
41+
participant Service as Service (Fat)
42+
participant Repo as Repository (Port)
43+
participant DB as Database
44+
45+
Client->>Controller: HTTP Request
46+
Controller->>Guard: Check Authorization
47+
Guard-->>Controller: Authorized
48+
Controller->>Pipe: Validate DTO
49+
Pipe-->>Controller: Validated
50+
Controller->>Service: Execute Business Logic
51+
Service->>Repo: Fetch/Save Data
52+
Repo->>DB: Query
53+
DB-->>Repo: Data
54+
Repo-->>Service: Domain Entity
55+
Service-->>Controller: Result (mapped to DTO)
56+
Controller-->>Client: HTTP Response
57+
```
58+
59+
60+
## 📚 Specialized Documentation
61+
- [architecture.md](./architecture.md)
62+
- [security-best-practices.md](./security-best-practices.md)
63+
64+
---
3265
### 🚨 1. Clean Architecture Modules (Изоляция логики)
3366
#### ❌ Bad Practice
3467
```typescript
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Vibe coding guidelines and architectural constraints for NestJS Security within the backend domain.
3+
technology: NestJS
4+
domain: backend
5+
level: Senior/Architect
6+
complexity: Advanced
7+
topic: NestJS Security
8+
vibe_coding_ready: true
9+
version: "11+"
10+
tags: [best-practices, clean-code, security-patterns, vibe-coding, cursor-rules, typescript, software-architecture, system-design, solid-principles, production-ready, programming-standards, node-js, security, scalable-code, windsurf-rules, ai-coding, enterprise-patterns]
11+
ai_role: Senior NestJS Security Expert
12+
last_updated: 2026-03-27
13+
last_evolution: 2026-03-27
14+
---
15+
16+
# 🔒 NestJS 11+ Security Best Practices

0 commit comments

Comments
 (0)