How anjali76codes/doculens---automatic_document_verification works
Project Overview & Key Components
• Recognize that Doculens is a full-stack, MERN application whose primary purpose is to verify documents (Aadhar, additional documents) by extracting text and matching facial data via the Microsoft Face API.
• The system includes a clearly segregated frontend (React using Vite) and backend (Node.js/Express.js) structure, with a MongoDB database (as per the README) and external integration with Microsoft Face API.
Analyzing the File Structure
• The top-level directories “frontend” and “backend” make the separation obvious.
• The backend directory contains:
• Controllers: Business logic for details and user management.
• Models: Schema definitions for Details, Document, and User.
• Routes: HTTP endpoints segregated by concerns (detailsRoutes, document, user.route).
• An “uploads” folder for storing document files.
• An “extract_text.py” which hints at Python-based text extraction – possibly running OCR or leveraging some external library.
• The frontend directory features:
• A React codebase with components (FaceDetection, Navbar, OCRComponent) and pages (AdminReview, DocumentUpload, Home, LandingPage, etc.).
• Configuration files for ESLint, Tailwind, and Vite suggesting modern front-end tooling.
• A Firebase.js file, implying possible Firebase integration (for notifications or storage).
a. Main Components:
• Backend (Express.js): Represent components (routes, controllers, models). Label subcomponents clearly for user-related operations, document management, and text extraction.
• Additional (Firebase): If applicable, mark any real-time feature (e.g., notifications) or configuration that connects with Firebase.
b. Relationships & Interactions:
• File upload process – how documents from the Frontend are sent to the Backend, stored in the "uploads" directory, and processed (with text extraction via Python and subsequent face matching).
c. Architectural Patterns & Design Principles:
• Model-View-Controller (MVC) approach on the backend.
• Separation of concerns: clearly delineate where validation, business logic, and data storage occurs.
• Asynchronous/control flow involved in external API interactions.
d. Technologies & Tools:
• Additional important files that hint at configuration (like ESLint, Tailwind, and Vite configurations on the frontend) though they are less central to the high-level architecture.