Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.docker.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ LLM_BACKEND=vllm
# Deployment mode: "full" (all features), "cloud" (no GPU/hardware), "local" (explicit full)
DEPLOYMENT_MODE=full

# Product variant: "full" (default) or "lite" (DigiTax — trimmed UI, disables
# kanban/crm/sales/woocommerce/audit/usage/monitoring/tts/gsm/finetune/models).
# Backend reads this and skips registering the corresponding routers.
# Frontend must be built with matching flag: `npm run build:lite` in admin/.
DEPLOYMENT_VARIANT=full

# vLLM Model (for GPU mode)
# Options: Qwen/Qwen2.5-7B-Instruct-AWQ, meta-llama/Meta-Llama-3.1-8B-Instruct
VLLM_MODEL=Qwen/Qwen2.5-7B-Instruct-AWQ
Expand Down
20 changes: 20 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ New routers import domain services directly (`from modules.monitoring.service im
LLM_BACKEND=vllm # "vllm" or "cloud:{provider_id}" (legacy "gemini" auto-migrates)
VLLM_API_URL=http://localhost:11434 # Auto-normalized: trailing /v1 stripped
DEPLOYMENT_MODE=full # "full", "cloud", or "local"
DEPLOYMENT_VARIANT=full # "full" (default) or "lite" (DigiTax trimmed build)
ORCHESTRATOR_PORT=8002
ADMIN_JWT_SECRET=... # Auto-generated if empty
REDIS_URL=redis://localhost:6379/0 # Optional, graceful fallback
Expand All @@ -357,6 +358,25 @@ BRIDGE_ISOLATE_HOME= # "1" to spawn Claude CLI with isolated HOME
BRIDGE_ISOLATED_HOME= # Override isolated HOME path (default: /var/lib/ai-secretary-bridge)
```

## Lite variant (DigiTax)

Separate product based on the same codebase, delivered on a dedicated VPS. UI trims business/monitoring/hardware modules; backend skips registering their routers.

**Activate**: set `DEPLOYMENT_VARIANT=lite` in `.env` (backend), build admin with `npm run build:lite` (frontend). Default `full` on both sides preserves current server/local behaviour — these changes are **opt-in**.

**What lite keeps**: chat, llm, wiki/RAG, widget, telegram, whatsapp, mobile-app, users, settings, about.

**What lite drops** (both routes and backend endpoints): dashboard, services, monitoring, models, audit, usage, tts, finetune, gsm, crm (amocrm), kanban, sales (bot_sales + yoomoney_webhook), woocommerce, logs.

**Key files**:
- [admin/src/config/variant.ts](admin/src/config/variant.ts) — `IS_LITE`, `LITE_HIDDEN_PATHS`
- [admin/.env.lite](admin/.env.lite) — `VITE_PRODUCT_VARIANT=lite` (auto-loaded by `--mode lite`)
- [admin/src/router.ts](admin/src/router.ts) — `baseRoutes` always + `fullOnlyRoutes` gated by `IS_LITE` (dynamic imports → tree-shaken from lite bundle)
- [orchestrator.py](orchestrator.py) — `DEPLOYMENT_VARIANT`, `_FULL_VARIANT_ROUTERS` list
- [auth_manager.py](auth_manager.py) — `_LITE_EXCLUDED_MODULES`

**Verify a lite build**: `cd admin && npm run build:lite` then `grep -l "CrmView\|KanbanView\|SalesView" admin/dist/assets/*.js` — should return nothing.

## Deployment

### Server Deployment (Production)
Expand Down
3 changes: 3 additions & 0 deletions admin/.env.lite
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Lite variant (DigiTax). Activated with `vite build --mode lite` /
# `vite --mode lite`. Vite auto-loads this on top of `.env` for that mode.
VITE_PRODUCT_VARIANT=lite
1 change: 1 addition & 0 deletions admin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dist-ssr
.env.*
!.env.demo
!.env.demo-*
!.env.lite

# OS
.DS_Store
Expand Down
2 changes: 2 additions & 0 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"type": "module",
"scripts": {
"dev": "vite",
"dev:lite": "vite --mode lite",
"build": "vue-tsc -b && vite build",
"build:lite": "vue-tsc -b && vite build --mode lite",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"lint:check": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
Expand Down
5 changes: 3 additions & 2 deletions admin/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { useSearchStore } from './stores/search'
import { useThemeStore } from './stores/theme'
import { useChatFullscreenStore } from './stores/chatFullscreen'
import { IS_LITE } from './config/variant'
import { useResizablePanel } from './composables/useResizablePanel'
import { setLocale, getLocale } from './plugins/i18n'
import ToastContainer from './components/ToastContainer.vue'
Expand All @@ -34,7 +35,7 @@
const router = useRouter()
const authStore = useAuthStore()
const searchStore = useSearchStore()
const themeStore = useThemeStore()

Check warning on line 38 in admin/src/App.vue

View workflow job for this annotation

GitHub Actions / lint-frontend

'themeStore' is assigned a value but never used. Allowed unused vars must match /^_/u
const chatFullscreenStore = useChatFullscreenStore()

const isFullscreenChat = computed(() => chatFullscreenStore.isFullscreen && route.name === 'chat')
Expand Down Expand Up @@ -198,7 +199,7 @@
<span class="flex-1 text-left">{{ t('nav.chat') }}</span>
</router-link>
<router-link
v-if="authStore.canView('kanban')"
v-if="!IS_LITE && authStore.canView('kanban')"
to="/kanban"
class="flex items-center gap-2 w-full px-3 py-2 text-sm rounded-lg transition-colors"
:class="route.path === '/kanban' ? 'bg-primary/10 text-primary' : 'text-muted-foreground bg-secondary/50 hover:bg-secondary'"
Expand All @@ -217,7 +218,7 @@
<MessageCircle class="w-5 h-5" />
</router-link>
<router-link
v-if="authStore.canView('kanban')"
v-if="!IS_LITE && authStore.canView('kanban')"
to="/kanban"
class="flex items-center justify-center w-full p-2 rounded-lg transition-colors"
:class="route.path === '/kanban' ? 'bg-primary/10 text-primary' : 'text-muted-foreground hover:bg-secondary/50'"
Expand Down
4 changes: 3 additions & 1 deletion admin/src/components/AccordionNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { RouterLink, useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useAuthStore } from '../stores/auth'
import { IS_LITE, LITE_HIDDEN_PATHS } from '../config/variant'
import { ChevronDown } from 'lucide-vue-next'
import {
LayoutDashboard,
Expand Down Expand Up @@ -30,7 +31,7 @@
import WhatsAppIcon from './WhatsAppIcon.vue'
const WhatsApp = markRaw(WhatsAppIcon)

const props = defineProps<{

Check warning on line 34 in admin/src/components/AccordionNav.vue

View workflow job for this annotation

GitHub Actions / lint-frontend

'props' is assigned a value but never used. Allowed unused vars must match /^_/u
collapsed: boolean
}>()

Expand All @@ -40,8 +41,9 @@

const LVL: Record<string, number> = { view: 1, edit: 2, manage: 3 }

function isVisible(item: { module?: string; minLevel?: string; localOnly?: boolean }): boolean {
function isVisible(item: { path?: string; module?: string; minLevel?: string; localOnly?: boolean }): boolean {
if (item.localOnly && authStore.isCloudMode) return false
if (IS_LITE && item.path && LITE_HIDDEN_PATHS.has(item.path)) return false
if (!item.module) return true
const min = item.minLevel || 'view'
return (LVL[authStore.permissions[item.module]] ?? 0) >= (LVL[min] ?? 1)
Expand Down Expand Up @@ -137,7 +139,7 @@
}, { deep: true })

// Expand group containing active route
function expandActiveGroup() {

Check warning on line 142 in admin/src/components/AccordionNav.vue

View workflow job for this annotation

GitHub Actions / lint-frontend

'expandActiveGroup' is defined but never used. Allowed unused vars must match /^_/u
for (const group of navGroups.value) {
if (group.items.some(item => item.path === route.path)) {
expandedGroups.value.add(group.id)
Expand Down
35 changes: 35 additions & 0 deletions admin/src/config/variant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Product variant flag. Set via VITE_PRODUCT_VARIANT env var.
*
* Vite inlines `import.meta.env.VITE_PRODUCT_VARIANT` at build time, so the
* `IS_LITE` ternary branches below get constant-folded and Rollup tree-shakes
* the unused route imports from the lite bundle.
*
* Default (no env) = "full" (current behaviour — prod server + local dev).
* Lite = "lite" (DigiTax build, trimmed UI).
*/
export const PRODUCT_VARIANT =
(import.meta.env.VITE_PRODUCT_VARIANT as string | undefined) || "full";

export const IS_LITE = PRODUCT_VARIANT === "lite";

/**
* Paths hidden in lite builds. Used by AccordionNav and App-level shortcuts
* for runtime UI filtering. Router does build-time tree-shaking separately
* (see admin/src/router.ts).
*/
export const LITE_HIDDEN_PATHS = new Set<string>([
"/dashboard",
"/services",
"/monitoring",
"/models",
"/audit",
"/usage",
"/tts",
"/finetune",
"/gsm",
"/sales",
"/crm",
"/kanban",
"/woocommerce",
]);
Loading
Loading