Commit Graph

25 Commits

Author SHA1 Message Date
yrippert-maker
f510d09236
Update api-client.ts 2026-02-17 11:01:55 +03:00
Yuriy
d011dcdbba feat: дизайн, иконки REFLY, демо-данные, UI (ВС/пользователи/чек-листы/настройки/документы)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-16 06:56:30 +03:00
Yuriy
9d49c9bb6b feat: AI proxy via papa-app (Anthropic from RU), env and docker-compose
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-16 06:39:48 +03:00
Yuriy
25be90de7b feat: Part-M RU checklists replacing ICAO/EASA/FAA
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-16 01:02:51 +03:00
Yuriy
48d80137ac feat: demo data, AI assistant, UI fixes for presentation
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 23:33:49 +03:00
Yuriy
0a19a03b6e fix: seed data, API 500 errors, security hardening
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 21:35:22 +03:00
Yuriy
0cf1cfdaec feat: библиотека шаблонов документов (25 шт.) в стиле REFLY
- DocumentTemplate: модель, CRUD API, seed 25 шаблонов
- Категории: заявки, сертификаты, акты, письма, формы, отчёты, приказы
- Стандарты: РФ (ФАП-145/146/148/246), ICAO, EASA, FAA
- Бренд-бук REFLY: шапка, подвал, цвета #1e3a5f, печатный формат A4
- Поля contenteditable для заполнения в браузере
- DocumentPreviewModal: просмотр, заполнение, печать
- Страница /templates с фильтрами по категории и стандарту
- Alembic миграция 0002_document_templates

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 16:37:09 +03:00
Yuriy
44b14cc4fd feat: все AI-функции переведены на Anthropic Claude API
- ai_service.py: единый AI-сервис (chat, chat_with_history, analyze_document)
- routes/ai.py: POST /api/v1/ai/chat (chat, summarize, extract_risks, classify, translate)
- config.py: ANTHROPIC_API_KEY, ANTHROPIC_MODEL
- requirements.txt: anthropic>=0.42.0
- api-client.ts: aiApi (chat, summarize, extractRisks)
- CSP: connect-src добавлен https://api.anthropic.com
- app/api/ai-chat: прокси на бэкенд /api/v1/ai/chat (Anthropic)
- legal_agents/llm_client.py: переведён на ai_service (Claude)
- AIAccessSettings: только Claude (Sonnet 4, 3 Sonnet, 3 Opus)
- k8s, .env.example: OPENAI → ANTHROPIC
- package.json: удалена зависимость openai
- Документация: OpenAI/GPT заменены на Claude/Anthropic

Провайдер: исключительно Anthropic Claude
Модель по умолчанию: claude-sonnet-4-20250514

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 15:51:59 +03:00
Yuriy
62958239ac feat: 8 шаблонов чек-листов аудита ВС (РФ/ИКАО/EASA/FAA) + редактирование
- seed_checklists.py: 8 шаблонов (~120 пунктов) — ФАП-148, ФАП-145, ФАП-147,
  ICAO Annex 8, ICAO Annex 19 SMS, EASA Part-M, EASA Part-CAMO, FAA Part 43/91
