Metadata-Version: 2.5
Name: neurocad
Version: 1.0.18
Summary: NeuroCad — core engine + CMS + visual editor for FastAPI
Project-URL: Homepage, https://github.com/aleksmir-dev/neurocad
Project-URL: Repository, https://github.com/aleksmir-dev/neurocad
Project-URL: Issues, https://github.com/aleksmir-dev/neurocad/issues
Author: Aleksey Smirnov
License: Business Source License 1.1
        
        License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
        "Business Source License" is a trademark of MariaDB Corporation Ab.
        
        Parameters
        
        Licensor: Smirnov Aleksey Vladimirovich
        
        Licensed Work: neurocad
        The Licensed Work is (c) 2026 Smirnov Aleksey Vladimirovich
        
        Additional Use Grant: You may use the Licensed Work for personal,
        educational, research, and non-commercial purposes, and for internal
        use within any organization, without charge.
        
        You may also use the Licensed Work as a component of your own commercial
        product or service, provided that your product or service does not
        primarily consist of hosting, managing, or providing access to the
        Licensed Work itself on a paid basis to third parties.
        
        A commercial license is required if you offer the Licensed Work (or a
        derivative thereof) as a hosted, managed, or embedded service to third
        parties on a paid basis, where the primary value provided to those
        third parties is the functionality of the Licensed Work.
        
        For commercial licensing inquiries, contact: aleksmir@list.ru
        
        Change Date: 2030-01-01
        
        Change License: Apache License, Version 2.0
        
        For information about alternative licensing arrangements for the Software,
        please visit: https://neurocad.ru
        
        Notice
        
        The Business Source License (this document, or the "License") is not an
        Open Source license. However, the Licensed Work will eventually be made
        available under an Open Source License, as stated in this License.
        
        Business Source License 1.1
        
        Terms
        
        The Licensor hereby grants you the right to copy, modify, create derivative
        works, redistribute, and make non-production use of the Licensed Work. The
        Licensor may make an Additional Use Grant, above, permitting limited
        production use.
        
        Effective on the Change Date, or the fourth anniversary of the first publicly
        available distribution of a specific version of the Licensed Work under this
        License, whichever comes first, the Licensor hereby grants you rights under
        the terms of the Change License, and the rights granted in the paragraph
        above terminate.
        
        If your use of the Licensed Work does not comply with the requirements
        currently in effect as described in this License, you must purchase a
        commercial license from the Licensor, its affiliated entities, or authorized
        resellers, or you must refrain from using the Licensed Work.
        
        All copies of the original and modified Licensed Work, and derivative works
        of the Licensed Work, are subject to this License. This License applies
        separately for each version of the Licensed Work and the Change Date may vary
        for each version of the Licensed Work released by Licensor.
        
        You must conspicuously display this License on each original or modified copy
        of the Licensed Work. If you receive the Licensed Work in original or
        modified form from a third party, the terms and conditions set forth in this
        License apply to your use of that work.
        
        Any use of the Licensed Work in violation of this License will automatically
        terminate your rights under this License for the current and all other
        versions of the Licensed Work.
        
        This License does not grant you any right in any trademark or logo of
        Licensor or its affiliates (provided that you may use a trademark or logo of
        Licensor as expressly required by this License).
        
        TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
        AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
        EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
        TITLE.
        
        MariaDB hereby grants you permission to use this License's text to license
        your works, and to refer to it using the trademark "Business Source License",
        as long as you comply with the Covenants of Licensor below.
        
        Covenants of Licensor
        
        In consideration of the right to use this License's text and the "Business
        Source License" name and trademark, Licensor covenants to MariaDB, and to all
        other recipients of the licensed work to be provided by Licensor:
        
        1. To specify as the Change License the GPL Version 2.0 or any later version,
           or a license that is compatible with GPL Version 2.0 or a later version,
           where "compatible" means that software provided under the Change License can
           be included in a program with software provided under GPL Version 2.0 or a
           later version. Licensor may specify additional Change Licenses without
           limitation.
        
        2. To either: (a) specify an additional grant of rights to use that does not
           impose any additional restriction on the right granted in this License, as
           the Additional Use Grant; or (b) insert the text "None".
        
        3. To specify a Change Date.
        
        4. Not to modify this License in any other way.
