You are on page 1of 4

Software Documentation

Patent Document Retrieval Application

Table of Contents
1. Introduction...................................................................................................................1
2. Features.........................................................................................................................1
2.1 Document Retrieval..............................................................................................................1
2.2 Error Handling......................................................................................................................1
2.3 Document Download............................................................................................................1
3. Architecture Overview....................................................................................................1
4. System Overview............................................................................................................2
5. Getting Started...............................................................................................................2
6. Routes and Endpoints.....................................................................................................2
6.1 Get Granted Documents.......................................................................................................2
6.2 Get Patent as Filed Documents.............................................................................................3
6.3 Clear Cache...........................................................................................................................3
7. Data Handling................................................................................................................3
8. Error Handling................................................................................................................3
9. Deployment...................................................................................................................3
10. Conclusion....................................................................................................................4

1. Introduction
The Patent Document Retrieval Application is a Node.JS application designed to retrieve
patent documents and data from various sources. It enables users to enter patent numbers and
select specific documents for retrieval. The application supports fetching both granted and as-
filed patent documents.

2. Features
2.1 Document Retrieval

 Get Granted Documents: Retrieve granted patent documents by entering a valid


patent number.
 Get Patent as Filed: Fetch patent documents as filed, including abstract, claims, and
specification.
2.2 Error Handling

 Error Reporting: Comprehensive error handling for issues such as invalid inputs,
network errors, and failed data fetching.
 User-Friendly Messages: Informative messages for users when errors occur.

2.3 Document Download

 Combine into ZIP: Combine multiple document files into a ZIP archive for user
download.
 Download PDFs: Users can download the ZIP file containing the requested
documents.

3. Architecture Overview

In this architectural diagram:


 The "User Interface" represents the frontend web application that users interact with
through a web browser.
 The "Express.JS API" is the Node.JS server responsible for serving the Frontend,
handling user requests, and interacting with external services and data storage.
 "External Services and APIs" includes external authentication and document
download services that the Node.JS server communicates with.
 "File Operations and Data Storage" illustrates local file storage and, optionally, a
database for data storage.

4. System Overview
The Patent Document Retrieval Application is built using:

 Express.JS framework,
 Axios for making HTTP requests, and
 Archiver for combining documents into ZIP archives.

The system follows a multi-step process for fetching, downloading, and serving patent
documents.

5. Getting Started
To run the application locally:

1. Install Node.JS and NPM on your machine.


2. Clone the application's repository.
3. Install project dependencies using `NPM Install`.
4. Start the application with `NPM Start`.

6. Routes and Endpoints


The application defines several routes and endpoints to handle different tasks:

6.1 Get Granted Documents

 Endpoint: `GET /get-granted-documents`


 Parameters:
 `patentNumber`: A valid patent number to fetch granted documents.
 Description: Fetches granted patent documents based on the given patent number.
Responds with a redirection to that patent Document.

6.2 Get Patent as Filed Documents

 Endpoint: `POST /get-patent-as-filed-documents`


 Parameters:
 `applicationNumber`: A valid application number to fetch as-filed documents.
 `documentTypes`: An array of document types to fetch (e.g., `["abstract", "claims",
"specification"]`).
 Description: Fetches as-filed patent documents as requested by the user. Responds
with a ZIP file containing the selected documents.

6.3 Clear Cache

 Endpoint: `POST /clear-cache`


 Description: Clears the input fields, checkboxes, and error messages to prepare for a
new request.
7. Data Handling
 Access Tokens: The application does not require user authentication and access
tokens.
 Downloaded Documents: Retrieved documents are temporarily stored in memory
and combined into a ZIP archive before being served to the user.

8. Error Handling
The application includes error handling for various operations. It responds with appropriate
status codes and messages for various scenarios, including network errors, invalid input, and
failed data fetching.

9. Deployment
To deploy the application to a production environment, you should:

 Set up a secure environment for hosting the application.


 Configure production-level settings, such as a production database and server.
 Utilize environment variables to store sensitive information securely.

10. Conclusion
The Patent Document Retrieval Application provides a robust solution for fetching and
serving patent documents. Users can easily retrieve documents by providing patent numbers
and selecting document types. The application is built to handle errors gracefully and ensure
data security.

This documentation provides an overview of the application's features, routes, and


components.

You might also like