- checklists.py: PATCH template, PATCH/POST/DELETE items
- ChecklistEditModal.tsx: модальное окно с inline-edit пунктов
- api-client.ts: updateTemplate, addItem, updateItem, deleteItem
- FilterBar: фильтры по стандартам (ФАП/ИКАО/EASA/FAA)
- Автозагрузка шаблонов при первом запуске (lifespan + demo seed)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 15:37:55 +03:00
Yuriy
646401299c fix: AUTH_DEPENDENCY ordering, setup_scheduler(app), Dockerfile, requirements
- main.py: AUTH_DEPENDENCY определяется до первого использования (NameError fix)
- main.py: setup_scheduler(app) вместо setup_scheduler() — планировщик запускается
- Dockerfile (корень): multi-stage build для frontend, если отсутствует
- requirements.txt: добавлен APScheduler>=3.10
- docker-compose.yml: убран deprecated version: '3.8'

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 14:15:05 +03:00
Yuriy
d47baa1782 refactor: удалены ссылки на knowledge/ (не относится к КЛГ АСУ ТК)
- Удалены API routes, rewrites и ссылки на knowledge/reglaments
- knowledge/ удалена из git-истории (6 ГБ PDF не относящихся к проекту)
- Нормативная база обслуживается через модуль legal (routes/legal/)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 14:02:14 +03:00
Yuriy
a30bf929dc docs: USER_GUIDE — раздел «Как войти в систему» с пошаговой инструкцией
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 13:30:33 +03:00
Yuriy
0e93bb9433 fix: config JWT/storage/piv/SECRET_KEY; docs: USER_GUIDE.md, DEMO_INFRASTRUCTURE_CONCLUSION.md
- config: JWT_SECRET, JWT_ALG, allow_hs256_dev_tokens, SECRET_KEY, storage_dir, piv_base_url, piv_timeout_s
- docs/USER_GUIDE.md: руководство пользователя КЛГ АСУ ТК (16 разделов)
- docs/DEMO_INFRASTRUCTURE_CONCLUSION.md: заключение по demo-инфраструктуре

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 13:13:23 +03:00
Yuriy
2a030d2cac fix: risk_scheduler() заглушка, email_service.send(to,subject,body), lifespan вызывает setup_scheduler(), таблица ревью п.4-9 и 19 2026-02-15 11:21:08 +03:00
Yuriy
b84c6d83ca chore: add untracked project files (app, backend, components, docs, e2e, helm, hooks, keycloak, knowledge, lib, monitoring, public, tools, utils)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 23:29:18 +03:00
Yuriy
4dbe4b8433 chore: add venv to .gitignore
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 23:27:02 +03:00
Yuriy
fabe4fa72f feat(backend): 6 модулей для main/роутов + ws_notifications
- api/helpers: audit, is_authority, get_org_name, paginate_query, require_roles
- services/ws_manager: connect(ws, user_id, org_id), send_to_user, send_to_org, broadcast, make_notification(event, entity_type, entity_id, **extra)
- services/risk_scheduler: setup_scheduler (заглушка/APScheduler)
- services/email_service: email_service.send (заглушка)
- middleware/request_logger: RequestLoggerMiddleware
- core/rate_limit: RateLimitMiddleware (in-memory, RATE_LIMIT_PER_MINUTE, /health в обход)
- api/routes/ws_notifications: WebSocket /ws/notifications?user_id=&org_id=

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 23:21:57 +03:00
Yuriy
891e17972c fix(klg): безопасность, deps/security, attachments, CSP, api-client, удаление lib/api.ts
- deps: авторизация через app.services.security (JWT/OIDC), без oidc fallback
- main: AUTH_DEPENDENCY для роутеров, RequestLoggerMiddleware, убран on_event(startup)
- attachments: защита path traversal, проверка владельца/authority
- docker-compose: SECRET_KEY обязателен, отдельная БД keycloak-db
- middleware: ужесточён CSP (без unsafe-eval в prod, без api.openai.com)
- api-client: токен только в памяти, без sessionStorage
- cert_applications: _next_number с SELECT FOR UPDATE
- Удалён lib/api.ts, импорты на @/lib/api/api-client
- docs ERROR_HANDLING: aircraftApi.list(), middleware __init__.py

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 23:06:22 +03:00
Yuriy
1ec7f62a03 CI/CD security, architecture doc, monitoring, security audit
- .github/workflows/security.yml: npm audit, pip-audit, gitleaks, dependency-review
- .github/workflows/ci.yml: lint required, ENABLE_DEV_AUTH/DEV_TOKEN for tests
- .gitleaks.toml: secret scan config and allowlist
- docs/ARCHITECTURE.md: high-level design, layers, auth, deployment
- docs/ops/MONITORING.md: Prometheus, health, alerting, Grafana
- docs/SECURITY_AUDIT.md: audit tools and procedures (ZAP, Bandit, Trivy)
- config/prometheus.yml: example scrape config
- README: CI/CD and docs links

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 21:56:02 +03:00
Yuriy
a7da43be0e apply recommendations: security, get_db, exceptions, eslint, api-client
- session: set_tenant use bound param (SQL injection fix)
- health: text('SELECT 1'), REDIS_URL from config
- deps: re-export get_db from session, use settings.ENABLE_DEV_AUTH (default False)
- routes: all get_db from app.api.deps; conftest overrides deps.get_db
- main: register exception handlers from app.api.exceptions
- next.config: enable ESLint and TypeScript checks
- .eslintrc: drop @typescript-eslint/recommended; fix no-console (logger, ws-client, regulations)
- backend/.env.example added
- frontend: export apiFetch; dashboard, profile, settings, risks use api-client
- docs/ANALYSIS_AND_RECOMMENDATIONS.md

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 21:48:58 +03:00
Yuriy
d9dd6d66cd refactor: legal package, personnel package, FGIS base_service, docs/SECURITY
- .gitignore: backend/venv/
- legal: routes/legal/ (base, handlers), legal_legacy.py
- personnel: routes/personnel/ re-exports personnel_plg
- FGIS: fgis/base_service.py, fgis_revs imports from fgis
- docs/SECURITY.md: security guide
- lib/logger.ts, logger-client.ts

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 21:37:46 +03:00
Yuriy
aa052763f6 Безопасность и качество: 8 исправлений + обновления
- .env.example: полный шаблон, защита секретов
- .gitignore: явное исключение .env.* и секретов
- layout.tsx: XSS — заменён dangerouslySetInnerHTML на next/script для SW
- ESLint: no-console error (allow warn/error), ignore scripts/
- scripts/remove-console-logs.js: очистка console.log без glob
- backend/routes/modules: README с планом рефакторинга крупных файлов
- SECURITY.md: гид по секретам, XSS, CORS, auth, линту
- .husky/pre-commit: запуск npm run lint

