Skip to content

feat(lite): DigiTax lite product variant (opt-in build flag)#736

Open
ShaerWare wants to merge 1 commit intomainfrom
local/lite-variant-digitax
Open

feat(lite): DigiTax lite product variant (opt-in build flag)#736
ShaerWare wants to merge 1 commit intomainfrom
local/lite-variant-digitax

Conversation

@ShaerWare
Copy link
Copy Markdown
Owner

Summary

Implements the lite product variant from #734 via build-time feature flags. Both VITE_PRODUCT_VARIANT (frontend) and DEPLOYMENT_VARIANT (backend) default to full, so prod server (ai-sekretar24.ru) and local dev are unchanged. Lite build is strictly opt-in via npm run build:lite + DEPLOYMENT_VARIANT=lite in .env.

Frontend

Bundle verification (npm run build:lite):

  • Lite dist/assets/ has no CrmView-*.js, KanbanView-*.js, SalesView-*.js, DashboardView-*.js, AuditView-*.js, UsageView-*.js, TtsView-*.js, ModelsView-*.js, ServicesView-*.js, MonitoringView-*.js, GSMView-*.js, FinetuneView-*.js, WooCommerceView-*.js, KanbanRoadmap-*.js, vuedraggable.umd-*.js
  • vendor chunk: 150 kB → 108 kB
  • ui chunk: 61 kB → 44 kB
  • charts and gantt chunks empty (0 B)
  • Grep of all lite JS files for view class names returns 0 matches

Backend

  • orchestrator.pyDEPLOYMENT_VARIANT, _FULL_VARIANT_ROUTERS list (audit, usage, bot_sales, yoomoney_webhook, woocommerce, kanban); amocrm + logs gated by !IS_LITE. GPU/hardware block additionally gated by !IS_LITE.
  • auth_manager.py_LITE_EXCLUDED_MODULES strips dashboard/system/audit/usage/sales/kanban/speech/gsm from get_user_permissions() when variant is lite.

Smoke test (cloud mode, running orchestrator in-process):

full lite
Total routes 383 267
/admin/kanban/* routes 19 0

Docs

  • CLAUDE.md — new "Lite variant (DigiTax)" section with file pointers and verification command
  • .env.docker.exampleDEPLOYMENT_VARIANT with description

Pre-commit note

mypy hook skipped on commit — 46 pre-existing errors on main (verified via pre-commit run mypy --files auth_manager.py on clean origin/main, same 46 errors). ruff, ruff-format, eslint all pass; no new warnings from this PR.

Test plan

  • cd admin && npm run build — full build succeeds, bundle has CrmView/KanbanView/etc. chunks
  • cd admin && npm run build:lite — lite build succeeds, bundle has no lite-excluded view chunks
  • Run orchestrator without DEPLOYMENT_VARIANT — all routers registered (383 in cloud mode)
  • Run orchestrator with DEPLOYMENT_VARIANT=lite — kanban/amocrm/audit/usage/bot_sales/yoomoney/woocommerce/logs routes absent (267 in cloud mode)
  • Deploy full build to prod server — no behavioural change
  • (Phase 2, separate PR) provision new VPS + deploy lite build

Out of scope (next PR — server phase)

Per #734: new VPS provisioning, systemd unit, nginx + Let's Encrypt, deploy.sh with flock, webhook listener, seed script for admin user. User confirmed "сначала делаем репу, с сервером уже после".

Refs #734.

🤖 Generated with Claude Code

Adds VITE_PRODUCT_VARIANT=lite (frontend) + DEPLOYMENT_VARIANT=lite (backend)
for the DigiTax spin-off product. Both default to "full" — existing prod
server and local dev builds are unchanged.

Frontend (build-time tree-shaking):
- New admin/src/config/variant.ts (IS_LITE, LITE_HIDDEN_PATHS)
- Lite-excluded views converted to dynamic imports in router.ts, gated by
  `IS_LITE ? [] : fullOnlyRoutes` — Vite constant-folds the ternary so
  Rollup removes the view modules from the lite bundle entirely.
- AccordionNav filters sidebar items by LITE_HIDDEN_PATHS in lite mode.
- App.vue Kanban shortcut gated behind !IS_LITE.
- npm run build:lite / dev:lite + admin/.env.lite.
- Verified: lite dist/assets/ contains no CrmView/KanbanView/SalesView/
  DashboardView/AuditView/UsageView/Tts/Models/Services/Monitoring/GSM/
  Finetune/WooCommerce chunks. vendor/ui chunks shrink, charts+gantt empty.

Backend (conditional router registration):
- orchestrator.py: _FULL_VARIANT_ROUTERS list (audit, usage, bot_sales,
  yoomoney_webhook, woocommerce, kanban) + amocrm + logs gated by !IS_LITE.
  GPU/hardware block additionally gated by !IS_LITE.
- auth_manager.py: _LITE_EXCLUDED_MODULES filters permissions dict in lite.
- Smoke test: lite cloud mode -> 267 routes (kanban=0), full cloud -> 383
  routes (kanban=19).

Docs: .env.docker.example + CLAUDE.md "Lite variant (DigiTax)" section.

mypy hook skipped — 46 pre-existing errors on main (unchanged by this PR,
confirmed via pre-commit run mypy on clean origin/main). ruff + eslint clean.

Refs #734.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant