feat(lite): DigiTax lite product variant (opt-in build flag)#736
Open
feat(lite): DigiTax lite product variant (opt-in build flag)#736
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the lite product variant from #734 via build-time feature flags. Both
VITE_PRODUCT_VARIANT(frontend) andDEPLOYMENT_VARIANT(backend) default tofull, so prod server (ai-sekretar24.ru) and local dev are unchanged. Lite build is strictly opt-in vianpm run build:lite+DEPLOYMENT_VARIANT=litein.env.Frontend
IS_LITE,LITE_HIDDEN_PATHShelpers--mode liteIS_LITE ? [] : fullOnlyRoutes. Vite constant-folds the ternary → Rollup tree-shakes the view modules out of the lite bundle.LITE_HIDDEN_PATHS!IS_LITEnpm run dev:lite/npm run build:liteBundle verification (
npm run build:lite):dist/assets/has noCrmView-*.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-*.jsvendorchunk: 150 kB → 108 kBuichunk: 61 kB → 44 kBchartsandganttchunks empty (0 B)Backend
DEPLOYMENT_VARIANT,_FULL_VARIANT_ROUTERSlist (audit, usage, bot_sales, yoomoney_webhook, woocommerce, kanban);amocrm+logsgated by!IS_LITE. GPU/hardware block additionally gated by!IS_LITE._LITE_EXCLUDED_MODULESstrips dashboard/system/audit/usage/sales/kanban/speech/gsm fromget_user_permissions()when variant is lite.Smoke test (
cloudmode, running orchestrator in-process):/admin/kanban/*routesDocs
DEPLOYMENT_VARIANTwith descriptionPre-commit note
mypyhook skipped on commit — 46 pre-existing errors onmain(verified viapre-commit run mypy --files auth_manager.pyon cleanorigin/main, same 46 errors).ruff,ruff-format,eslintall pass; no new warnings from this PR.Test plan
cd admin && npm run build— full build succeeds, bundle has CrmView/KanbanView/etc. chunkscd admin && npm run build:lite— lite build succeeds, bundle has no lite-excluded view chunksDEPLOYMENT_VARIANT— all routers registered (383 in cloud mode)DEPLOYMENT_VARIANT=lite— kanban/amocrm/audit/usage/bot_sales/yoomoney/woocommerce/logs routes absent (267 in cloud mode)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