# catalystbyzoho/tutorial-catalyst-zia-services architecture

> Architecture diagram of the GitHub repository catalystbyzoho/tutorial-catalyst-zia-services, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/catalystbyzoho/tutorial-catalyst-zia-services
- Repository: https://github.com/catalystbyzoho/tutorial-catalyst-zia-services

## Overview

This repository is an image-processing web application: users upload Aadhaar front/back images or a single image for PAN, OCR, cheque, barcode, or passbook processing, then view returned text and confidence data. The React app validates uploads and sends multipart requests to an Express function, which stores temporary files, invokes Catalyst Zia, and formats success or error responses. The map separates the UI workflow, shared UI support, request handling, and processing integration. Source excerpts show the main calls; unsampled layout and transport details are not inferred.

Main entry points: [`app/src/views/AadhaarFileUploadView.jsx`](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/views/AadhaarFileUploadView.jsx) (Aadhaar upload), [`app/src/views/SingleFileUploadView.jsx`](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/views/SingleFileUploadView.jsx) (Single-image upload), [`functions/zia_services_function/index.js`](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/index.js) (HTTP endpoints), [`app/src/App.jsx`](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/App.jsx) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_layout["Home layout<br/>[HomeLayout.jsx]"]
  node_aadhaar["Aadhaar upload"]
  node_single["Single-image upload"]
end

subgraph group_support["UI support"]
  node_form["Form state<br/>[useForm.js]"]
  node_buttons["Upload controls<br/>[Buttons.jsx]"]
  node_common["Output formatting<br/>[CommonService.js]"]
  node_toastservice["Toast service<br/>[ToastService.js]"]
  node_toast["Error toast<br/>[Toast.jsx]"]
  node_axios["HTTP client<br/>[AxiosInstance.js]"]
end

subgraph group_backend["Upload service"]
  node_function["HTTP endpoints<br/>[index.js]"]
  node_upload["Upload validation"]
  node_files["Temporary files<br/>[FileService.js]"]
  node_errors["Error handling<br/>[ErrorHandler.js]"]
  node_error_type["Application errors<br/>[AppError.js]"]
  node_response["Response format<br/>[ResponsePojo.js]"]
end

subgraph group_processing["Image processing"]
  node_zia{{"Catalyst Zia"}}
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_aadhaar
node_app -->|"routes to"| node_single
node_aadhaar -->|"uses state"| node_form
node_single -->|"uses state"| node_form
node_aadhaar -->|"renders"| node_buttons
node_single -->|"renders"| node_buttons
node_aadhaar -->|"formats output"| node_common
node_single -->|"formats output"| node_common
node_aadhaar -->|"posts files"| node_axios
node_single -->|"posts files"| node_axios
node_aadhaar -->|"shows errors"| node_toastservice
node_single -->|"shows errors"| node_toastservice
node_toastservice -->|"renders"| node_toast
node_axios -->|"sends multipart request"| node_function
node_function -->|"parses uploads"| node_upload
node_upload -->|"gets temp directory"| node_files
node_upload -->|"raises validation errors"| node_error_type
node_function -->|"handles failures"| node_errors
node_errors -->|"checks error type"| node_error_type
node_function -->|"sets response"| node_response
node_function -->|"invokes extraction"| node_zia

