apps/box-app-api, apps/box-mgnt-api, apps/box-stats-apilibs/common, libs/core, libs/dbprisma/mysql, prisma/mongo, prisma/mongo-statsdocs, dist, logs, build.log, structures.txtapps/box-mgnt-api/src/main.ts)apps/box-app-api/src/main.ts)apps/box-stats-api/src/main.ts)NODE_ENV !== 'production')apps/box-mgnt-api/src/mgnt-backend/feature/oss/oss.module.ts but is commented out in apps/box-mgnt-api/src/mgnt-backend/feature/feature.module.tsprisma/mysql), MongoDB (prisma/mongo), MongoDB stats (prisma/mongo-stats)@prisma/client), services in libs/db/src/prisma/*ioredis (libs/db/src/redis/*), cache-manager via cache-manager-ioredis-yet in apps/box-app-api/src/redis/redis-cache.module.tsamqplib (apps/box-app-api/src/rabbitmq/*, apps/box-stats-api/src/feature/rabbitmq/*)apps/box-mgnt-api/src/mgnt-backend/core/auth/auth.module.ts), LocalAuthGuard for login, RateLimitGuard on auth endpoints, MFA flow in auth service/guardsMfaGuard exists only in libs/common/src/guards/mfa.guard.ts with no referenceslibs/common/src/common.module.ts and apps/box-app-api/src/app.module.tsAllExceptionsFilter exists only in libs/common/src/filters/all-exceptions.filter.tsnestjs-pino + Correlation/Logging/OperationLog/Response interceptors in libs/common/src/common.module.tsmain.tsConfigModule with env validation (apps/box-mgnt-api/src/config/env.validation.ts)ConfigModule with .env.app + .envConfigModule with .env.stats + .env/api/v1)
/auth/login/ads/list, /ads/click, /ads/impression/video/recommended, /video/category/:channelId/:categoryId/latest, /video/categories-with-tags, /video/list, /video/search-by-tag, /video/click/recommend/video/:videoId, /recommend/ad/:adId/api/v1/recommendation/videos/:videoId/similar, /api/v1/recommendation/ads/:adId/similar, /api/v1/recommendation/ads/:adId/similar-simple/homepage/sys-params/ad-types/stats/ad/click, /stats/video/click, /stats/ad/impression/health/rabbitmq/fallback/replay, /rabbitmq/fallback/status, /rabbitmq/fallback/queue-size, /api/v1/internal/rabbitmq/status/api/v1)
/internal/stats/ingestion, /internal/stats/aggregate/ads, /internal/stats/aggregate/videos/internal/stats/debug/redis/videos/top, /internal/stats/debug/redis/ads/top/api/v1, routed under /mgnt)
/api/v1/mgnt/auth/login, /login2fa, /logout, /2fa/generate, /2fa/setup, /2fa/enable, /permission, /abilities/api/v1/mgnt/users (CRUD + list/search), /me, /me/password, /me/personal-info, /role/:roleId, /admin-remove-2fa, /admin-set-2fa, /reset-password/api/v1/mgnt/roles (list/create/update/delete/permissions)/api/v1/mgnt/menus (list/tree/create/update/delete)/api/v1/mgnt/login-logs, /operation-logs, /quota-logs/api/v1/mgnt/system-param (list/create/update/get)/api/v1/mgnt/ads (list/get/create/update/delete), /ads/:id/cover, /ads/modules/list/api/v1/mgnt/ads-legacy/*/api/v1/mgnt/categories/api/v1/mgnt/channels/api/v1/mgnt/tags/api/v1/mgnt/video-media (list/create/update/status/sync/etc.)/api/v1/mgnt/sync-videomedia, /api/v1/mgnt/provider-video-sync/api/v1/mgnt/s3/* (policy, signed URL/image/video helpers)/api/v1/mgnt/health/redis/api/v1/mgnt/cache/*, /mgnt-debug/cache-sync/*, /api/v1/mgnt/admin/cache/video/*/api/v1/mgnt/dev/cache/*, /api/v1/mgnt/dev/video/*dev:mgnt, dev:app, dev:statsbuild:mgnt, build:app, build:statsstart:mgnt, start:app, start:statstypecheck, typecheck:watch, lint, lint:fix/api/v1 on all apps; management APIs additionally under /mgnt routerwhitelist and transform enabled (all apps)APP_CORS_ORIGIN) with defaults and method restrictionsNODE_ENVapps/box-stats-api/src/feature/stats-events/stats-aggregation.service.ts: TODO for tag-based ad statsapps/box-mgnt-api/src/mgnt-backend/feature/video-media/video-media.controller.ts: TODO for delete video mediaapps/box-mgnt-api/src/cache-sync/cache-sync.service.ts: TODO for HOME/CHANNEL/TRENDING list rebuildlibs/core/src/cache/video/list/video-list-cache.builder.ts: multiple TODOs for refactor after schema changeapps/box-app-api/src/feature/recommendation/recommendation.controller.ts and apps/box-app-api/src/rabbitmq/rabbitmq-status.controller.ts hardcode api/v1 while apps/box-app-api/src/main.ts also sets a global api/v1 prefix; confirm whether routes are intended to be /api/v1/api/v1/... or just /api/v1/...GET /api/v1/video/recommended reads req.user but has no guard; confirm if another auth middleware populates req.user or if this is intended to be publicapps/box-stats-api/src/feature/stats-events/stats-internal.controller.ts exposes internal/debug endpoints without auth; confirm expected protection modelapps/box-app-api/src/feature/sys-params/sys-params.controller.ts constants, apps/box-app-api/src/feature/ads/ad.controller.ts ad URL, apps/box-mgnt-api/src/mgnt-backend/core/auth/auth.controller.ts OAuth routes) appear intentionally disabled; confirm whether they should stay disabled| Feature / Module | Status | Evidence in Code | Risk if Touched |
|---|---|---|---|
| box-mgnt-api app | PRODUCTION-READY | apps/box-mgnt-api/src/main.ts, apps/box-mgnt-api/src/app.module.ts, scripts dev:mgnt/start:mgnt in package.json |
High: core admin backend |
| Mgnt Core Auth (JWT/RBAC/2FA) | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/core/auth/auth.module.ts is imported via apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
High: login + permissions |
| Mgnt Users | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/core/user/user.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
High: admin user mgmt |
| Mgnt Roles | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/core/role/role.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
High: RBAC |
| Mgnt Menus | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/core/menu/menu.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium: admin UI navigation |
| Mgnt Logs (login/operation/quota) | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/core/logging/* wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium: audit trails |
| Mgnt Ads management | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/ads/ads.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
High: ad CRUD |
| Mgnt Categories | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/category/category.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium: app taxonomy |
| Mgnt Channels | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/channel/channel.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium |
| Mgnt Tags | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/tag/tag.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium |
| Mgnt Video Media | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/video-media/video-media.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
High: video catalog |
| Mgnt System Params | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/system-params/system-params.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium |
| Mgnt Sync Video Media | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/sync-videomedia/sync-videomedia.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium: sync logic |
| Mgnt Provider Video Sync | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/provider-video-sync/provider-video-sync.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/feature/feature.module.ts |
Medium |
| Mgnt S3 endpoints | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/s3/s3.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Medium: upload/signing |
| Mgnt Health (Redis) | INTERNAL-ONLY | apps/box-mgnt-api/src/mgnt-backend/feature/health/health.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts |
Low: monitoring |
| Mgnt Cache Sync (admin/debug) | INTERNAL-ONLY | apps/box-mgnt-api/src/cache-sync/cache-sync.module.ts wired in apps/box-mgnt-api/src/app.module.ts |
Medium: cache integrity |
| Mgnt Dev Video Cache tools | INTERNAL-ONLY | apps/box-mgnt-api/src/dev/dev-video-cache.module.ts only imported when NODE_ENV !== 'production' in apps/box-mgnt-api/src/app.module.ts |
Medium: dev diagnostics |
| Mgnt ImageUpload service | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/image-upload/image-upload.module.ts imported by feature services (ads/video-media) |
Medium: media pipeline |
| Mgnt MgntHttpService | PRODUCTION-READY | apps/box-mgnt-api/src/mgnt-backend/feature/mgnt-http-service/mgnt-http-service.module.ts wired in apps/box-mgnt-api/src/mgnt-backend/feature/feature.module.ts |
Low |
| Mgnt OSS module | DEAD / UNUSED | apps/box-mgnt-api/src/mgnt-backend/feature/oss/oss.module.ts not imported (commented in apps/box-mgnt-api/src/mgnt-backend/feature/feature.module.ts) |
Low: unused |
| box-app-api app | PRODUCTION-READY | apps/box-app-api/src/main.ts, apps/box-app-api/src/app.module.ts, scripts dev:app/start:app in package.json |
High: public API |
| App Auth (JWT) | PRODUCTION-READY | apps/box-app-api/src/feature/auth/auth.module.ts imported in apps/box-app-api/src/app.module.ts |
High |
| App Ads API | PRODUCTION-READY | apps/box-app-api/src/feature/ads/ad.module.ts imported in apps/box-app-api/src/app.module.ts |
High |
| App Video API | PRODUCTION-READY | apps/box-app-api/src/feature/video/video.module.ts imported in apps/box-app-api/src/app.module.ts |
High |
| App Homepage API | PRODUCTION-READY | apps/box-app-api/src/feature/homepage/homepage.module.ts imported in apps/box-app-api/src/app.module.ts |
Medium |
| App Sys Params API | PRODUCTION-READY | apps/box-app-api/src/feature/sys-params/sys-params.module.ts imported in apps/box-app-api/src/app.module.ts |
Medium |
| App Recommendation API (public) | PRODUCTION-READY | apps/box-app-api/src/feature/recommendation/recommendation.module.ts imported in apps/box-app-api/src/app.module.ts |
Medium |
| App Stats Events publisher | PRODUCTION-READY | apps/box-app-api/src/feature/stats/stats.module.ts imported in apps/box-app-api/src/app.module.ts |
Medium |
| App Health endpoint | INTERNAL-ONLY | apps/box-app-api/src/health/health.module.ts imported in apps/box-app-api/src/app.module.ts |
Low |
| App RabbitMQ publisher + fallback | INTERNAL-ONLY | apps/box-app-api/src/rabbitmq/rabbitmq.module.ts imported in apps/box-app-api/src/app.module.ts |
Medium: event pipeline |
| App RabbitMQ status endpoint | INTERNAL-ONLY | env guard in apps/box-app-api/src/rabbitmq/rabbitmq-status.controller.ts |
Low |
| box-stats-api app | PRODUCTION-READY | apps/box-stats-api/src/main.ts, apps/box-stats-api/src/app.module.ts, scripts dev:stats/start:stats in package.json |
High: stats processing |
| Stats RabbitMQ consumer | PRODUCTION-READY | apps/box-stats-api/src/feature/rabbitmq/rabbitmq-consumer.module.ts imported in apps/box-stats-api/src/app.module.ts |
Medium |
| Stats aggregation scheduler | PRODUCTION-READY | apps/box-stats-api/src/feature/stats-events/stats-events.module.ts imported in apps/box-stats-api/src/app.module.ts |
Medium |
| Stats internal/debug endpoints | INTERNAL-ONLY | apps/box-stats-api/src/feature/stats-events/stats-internal.controller.ts |
Low |
| Shared Prisma services (MySQL/Mongo/MongoStats) | PRODUCTION-READY | libs/db/src/prisma/prisma.module.ts exported by libs/db/src/shared.module.ts used in mgnt/stats |
High: data access |
| Redis module/service | PRODUCTION-READY | libs/db/src/redis/redis.module.ts used in all apps |
High: cache/messaging |
| CommonModule interceptors/filters | PRODUCTION-READY | libs/common/src/common.module.ts imported in apps/box-mgnt-api/src/app.module.ts |
Medium: response/logging |
| AllExceptionsFilter | DEAD / UNUSED | libs/common/src/filters/all-exceptions.filter.ts no wiring found |
Low |
| MfaGuard | DEAD / UNUSED | libs/common/src/guards/mfa.guard.ts no usage |
Low |
box-mgnt-apipnpm dev:mgnt (nest start), or pnpm build:mgnt then pnpm start:mgnt (node dist/apps/box-mgnt-api/src/main.js)ConfigModule.forRoot uses .env.mgnt then .env in apps/box-mgnt-api/src/app.module.tsMYSQL_URL, MONGO_URL, JWT_SECRET, REDIS_HOST, REDIS_PORTMONGO_STATS_URL (Prisma MongoStats connects on init; schema expects env("MONGO_STATS_URL"))APP_HOST, HOST, APP_PORT/PORT, APP_CORS_ORIGIN, REDIS_PASSWORD, REDIS_DB, REDIS_KEY_PREFIX, REDIS_TLS, JWT_EXPIRES_IN_SECONDS, ENCRYPTION_KEYS3Service relies on AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_S3_REGION_NAME, AWS_STORAGE_BUCKET_NAME, optional AWS_S3_ENDPOINT_URLbox-app-apipnpm dev:app (uses dotenv -e .env.app -- nest start ...), or pnpm build:app then pnpm start:app (node dist/apps/box-app-api/src/main.js)ConfigModule.forRoot uses .env.app then .env in apps/box-app-api/src/app.module.ts (dev command also sets env)MONGO_URL, MONGO_STATS_URL (Prisma Mongo + MongoStats clients connect on init; schemas use env("MONGO_URL") and env("MONGO_STATS_URL"))REDIS_HOST defaults to 127.0.0.1, REDIS_PORT defaults to 6379)APP_HOST, HOST, APP_PORT/PORT, APP_CORS_ORIGIN, IMAGE_ROOT_PATH (default /data/box-images), JWT_SECRET (defaults to default-secret-key), JWT_EXPIRES_IN (defaults to 7d)RABBITMQ_URL is OPTIONAL; if missing, publisher logs and stays open-circuitRABBITMQ_URL is set. Filesystem for static images at IMAGE_ROOT_PATH via Express static middlewarebox-stats-apipnpm dev:stats (uses dotenv -e .env.stats -- nest start ...), or pnpm build:stats then pnpm start:stats (node dist/apps/box-stats-api/src/main.js)ConfigModule.forRoot uses .env.stats then .env in apps/box-stats-api/src/app.module.tsMONGO_STATS_URL (Prisma MongoStats connects on init)REDIS_HOST default 127.0.0.1, REDIS_PORT default 6379)APP_HOST, HOST, APP_PORT/PORT, APP_CORS_ORIGINRABBITMQ_URL OPTIONAL; consumer logs error and returns without connecting if missingRABBITMQ_URL is setbox-app-api JWT secret defaults to default-secret-key and expiration defaults to 7d if env is missing0.0.0.0 and ports 3300/3301/3302 if APP_PORT/PORT not setbox-app-api and box-mgnt-api serve static images from /data/box-images if IMAGE_ROOT_PATH is not setdocs/ARCHITECTURE.md, docs/SYSTEM_OVERVIEW.md, apps/box-stats-api/src/app.module.ts, apps/box-stats-api/src/feature/stats-events/*)apps/box-app-api/src/feature/recommendation/*)apps/box-app-api/src/rabbitmq/rabbitmq-publisher.service.ts, apps/box-app-api/src/rabbitmq/rabbitmq-fallback-replay.controller.ts)apps/box-mgnt-api/src/dev/*, apps/box-mgnt-api/src/cache-sync/*)apps/box-mgnt-api/src/mgnt-backend/feature/video-media/video-media.controller.ts)apps/box-mgnt-api/src/cache-sync/cache-sync.service.ts)apps/box-stats-api/src/feature/stats-events/stats-aggregation.service.ts)libs/core/src/cache/video/list/video-list-cache.builder.ts)docs/ROADMAP.md)docs/ARCHITECTURE.md, docs/SYSTEM_OVERVIEW.md, apps/box-stats-api/src/*)apps/box-app-api/src/feature/*/*.service.ts)prisma/mysql/schema/*.prisma, prisma/mongo/schema/*.prisma, prisma/mongo-stats/schema/*.prisma)/api/v1 and /api/v1/mgnt/* with specific controllers already defined (apps/*/src/main.ts, apps/box-mgnt-api/src/mgnt-backend/mgnt-backend.module.ts, controller files under apps/box-app-api/src/feature/* and apps/box-mgnt-api/src/mgnt-backend/*)apps/box-app-api/src/feature/stats/stats.controller.ts, apps/box-stats-api/src/feature/stats-events/stats-internal.controller.ts)apps/box-app-api/src/feature/homepage, apps/box-app-api/src/feature/sys-params, apps/box-mgnt-api/src/mgnt-backend/feature/tag, apps/box-mgnt-api/src/mgnt-backend/feature/category, apps/box-mgnt-api/src/mgnt-backend/feature/channel, apps/box-mgnt-api/src/mgnt-backend/feature/system-params (isolated CRUD, clear module wiring)apps/box-mgnt-api/src/mgnt-backend/core/auth, apps/box-app-api/src/feature/auth), cache sync/warmups (apps/box-mgnt-api/src/cache-sync, libs/core/src/cache/*), RabbitMQ publisher/consumer (apps/box-app-api/src/rabbitmq, apps/box-stats-api/src/feature/rabbitmq)apps/box-mgnt-api/src/cache-sync/cache-sync.service.ts), video list cache refactors (libs/core/src/cache/video/list/video-list-cache.builder.ts), video media delete endpoint (apps/box-mgnt-api/src/mgnt-backend/feature/video-media/video-media.controller.ts)apps/box-app-api/src/feature/recommendation/recommendation.controller.ts vs global prefix), auth expectations for GET /api/v1/video/recommended, stats internal endpoints access model, required env vars for S3 usage (apps/box-mgnt-api/src/mgnt-backend/feature/s3/s3.service.ts) and RabbitMQ availability expectations