+ прочие правки приложения и бэкенда

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 21:29:16 +03:00
Yuriy
b147d16798 MVP: заглушки, auth, .env.example, связь с бэкендом, главная КЛГ
- Заполнены заглушки: user-friendly-messages, health, aria, keyboard
- backend: core/auth.py, /api/v1/stats; cached-api → backend-client при USE_MOCK_DATA=false
- .env.example, middleware auth (skip при USE_MOCK_DATA), убраны неиспользуемые deps
- Страницы: airworthiness, maintenance, defects, modifications; AircraftAddModal, Sidebar
- Главная страница: REFLY — Контроль лётной годности (вместо Numerology App)
- Линт/скрипты: eslintrc, security, cleanup, logs, api inbox/knowledge

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 16:43:53 +03:00
Yuriy
dbf4946dc9 fix: remove duplicate knowledge/ from .gitignore
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:27:02 +03:00
Yuriy
0150aba4f5 Consolidation: KLG ASUTK + PAPA integration
- Unify API: lib/api.ts uses /api/v1, inbox uses /api/inbox (rewrites)
- Remove localhost refs: openapi, inbox page
- Add rewrites: /api/inbox|tmc -> inbox-server, /api/v1 -> FastAPI
- Add stub routes: knowledge/insights, recommendations, search, log-error
- Transfer from PAPA: prompts (inspection, tmc), scripts, supabase, data/tmc-requests
- Fix inbox-server: ORDER BY created_at, package.json
- Remove redundant app/api/inbox/files route (rewrites handle it)
- knowledge/ in gitignore (large PDFs)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:18:31 +03:00