click node_app "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/App.jsx"
click node_layout "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/layouts/HomeLayout.jsx"
click node_aadhaar "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/views/AadhaarFileUploadView.jsx"
click node_single "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/views/SingleFileUploadView.jsx"
click node_form "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/hooks/useForm.js"
click node_buttons "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/components/Buttons.jsx"
click node_common "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/services/CommonService.js"
click node_toastservice "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/services/ToastService.js"
click node_toast "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/components/Toast.jsx"
click node_axios "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/instances/AxiosInstance.js"
click node_function "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/index.js"
click node_upload "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/handlers/FileUploadHandler.js"
click node_files "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/services/FileService.js"
click node_errors "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/handlers/ErrorHandler.js"
click node_error_type "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/errors/AppError.js"
click node_response "https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/pojos/ResponsePojo.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_layout,node_aadhaar,node_single,node_user toneBlue
class node_form,node_buttons,node_common,node_toastservice,node_toast,node_axios toneAmber
class node_function,node_upload,node_files,node_errors,node_error_type,node_response toneMint
class node_zia toneRose
```

## Components

### Web application

- [App routing](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/App.jsx): `app/src/App.jsx`
- [Home layout](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/layouts/HomeLayout.jsx): `app/src/layouts/HomeLayout.jsx`
- [Aadhaar upload](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/views/AadhaarFileUploadView.jsx): `app/src/views/AadhaarFileUploadView.jsx`
- [Single-image upload](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/views/SingleFileUploadView.jsx): `app/src/views/SingleFileUploadView.jsx`

### UI support

- [Form state](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/hooks/useForm.js): `app/src/hooks/useForm.js`
- [Upload controls](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/components/Buttons.jsx): `app/src/components/Buttons.jsx`
- [Output formatting](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/services/CommonService.js): `app/src/services/CommonService.js`
- [Toast service](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/services/ToastService.js): `app/src/services/ToastService.js`
- [Error toast](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/components/Toast.jsx): `app/src/components/Toast.jsx`
- [HTTP client](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/app/src/instances/AxiosInstance.js): `app/src/instances/AxiosInstance.js`

### Upload service

- [HTTP endpoints](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/index.js): `functions/zia_services_function/index.js`
- [Upload validation](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/handlers/FileUploadHandler.js): `functions/zia_services_function/handlers/FileUploadHandler.js`
- [Temporary files](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/services/FileService.js): `functions/zia_services_function/services/FileService.js`
- [Error handling](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/handlers/ErrorHandler.js): `functions/zia_services_function/handlers/ErrorHandler.js`
- [Application errors](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/errors/AppError.js): `functions/zia_services_function/errors/AppError.js`
- [Response format](https://github.com/catalystbyzoho/tutorial-catalyst-zia-services/blob/master/functions/zia_services_function/pojos/ResponsePojo.js): `functions/zia_services_function/pojos/ResponsePojo.js`

### Image processing

- **Catalyst Zia**

### Other components

- **User**

## Connections

- User → App routing: uses
- App routing → Home layout: routes through (evidence: `app/src/App.jsx`)
- App routing → Aadhaar upload: routes to (evidence: `app/src/App.jsx`)
- App routing → Single-image upload: routes to (evidence: `app/src/App.jsx`)
- Aadhaar upload → Form state: uses state (evidence: `app/src/views/AadhaarFileUploadView.jsx`)
- Single-image upload → Form state: uses state (evidence: `app/src/views/SingleFileUploadView.jsx`)
- Aadhaar upload → Upload controls: renders (evidence: `app/src/views/AadhaarFileUploadView.jsx`)
- Single-image upload → Upload controls: renders (evidence: `app/src/views/SingleFileUploadView.jsx`)
- Aadhaar upload → Output formatting: formats output (evidence: `app/src/views/AadhaarFileUploadView.jsx`)
- Single-image upload → Output formatting: formats output (evidence: `app/src/views/SingleFileUploadView.jsx`)
- Aadhaar upload → HTTP client: posts files (evidence: `app/src/views/AadhaarFileUploadView.jsx`)
- Single-image upload → HTTP client: posts files (evidence: `app/src/views/SingleFileUploadView.jsx`)
- Aadhaar upload → Toast service: shows errors (evidence: `app/src/views/AadhaarFileUploadView.jsx`)
- Single-image upload → Toast service: shows errors (evidence: `app/src/views/SingleFileUploadView.jsx`)
- Toast service → Error toast: renders (evidence: `app/src/services/ToastService.js`)
- HTTP client → HTTP endpoints: sends multipart request
- HTTP endpoints → Upload validation: parses uploads (evidence: `functions/zia_services_function/index.js`)
- Upload validation → Temporary files: gets temp directory (evidence: `functions/zia_services_function/handlers/FileUploadHandler.js`)
- Upload validation → Application errors: raises validation errors (evidence: `functions/zia_services_function/handlers/FileUploadHandler.js`)
- HTTP endpoints → Error handling: handles failures (evidence: `functions/zia_services_function/index.js`)
- Error handling → Application errors: checks error type (evidence: `functions/zia_services_function/handlers/ErrorHandler.js`)
- HTTP endpoints → Response format: sets response (evidence: `functions/zia_services_function/index.js`)
- HTTP endpoints → Catalyst Zia: invokes extraction (evidence: `functions/zia_services_function/index.js`)
