Services: - api: FastAPI gateway with JWT auth, async endpoints, WebSocket - worker-gpu: CUDA sentence-transformers, FAISS IVFFlat, Ollama LLM - worker-indexer: Winnowing+MinHash plagiarism detection, PDF/DOCX extraction - worker-notifier: SMTP email notifications - worker-gost: GOST 7.1-2003 and GOST R 7.0.5-2008 formatting Infrastructure: - docker-compose.yml (production) + docker-compose.dev.yml (hot reload) - Nginx reverse proxy + WebSocket support - PostgreSQL 16 with Alembic migrations - Elasticsearch 8 with Russian/English analyzers - MinIO, RabbitMQ, Redis, Ollama Frontend: - React 18 + Vite + TypeScript + TailwindCSS + Zustand + React Query v5 - 9 pages: Home, Search, Cabinet, Task, Check, Bibliography, Pricing, Login, Register Scripts: - Parser stubs: OpenAlex, КиберЛенинка, arXiv (Phase 0 - to be filled) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
968 B
Python
39 lines
968 B
Python
"""Схемы для аутентификации и авторизации."""
|
||
|
||
from pydantic import BaseModel, EmailStr, Field
|
||
|
||
|
||
class RegisterRequest(BaseModel):
|
||
"""Запрос на регистрацию нового пользователя."""
|
||
|
||
email: EmailStr
|
||
password: str = Field(min_length=8, max_length=128)
|
||
name: str = Field(min_length=1, max_length=255)
|
||
|
||
|
||
class LoginRequest(BaseModel):
|
||
"""Запрос на вход в систему."""
|
||
|
||
email: EmailStr
|
||
password: str
|
||
|
||
|
||
class UserInToken(BaseModel):
|
||
"""Минимальная информация о пользователе в JWT токене."""
|
||
|
||
id: int
|
||
email: str
|
||
name: str
|
||
plan: str
|
||
is_verified: bool
|
||
|
||
model_config = {"from_attributes": True}
|
||
|
||
|
||
class TokenResponse(BaseModel):
|
||
"""Ответ с JWT токеном и данными пользователя."""
|
||
|
||
access_token: str
|
||
token_type: str = "bearer"
|
||
user: UserInToken
|