Enterprise Architecture
9-pillar technical blueprint: observability, API governance, resilience, security, data management, testing, and more.
SlashAI
Cross-product AI agent platform
The AI layer across the platform — 315 tools, answering from your own product data.
NestJS 11RedisDeepSeekMiniMaxTarget: 5/5 maturity across all 9 pillars for every served repo. (The estate is three foundation services — SSO, Subscription, SlashAI — plus separate product sites,
DEC-0225. A repo is not a product.) Status: Phase 1 (Quick wins) implemented. Phase 2-4 in roadmap.
Goal: See, understand, debug everything in production.
- ✅ Structured logging:
pinoviaAppLoggerModulein backend-core- JSON output in production, pretty in development
- Auto-redacts auth headers, passwords, tokens, cookies
- Request ID correlation across logs
- ✅ Metrics:
PrometheusviaMetricsModulein backend-core- Pre-registered:
slashhub_http_requests_total,slashhub_http_request_duration_seconds,slashhub_circuit_breaker_state,slashhub_business_events_total - Endpoint:
GET /metrics - Grafana dashboards recommended
- Pre-registered:
- ⚠️ Tracing: OpenTelemetry — Phase 2
Apps → logs/metrics → [Loki / Prometheus / DataDog / Grafana Cloud]
Goal: Consistent API contract across all products.
- Prefix:
/api/v1/{resource} - Errors:
{ success: false, error: { code, message }, meta: { requestId, timestamp } } - Success:
{ success: true, data, meta: { requestId, timestamp } } - Pagination:
{ data, hasMore, nextCursor } - Docs: Swagger UI at
/api/docs
Goal: Survive dependency failures without cascading.
- Retry:
retryWithBackoff({ maxAttempts, baseDelayMs, factor, jitter, shouldRetry }) - Circuit Breaker:
new CircuitBreaker({ failureThreshold, resetTimeoutMs }) - Timeout: 30s default via
TimeoutInterceptor - Graceful shutdown: SIGTERM handlers
- Health checks:
/v1/health(liveness) +/v1/health/ready(readiness)
Goal: Defense in depth, defense by default.
- Helmet: HTTP headers (CSP, HSTS, X-Frame-Options)
- CORS: Whitelist-based via
CORS_ORIGINenv var (seedocs/product/architecture/domains.md) - Rate limiting: 3-tier via
@nestjs/throttler(10/s, 50/10s, 200/60s) - CSRF: Double-submit cookie via
CsrfModule;@SkipCsrf()for webhooks - Auth:
FirebaseAuthGuardfor Firebase ID tokens - Authz:
RolesGuard+@Roles('admin', 'manager') - Input validation:
ZodValidationPipe - Secret guard: CI blocks committed
.env*and service-account JSON - Audit trail: All security events logged
Goal: Data integrity, recovery, compliance.
- Firestore backups:
scripts/firestore-backup.sh <project> <bucket> [retention]- Automated via
gcloud firestore exportto GCS - Retention-based pruning
- Automated via
- Migrations: CLI scripts with
--applyflag (TimePlate pattern) - Audit trail: Standardized schema in
auditLogscollection - TTL policies: Available on Firestore collections
Goal: Confidence to deploy, fast feedback.
- Pre-commit (Husky): ESLint + Prettier on staged files
- CI: lint → typecheck → test (≥70% coverage) → build
- Secret guard: Block committed secrets
- Backend-core sync check:
make check-sync
| Layer | Lines | Functions | Branches |
|---|---|---|---|
| Backend services | 80% | 80% | 70% |
| Frontend components | 70% | 70% | 60% |
| Shared packages | 80% | 80% | 70% |
Goal: Predictable, repeatable, recoverable.
- Environments: dev → staging → production per product
- Health check gate: Railway deploy waits for
/v1/healthto respond - Graceful shutdown: SIGTERM → drain → exit (no dropped connections)
- Rollback: Railway/Vercel one-click rollback to previous deployment
- Zero-downtime: Multi-instance with rolling deploys
Goal: Fast, resilient, accessible.
- ErrorBoundary: At app root + critical feature boundaries
- Loading states:
loading.tsxfor routes, Suspense for components - Type safety: TypeScript strict + Zod for runtime
- Performance: Bundle budget 300KB warn / 500KB error
- Observability: Sentry for error tracking
- Accessibility: WCAG 2.1 AA target
Goal: Easy to onboard, easy to ship.
- Onboarding:
docs/CONTRIBUTING.md,.nvmrc,docker-compose.dev.yml - PR template:
.github/PULL_REQUEST_TEMPLATE.md - Conventional commits: Enforced via PR review
- Local dev:
pnpm dev,make sync,make check - Makefile: 36+ per-product targets + 6 cross-product targets
DEVELOPER
│
▼
┌──────────────────┐
│ GitHub │
│ + Husky (local) │
└────────┬─────────┘
│
▼ PR + CI
┌──────────────────────────────────────────┐
│ GitHub Actions │
├──────────────────────────────────────────┤
│ 1. secret-guard (block .env, JSON) │
│ 2. lint (eslint) │
│ 3. typecheck (tsc) │
│ 4. test (vitest ≥70% cov) │
│ 5. build (turbo) │
│ 6. backend-core sync check │
└──────────────────┬───────────────────────┘
│
┌───────────────────────────┼───────────────────────────┐
│ │ │
┌─────▼─────┐ ┌──────▼──────┐ ┌──────▼──────┐
│ Vercel │ │ Railway │ │ Firebase │
│ (FE) │ │ (BE) │ │ (data) │
│ .hk │ │ .space │ │ (Firestore │
│ │ │ │ │ Auth, │
│ Next.js │ │ NestJS │ │ Storage) │
│ + Sentry │ │ + pino │ │ │
│ + Vercel │ │ + Prometheus │ │
│ Insights│ │ + Redis │ │ │
└───────────┘ └──────┬──────┘ └──────┬──────┘
│ │
▼ ▼
┌─────────────────────────────────────────┐
│ Observability │
├─────────────────────────────────────────┤
│ Grafana / DataDog / Sentry / Loki │
└─────────────────────────────────────────┘
- Add pino structured logging to backend-core
- Add retry + circuit breaker utilities
- Add Prometheus metrics module
- Add CSRF module
- Add Throttler module
- Add AuditTrail module
- Add FeatureFlags module
- Add EnvValidator
- Add secret guard to all CI workflows
- Add Vitest to the product APIs and web apps
- Add ErrorBoundary to slashbooks/web + slashone/web
- Add Firestore backup script
- Add docker-compose.dev.yml template
- Add PR template +
docs/CONTRIBUTING.md - Sync enhanced backend-core to every product that consumes it
- OpenTelemetry instrumentation in backend-core
- Standardize all NestJS backends to use AppLoggerModule (replace NestJS Logger)
- Standardize API versioning to /api/v1
- Add Swagger/OpenAPI to all NestJS backends (currently only SlashBooks)
- Add HTTP-Retry-After headers to throttler responses
- Add CSRF token endpoint (GET /csrf) for frontend
- Add OpenTelemetry traces to all NestJS backends
- Standardize audit trail schema across all products
- Add staging environment to Railway for each product
- Add SonarQube to CI (or CodeClimate as lighter alternative)
- Add E2E smoke tests to all backends
- Add Firestore rules CI to all products with Firestore
- Add graceful shutdown to all backends
- Performance/load testing (k6)
- Bundle size budgets in CI for all frontends
- Zero-downtime deployment verification
- Conventional commits enforcement
- Documentation: API docs (Swagger), runbooks, on-call
# Quality checks
make check # All 6 products: lint + typecheck + sync-check
# Sync backend-core
make sync # Push canonical → all 6
make check-sync # Verify drift
# Per-product
make <product>-lint
make <product>-build
make <product>-test
# Local dev
docker compose -f shared-infra/docker-compose.dev.yml up -d
# Backups
bash scripts/firestore-backup.sh <project> <bucket> [retention-days]
# Smoke test
bash scripts/smoke-test.sh <api-url> [auth-token]
Last reviewed: 2026-11-17 — estate statement moved to DEC-0225 (foundation services + separate product sites); the Phase 1 checklist no longer names an archived repo; nothing else in this file was re-measured, so the maturity claims below remain at their 2026-06-27 evidence.
Prior: 2026-06-27 — standardization checks + 9 enterprise modules pass.
Continue reading
Ecosystem
7-product portfolio + 3-layer positioning + relationship map. The strategic view of what each product is, who it serves, and how they relate.
~8 min read
Use Cases
Concrete, persona-driven scenarios for every product. Freelancer / OPC / SME personas with end-to-end flows.
~25 min read
System Layout
Multi-monorepo shape, standardized tooling, deployment topology, and the 9-pillar enterprise blueprint.
~10 min read