feat: vendor-product-category matrix with infra/ib modes and docker setup
This commit is contained in:
8
.dockerignore
Normal file
8
.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
||||
.git
|
||||
.venv
|
||||
__pycache__
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
*.db-shm
|
||||
*.db-wal
|
||||
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
CMD ["python", "main.py"]
|
||||
49
README.md
Normal file
49
README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# MONT Vendor Maps
|
||||
|
||||
Flask-приложение для визуализации и редактирования матрицы:
|
||||
- вендор -> продукты -> категории
|
||||
- в двух режимах: Инфраструктура и ИБ
|
||||
|
||||
## Возможности
|
||||
- фильтрация по вендорам и категориям
|
||||
- отображение продуктов по выбранным фильтрам
|
||||
- переключение контуров `Инфраструктура / ИБ`
|
||||
- отдельный визуальный стиль для ИБ
|
||||
- админ-панель с редактированием:
|
||||
- вендоров
|
||||
- категорий
|
||||
- продуктов
|
||||
- матрицы `продукт × категория`
|
||||
|
||||
## API
|
||||
`GET /api/data?scope=infra|ib`
|
||||
|
||||
Возвращает JSON:
|
||||
- `vendors`
|
||||
- `categories`
|
||||
- `products`
|
||||
- `product_links`
|
||||
- `links` (агрегированные vendor-category, для совместимости)
|
||||
|
||||
## Локальный запуск
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
.venv/bin/python -m ensurepip --upgrade
|
||||
.venv/bin/python -m pip install -r requirements.txt
|
||||
.venv/bin/python main.py
|
||||
```
|
||||
|
||||
## Docker
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
Приложение доступно на порту `5000`.
|
||||
|
||||
## Переменные окружения
|
||||
- `SECRET_KEY` — секрет Flask-сессии.
|
||||
|
||||
## База данных
|
||||
SQLite: `matrix.db`.
|
||||
|
||||
Содержит данные по двум контурам (`infra` и `ib`), включая продукты и связи категорий.
|
||||
BIN
Z-card_РФ.xlsx
Normal file
BIN
Z-card_РФ.xlsx
Normal file
Binary file not shown.
BIN
__pycache__/main.cpython-310.pyc
Normal file
BIN
__pycache__/main.cpython-310.pyc
Normal file
Binary file not shown.
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
zkart:
|
||||
build: .
|
||||
container_name: zkart-app
|
||||
ports:
|
||||
- "5000:5000"
|
||||
environment:
|
||||
SECRET_KEY: ${SECRET_KEY:-change-me-please}
|
||||
volumes:
|
||||
- ./matrix.db:/app/matrix.db
|
||||
restart: unless-stopped
|
||||
BIN
mont_logo.png
Normal file
BIN
mont_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Flask>=3.0.0
|
||||
openpyxl>=3.1.0
|
||||
Reference in New Issue
Block a user