# BizNode Project Rules

## Architecture
- **Admin Node** (this repo) — never distribute to clients
- **basic/** — client download package (8 core features only)
- **pro/** — Pro package (all features, USB hardware-bound)
- Only Qdrant runs in Docker; Ollama, Dashboard, Bot run as native Windows processes

## Key Services
- Bot: `docker/bot/run_bot.py` via `bot_runner.py`
- Dashboard API: `ui/server.py` (FastAPI, port 7777)
- Database: PostgreSQL (default) or SQLite via `memory/database.py`
- Vector DB: Qdrant at port 6333 (Docker container `biznode-qdrant-1`)
- LLM: Ollama at port 11434 (model: qwen3.5:4b)
- Watchdog: `watchdog/daemon.py` — self-healing service monitor
- Marketing Team: `marketingteam/` — AI marketing reports service (admin-only)
  - Report generation: `marketingteam/generate_reports.py`
  - Order management: `marketingteam/report_service.py`
  - Campaign automation: `marketingteam/campaign_engine.py`
  - Scheduled tasks: `marketingteam/campaign_scheduler.py`
  - Email delivery: `marketingteam/email_sender.py`

## Rules
- Never include `bizchannel/` or `videoautomation/` in basic/ package
- Never include `marketingteam/` in basic/ or pro/ packages
- Never include node monitoring/deployment tools in ANY package (`hosted_bot_runner.py`, `deploy_node.py`, `setup_node.py`, `node_bootstrap.py`, `telegram_bridge.py`, `node_automonitor.py`)
- Package distribution is via email after payment — NOT through nodemonitor file transfer
- Never zip root folder for distribution
- All subprocess calls must use `CREATE_NO_WINDOW` on Windows
- All scheduled tasks must use `pythonw.exe`, not `python.exe`
- Always sync bot changes to `pro/docker/bot/run_bot.py`
- Use `update.ps1` for VPS deployment — never raw scp
- Always mask emails in bot output via `_mask_email()`

## Legal
- Always use BizNode™ (with ™) on first use in documents
- Required files: LICENSE, DISCLAIMER.md, LEGAL.md, TERMS.md, TRADEMARK.md

## Sensitive Files (never commit)
- `.env`, `identity/*.pem`, `tools/admin/*.env`
- `memory/biznode.db*`, `watchdog/watchdog.db`
