How phkhanhtrinh23/translation_layoutrecovery works
Project Components
• Frontend: Built with NextJS, TailwindCSS, and NodeJS. It resides in the Frontend folder, includes pages for login, register, history, profile, etc., and communicates with the backend via API routes.
• Backend: Constructed using Django REST Framework (in the Backend folder). It contains separate apps like “account” and “translation” handling user management and translation logic.
• AI Core / Models: Managed mainly in the “Model” and “evaluate” directories. These include scripts and utilities for Neural Machine Translation (envit5-translation), Layout Recovery (MaskRCNN), and OCR (with several plugins like EasyOCR and others).
• Database & Storage: The technical overview specifies PostgreSQL for data persistence and Firebase Cloud Storage for storing files (such as uploaded PDFs and translated outputs).
• Deployment/Containers: Docker is used extensively—as evidenced by Dockerfile.frontend, Dockerfile.backend, and the docker-compose.yml file—to containerize and orchestrate the services.
• Additional Utilities: Environment files (.env-sample), configuration files, and build scripts are also part of the system to ease development and deployment.
Relationships and Interactions
• The user interacts with the Frontend web application (browser → NextJS).
• The Frontend sends HTTP requests (REST API calls) to the Backend (Django) for operations like user authentication, file uploads, translation requests, and history retrieval.
• The Backend, upon receiving requests, coordinates with:
• The AI/ML core for processing tasks such as OCR, NMT, and layout recovery.
• The PostgreSQL database for storing user data, session information, and process metadata.
• Firebase Cloud Storage to manage file uploads/downloads (e.g., original PDFs, translated documents).
• The Docker tooling allows you to containerize these interactions, ensuring each component (frontend, backend, possibly AI model services) runs in isolated containers, as coordinated by docker-compose.
Architectural Patterns & Technologies
• Separation of concerns is prevalent. The split between Frontend (NextJS) and Backend (Django REST) exemplifies the common full-stack separation.
• Microservice-like behavior is hinted at by the distinct folders for “translation,” “account,” and “services” in the Backend. Similarly, the independent Model and evaluate directories suggest modular handling of AI tasks.
• The design embraces containerization to manage dependencies and deployment via Docker.
• Specific AI/ML services (NMT, Layout Recovery using MaskRCNN, OCR with EasyOCR) indicate a layered approach where the Backend orchestrates requests and hands off data to the corresponding AI modules.