CustoCRM
Canonical implementation workspace for hub.edevs.tech.
Local start
Copy-Item .env.example .env
.\scripts\start.ps1
По умолчанию локально запускается облачный режим. Коробочный режим запускается тем же штатным контуром, но с явным признаком поставки:
.\scripts\start.ps1 -Mode Cloud
.\scripts\start.ps1 -Mode SelfHosted
Приложение не определяет режим по домену, числу организаций или данным тарифа.
Единственный источник — CUS_DELIVERY_MODE со значением CLOUD или
SELF_HOSTED. В production переменная обязательна; шаблон коробочного
экземпляра env.example уже содержит SELF_HOSTED.
The local compose stack contains:
- isolated app, platform, and loopback-only admin Django runtimes;
- background worker;
- PostgreSQL;
- Redis;
- Internal Hub UI;
- Web Chat UI;
- local Nginx reverse proxy.
No production secrets are stored in the repository.
Default local URLs:
- App gateway:
http://app.localhost/ - Platform health:
http://platform.localhost/api/v1/health/live/ - Django admin (loopback only):
http://127.0.0.1:18001/admin/ - Internal Hub UI (direct Vite):
http://localhost:5173 - Web Chat:
http://localhost:5175 - App API (direct):
http://localhost:8010/api/v1
Local accounts (TOTP disabled). These credentials are fixed — do not change them:
- OWNER —
owner@edevs.tech/Owner-Local-2026 - OPERATOR —
a.kotova@edevs.tech/Operator-Local-2026
Bootstrap the organization and both accounts:
docker compose run --rm backend-app python manage.py bootstrap_owner --email owner@edevs.tech --password Owner-Local-2026 --name "Иван Петров"
Optional local demo seed
The local demo seed is explicit and idempotent: it creates the documented local
accounts and a connected set of departments, products, channels, integrations,
AI agents, conversations, orders, and command-center data. It never runs during
start.ps1, docker compose up, or migrations.
Run it only after the local dev stack is running:
.\scripts\seed-local.ps1
The data manifest and importer live in dev/local-seed/. The explicit
local-seed one-shot service is defined only by compose.dev.yaml, runs with
the local migration DB role, is excluded from the backend image, and the
importer refuses any environment other than CUS_ENV=local. Production compose
has no seed service or seed command.
Демо-контент портала FoxRay и отдельный анонимный Web-виджет поддержки можно установить независимо от общего seed:
.\scripts\seed-support-portal.ps1
Этот portal-only импорт идемпотентен и не создаёт пользователей, не меняет
пароли, роли, сессии или права доступа. Он публикует локальный портал
http://foxray.localhost/, категории и статьи, а также подключает существующий
Web Chat через отдельный канал foxray-help.
Tests
All suites run in Docker, so no manual environment is required — the test runners auto-detect themselves and relax production hardening (secret-key fail-fast, SSL redirect, throttling) for the duration of the run.
Run everything (backend tests, frontend unit tests, typechecks):
.\scripts\check.ps1
Individual suites:
# Backend (pytest + pytest-django)
docker compose run --rm backend-app pytest
# Frontend unit tests (vitest)
docker compose run --rm frontend npm run test
# End-to-end (Playwright, internal-ui) — auto-starts the dev server
npx playwright install chromium # one-time
npx playwright test --project=internal-ui
Backend pytest configuration lives in apps/backend/pytest.ini (it must sit
next to manage.py so it is also visible inside the backend container).