Multi-Layered Architecture
This document processing application utilises a layered architecture approach to achieve modularity, maintainability, and separation of concerns. While microservices offer advantages for complex applications, a layered architecture provides a simpler and potentially more efficient solution for this specific use case. Here is a breakdown of the key layers within this architecture:
Presentation Layer
This layer handles user interaction and presentation logic. It uses the frontend framework Nuxt.js with Tailwind CSS to build the user interface for uploading documents, specifying redaction criteria, and downloading processed outputs. The frontend communicates with the backend API (FastAPI) through well-defined endpoints to initiate document processing tasks and retrieve results. This layer focuses on providing a user-friendly experience for interacting with the application.
Business Logic Layer
This layer houses the core application logic for document processing and resides within the FastAPI backend application. Responsibilities include:
- Receiving document uploads from the presentation layer.
- Validating uploaded documents (e.g., file type, size).
- Orchestrating document processing tasks using Celery.
- Interacting with the data access layer to store and retrieve document metadata (e.g., upload timestamps, processing status).
This layer encapsulates the business rules and logic for handling document processing requests.
Data Access Layer
This layer abstracts the interaction with the underlying data storage solution (PostgreSQL database). It uses an ORM (Object-Relational Mapper) or a database access library to interact with the PostgreSQL database securely. Responsibilities include:
- Storing document metadata (upload timestamps, processing status).
- Optionally storing extracted entity information (depending on application requirements).
- Retrieving relevant data based on requests from the business logic layer.
This layer shields the business logic from the specifics of the database implementation, promoting code reusability and maintainability.
Integration Layer
The Integration Layer is a pivotal component of our platform architecture, designed to seamlessly connect with external systems such as Relativity One and iManage. This capability is a significant strength of the PII platform, enhancing its versatility and appeal.