How archidevil/hat works
Main Components Identification
The system consists of four main components:
• Frontend (Vue.js application)
• Backend (FastAPI service)
• Worker (Background processing service)
• Database (PostgreSQL)
Key Architectural Elements
a) Frontend Layer:
• Vue.js based SPA with the following key modules:
• Document management (/src/stores/document.ts)
• Translation memory (/src/stores/tm.ts)
• Glossary management (/src/stores/glossary.ts)
• User management (/src/stores/user.ts)
• Authentication system
b) Backend Layer:
• FastAPI application with modular structure:
• Document processing (/app/documents)
• Translation memory (/app/translation_memory)
• Glossary management (/app/glossary)
• User management (/app/user)
• Authentication (/app/routers/auth.py)
• Machine translation integration (/app/translators)
c) Worker Component:
• Separate process for background tasks
• Handles document processing and analysis
• Integrates with machine translation services
d) Database Layer:
• PostgreSQL with multiple schemas (visible from alembic migrations)
• Handles various entities: documents, translation memories, glossaries, users
External Layer (User Interaction)
• Web Browser
• HTTP/HTTPS access point (Caddy reverse proxy on port 6916)
Application Layer
• ┌─────────────────────────────────────────────────────┐
• Reverse Proxy (Caddy) │
• ┘
• ↓
• ┌─────────────────┐ ←→ ┌─────────────────┐
• Frontend (Vue) │ │ Backend (FastAPI)│
• Documents │ │ - Auth │
• TM │ │ - Documents │
• Glossary │ │ - TM │
• Users │ │ - Glossary │
• ┘ └─────────────────┘
• ↕ ↕
• ┌─────────────┐ │
• Worker │ │
• (Processing)│ │
• ┘ │
• ↕ ↕
• ┌─────────────────────────────────────────────────────┐
• PostgreSQL │
• Documents | TM | Glossary | Users | Auth Tables │
• ┘
Additional Elements
• External service integration (Yandex Translator)
• Database migrations system (Alembic)
• Authentication flow
• Document processing pipeline
• Translation memory matching system
Important Notes
• Separation between development and production environments
• Docker container boundaries
• API endpoints groups
• Data flow for document processing
• Security boundaries
Specific Features to Highlight
• Translation memory system
• Glossary management
• Document processing pipeline
• User role system
• Machine translation integration