License-File: LICENSE
Keywords: cms,engine,fastapi,grapesjs,neurocad,visual-editor
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: aiofiles
Requires-Dist: aiologger
Requires-Dist: aiosqlite
Requires-Dist: alembic==1.13.2
Requires-Dist: beautifulsoup4
Requires-Dist: black
Requires-Dist: fastapi
Requires-Dist: httpx
Requires-Dist: jinja2
Requires-Dist: lxml
Requires-Dist: markdown-it-py
Requires-Dist: passlib[bcrypt]
Requires-Dist: pydantic-settings
Requires-Dist: pydantic[email]
Requires-Dist: python-jose[cryptography]
Requires-Dist: python-multipart
Requires-Dist: sqlalchemy
Requires-Dist: starlette
Requires-Dist: tiktoken
Requires-Dist: uvicorn[standard]
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: mysql
Requires-Dist: aiomysql; extra == 'mysql'
Provides-Extra: postgres
Requires-Dist: asyncpg; extra == 'postgres'
Description-Content-Type: text/markdown

# NeuroCad

**English** | [Русский](#русский)

[![PyPI version](https://img.shields.io/pypi/v/neurocad.svg?cacheSeconds=3600)](https://pypi.org/project/neurocad/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python versions](https://img.shields.io/pypi/pyversions/neurocad.svg)](https://pypi.org/project/neurocad/)

---

**NeuroCad** is a lightweight platform for building websites and web apps
on FastAPI. It includes a visual editor, an LLM editor, a modular system,
and ready-to-use authentication.

## Features

- 🎨 **Visual editor** — GrapesJS, drag-and-drop blocks, StyleManager
- ⚡ **LLM editor** — edit pages via DeepSeek, chat with history
- 📦 **Modular system** — modules defined in `app/*.json`
- 🔐 **Auth** — superadmin, roles, password reset
- 🖼️ **Media library** — image upload and storage
- 🗄️ **SQLite out of the box** — no setup required

## Quick start

```bash
pip install neurocad

mkdir my_project && cd my_project
neurocad run
```

Open <http://127.0.0.1:8000> — login `admin`, password `admin`.

## Installation

Requirements: Python 3.10+, pip.

```bash
pip install neurocad
```

## Usage

### CLI

```bash
neurocad run        # start the server (uvicorn)
```

`neurocad init` creates the following structure:

```text
my_project/
├── app/            # modules (JSON page configs)
├── base/           # SQLite database
├── core/           # Core
├── log/            # logs
├── media/          # uploaded files
├── static/         # static files
├── mig/            # migrations
├── .env
└── main.py
```

### As a library

```python
from neurocad import NeuroCad

app = NeuroCad()
```

## Configuration

Create a `.env` file in your project root:

```env
SQLITE_URL=sqlite+aiosqlite:///base/neurocad.db
SQLITE_URL_SYNC=sqlite:///base/neurocad.db

SECRET_KEY=change-me-in-production
SUPERADMIN_LOGIN=admin
SUPERADMIN_PASSWORD=admin

APP_HOST=127.0.0.1
APP_PORT=8000

# LLM (DeepSeek)
LLM_PROVIDER=deepseek
DEEPSEEK_API_KEY=sk-...
DEEPSEEK_MODEL=deepseek-flash
```

## LLM editor

The ⚡ button in the page toolbar opens the LLM editor:

- left — page preview;
- center — current page preview;
- right — chat with DeepSeek.

Describe what you want to change — the model returns HTML, which is applied
to the preview and saved on the server. Chat history is stored per page.

Requires a DeepSeek API key in `.env` (`DEEPSEEK_API_KEY`).

## Visual editor

The ✏ button opens GrapesJS:

- block library on the left;
- canvas in the center;
- StyleManager on the right.

Changes are saved via `/core/engine/lib/word/{id}`.

## Project structure

```text
neurocad/
├── core/                  # core
│   ├── auth/              # authentication
│   ├── engine/            # engine, modules, editors
│   │   ├── lib/           # base components
│   │   │   ├── base/      # page skeleton
│   │   │   ├── word/      # page content + editors
│   │   │   │   ├── editor/    # GrapesJS
│   │   │   │   └── llm/       # LLM editor
│   │   │   ├── pages/     # article list
│   │   │   └── nav/       # navigation
│   │   └── mod/           # built-in modules (JSON)
│   └── models/            # SQLAlchemy models
├── utils/                 # utilities
│   ├── llm/               # LLM clients (DeepSeek)
│   ├── sqlite.py          # DB connection
│   └── static.py          # static files serving
├── alembic/               # migrations
├── cli.py                 # CLI
└── app.py                 # FastAPI factory
```

## License

MIT. See [LICENSE](LICENSE).

## Links

- PyPI: <https://pypi.org/project/neurocad/>
- GitHub: <https://github.com/aleksmir-dev/neurocad>

<a name="русский"></a>

# Русский

**NeuroCad** — лёгкая платформа для создания сайтов и веб-приложений на FastAPI.
Включает визуальный редактор, LLM-редактор, модульную систему и готовую авторизацию.

## Возможности

- 🎨 **Визуальный редактор** — GrapesJS, drag-and-drop блоков, StyleManager
- ⚡ **LLM-редактор** — правки страниц через DeepSeek, чат с историей
- 📦 **Модульная система** — модули описываются в `app/*.json`
- 🔐 **Авторизация** — суперадмин, роли, восстановление пароля
- 🖼️ **Медиатека** — загрузка и хранение изображений
- 🗄️ **SQLite из коробки** — не требует настройки

## Быстрый старт

```bash
pip install neurocad

mkdir my_project && cd my_project
neurocad run
```

Откройте <http://127.0.0.1:8000> — логин `admin`, пароль `admin`.

## Установка

Требования: Python 3.10+, pip.

```bash
pip install neurocad
```

## Использование

### CLI

```bash
neurocad run        # запустить сервер (uvicorn)
```

`neurocad init` создаёт структуру:

```text
my_project/
├── app/            # модули (JSON-конфиги страниц)
├── base/           # SQLite БД
├── core/           # для переопределения core
├── log/            # логи
├── media/          # загруженные файлы
├── static/         # статика
├── mig/            # миграции
├── .env
└── main.py
```

### Как библиотека

```python
from neurocad import NeuroCad

app = NeuroCad()
```

## Конфигурация

Создайте `.env` в корне проекта:

```env
SQLITE_URL=sqlite+aiosqlite:///base/neurocad.db
SQLITE_URL_SYNC=sqlite:///base/neurocad.db

SECRET_KEY=change-me-in-production
SUPERADMIN_LOGIN=admin
SUPERADMIN_PASSWORD=admin

APP_HOST=127.0.0.1
APP_PORT=8000

# LLM (DeepSeek)
LLM_PROVIDER=deepseek
DEEPSEEK_API_KEY=sk-...
DEEPSEEK_MODEL=deepseek-flash
```

## LLM-редактор

Кнопка ⚡ в тулбаре страницы открывает LLM-редактор:

- слева — превью страницы;
- в центре — превью текущей страницы;
- справа — чат с DeepSeek.

Опишите, что нужно изменить — модель вернёт HTML, он применится к превью
и сохранится на сервере. История чата сохраняется по каждой странице.

Для работы нужен ключ DeepSeek в `.env` (`DEEPSEEK_API_KEY`).

## Визуальный редактор

Кнопка ✏ открывает GrapesJS:

- библиотека блоков слева;
- canvas в центре;
- StyleManager справа.

Изменения сохраняются через `/core/engine/lib/word/{id}`.

## Структура проекта

```text
neurocad/
├── core/                  # ядро
│   ├── auth/              # авторизация
│   ├── engine/            # движок, модули, редакторы
│   │   ├── lib/           # базовые компоненты
│   │   │   ├── base/      # каркас страницы
│   │   │   ├── word/      # контент страницы + редакторы
│   │   │   │   ├── editor/    # GrapesJS
│   │   │   │   └── llm/       # LLM-редактор
│   │   │   ├── pages/     # список статей
│   │   │   └── nav/       # навигация
│   │   └── mod/           # встроенные модули (JSON)
│   └── models/            # SQLAlchemy-модели
├── utils/                 # утилиты
│   ├── llm/               # клиенты LLM (DeepSeek)
│   ├── sqlite.py          # подключение к БД
│   └── static.py          # раздача статики
├── alembic/               # миграции
├── cli.py                 # CLI
└── app.py                 # фабрика FastAPI
```

## Лицензия

MIT. См. [LICENSE](LICENSE).

## Ссылки

- PyPI: <https://pypi.org/project/neurocad/>
- GitHub: <https://github.com/aleksmir-dev/neurocad>

## Регистрация программы для ЭВМ

Версия 1.0.4 направлена для государственной регистрации программы 
для ЭВМ в Роспатент (заявка подана в 04.10.2026).