# dharshinimk-521/printready architecture

> Architecture diagram of the GitHub repository dharshinimk-521/printready, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dharshinimk-521/printready
- Repository: https://github.com/dharshinimk-521/printready

## Overview

PrintReady AI lets customers upload artwork for vendor-specific analysis, scoring, image conversion, and print-ready PDF generation; customers can review job history, while shop printers manage a shop-scoped job queue. The graph follows the upload and printer workflows and includes authentication, templates, and storage. Backend calls are supported by sampled controller and route references; frontend component wiring is supported by the source index and README. Unsampled implementation details are represented only where the README documents the capability.

Main entry points: [`frontend/src/App.jsx`](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/App.jsx) (React App), [`backend/controllers/jobController.js`](https://github.com/dharshinimk-521/printready/blob/main/backend/controllers/jobController.js) (Job Workflow), [`frontend/src/api.js`](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/api.js) (API Client), [`frontend/src/pages/UploadPage.jsx`](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/UploadPage.jsx) (Upload Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Customer and Printer UI"]
  node_app["React App<br/>[App.jsx]"]
  node_upload_page["Upload Page<br/>[UploadPage.jsx]"]
  node_upload_ui["Upload Controls<br/>[DropZone.jsx]"]
  node_template_ui["Template Selector"]
  node_upload_hook["Upload Hook<br/>[useUpload.js]"]
  node_result_ui["Results View<br/>[ResultCard.jsx]"]
  node_history_page["Job History<br/>[HistoryPage.jsx]"]
  node_printer_page["Printer Dashboard"]
  node_auth_ui["Login and Register<br/>[AuthModal.jsx]"]
  node_auth_hook["Auth State<br/>[useAuth.js]"]
  node_api_client["API Client<br/>[api.js]"]
end

subgraph group_api["API and Access"]
  node_server["Express Server<br/>[server.js]"]
  node_job_routes["Job Routes<br/>[jobs.js]"]
  node_printer_routes["Printer Routes<br/>[printer.js]"]
  node_auth_routes["Auth Routes<br/>[auth.js]"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_auth_middleware["JWT Access Control<br/>[auth.js]"]
  node_job_controller["Job Workflow<br/>[jobController.js]"]
end

subgraph group_processing["Print Processing"]
  node_image_service["Analyze and Score<br/>[imageService.js]"]
  node_templates["Vendor Specifications<br/>[vendorTemplates.js]"]
  node_pdf_service["Print PDF<br/>[pdfService.js]"]
end

subgraph group_data["Persistence and Files"]
  node_database[("PostgreSQL<br/>[db.js]")]
  node_azure[("Azure Blob Storage<br/>[azure.js]")]
end

node_customer(("Customer"))
node_printer(("Print Shop"))

node_customer -->|"uses"| node_app
node_printer -->|"uses"| node_app
node_app -->|"routes to"| node_upload_page
node_app -->|"routes to"| node_history_page
node_app -->|"routes to"| node_printer_page
node_app -->|"opens"| node_auth_ui
node_app -->|"uses"| node_auth_hook
node_upload_page -->|"renders"| node_upload_ui
node_upload_page -->|"renders"| node_template_ui
node_upload_page -->|"renders"| node_result_ui
node_upload_page -->|"uses"| node_upload_hook
node_upload_hook -->|"sends requests"| node_api_client
node_template_ui -->|"fetches specs"| node_api_client
node_history_page -->|"fetches history"| node_api_client
node_printer_page -->|"manages jobs"| node_api_client
node_auth_ui -->|"authenticates"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts"| node_job_routes
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_printer_routes
node_job_routes -->|"dispatches"| node_job_controller
node_job_routes -->|"applies"| node_auth_middleware
node_printer_routes -->|"dispatches"| node_job_controller
node_printer_routes -->|"applies"| node_auth_middleware
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects"| node_auth_middleware
node_auth_controller -->|"reads and writes"| node_database
node_auth_middleware -->|"looks up users"| node_database
node_job_controller -->|"gets specifications"| node_templates
node_job_controller -->|"analyzes and processes"| node_image_service
node_job_controller -->|"generates PDF"| node_pdf_service
node_job_controller -->|"stores files"| node_azure
node_job_controller -->|"records and queries jobs"| node_database

click node_app "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/App.jsx"
click node_upload_page "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/UploadPage.jsx"
click node_upload_ui "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/DropZone.jsx"
click node_template_ui "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/TemplateSelector.jsx"
click node_upload_hook "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/hooks/useUpload.js"
click node_result_ui "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/ResultCard.jsx"
click node_history_page "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/HistoryPage.jsx"
click node_printer_page "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/PrinterDashboard.jsx"
click node_auth_ui "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/AuthModal.jsx"
click node_auth_hook "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/hooks/useAuth.js"
click node_api_client "https://github.com/dharshinimk-521/printready/blob/main/frontend/src/api.js"
click node_server "https://github.com/dharshinimk-521/printready/blob/main/backend/server.js"
click node_job_routes "https://github.com/dharshinimk-521/printready/blob/main/backend/routes/jobs.js"
click node_printer_routes "https://github.com/dharshinimk-521/printready/blob/main/backend/routes/printer.js"
click node_auth_routes "https://github.com/dharshinimk-521/printready/blob/main/backend/routes/auth.js"
click node_auth_controller "https://github.com/dharshinimk-521/printready/blob/main/backend/controllers/authController.js"
click node_auth_middleware "https://github.com/dharshinimk-521/printready/blob/main/backend/middleware/auth.js"
click node_job_controller "https://github.com/dharshinimk-521/printready/blob/main/backend/controllers/jobController.js"
click node_image_service "https://github.com/dharshinimk-521/printready/blob/main/backend/services/imageService.js"
click node_templates "https://github.com/dharshinimk-521/printready/blob/main/backend/services/vendorTemplates.js"
click node_pdf_service "https://github.com/dharshinimk-521/printready/blob/main/backend/services/pdfService.js"
click node_database "https://github.com/dharshinimk-521/printready/blob/main/backend/config/db.js"
click node_azure "https://github.com/dharshinimk-521/printready/blob/main/backend/config/azure.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_upload_page,node_upload_ui,node_template_ui,node_upload_hook,node_result_ui,node_history_page,node_printer_page,node_auth_ui,node_auth_hook,node_api_client toneBlue
class node_server,node_job_routes,node_printer_routes,node_auth_routes,node_auth_controller,node_auth_middleware,node_job_controller toneAmber
class node_image_service,node_templates,node_pdf_service toneMint
class node_database,node_azure toneRose
class node_customer,node_printer toneIndigo
```

## Components

### Customer and Printer UI

- [React App](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Upload Page](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/UploadPage.jsx): `frontend/src/pages/UploadPage.jsx`
- [Upload Controls](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/DropZone.jsx): `frontend/src/components/DropZone.jsx`
- [Template Selector](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/TemplateSelector.jsx): `frontend/src/components/TemplateSelector.jsx`
- [Upload Hook](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/hooks/useUpload.js): `frontend/src/hooks/useUpload.js`
- [Results View](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/ResultCard.jsx): `frontend/src/components/ResultCard.jsx`
- [Job History](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/HistoryPage.jsx): `frontend/src/pages/HistoryPage.jsx`
- [Printer Dashboard](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/pages/PrinterDashboard.jsx): `frontend/src/pages/PrinterDashboard.jsx`
- [Login and Register](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/components/AuthModal.jsx): `frontend/src/components/AuthModal.jsx`
- [Auth State](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/hooks/useAuth.js): `frontend/src/hooks/useAuth.js`
- [API Client](https://github.com/dharshinimk-521/printready/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and Access

- [Express Server](https://github.com/dharshinimk-521/printready/blob/main/backend/server.js): `backend/server.js`
- [Job Routes](https://github.com/dharshinimk-521/printready/blob/main/backend/routes/jobs.js): `backend/routes/jobs.js`
- [Printer Routes](https://github.com/dharshinimk-521/printready/blob/main/backend/routes/printer.js): `backend/routes/printer.js`
- [Auth Routes](https://github.com/dharshinimk-521/printready/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Authentication](https://github.com/dharshinimk-521/printready/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT Access Control](https://github.com/dharshinimk-521/printready/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Job Workflow](https://github.com/dharshinimk-521/printready/blob/main/backend/controllers/jobController.js): `backend/controllers/jobController.js`

### Print Processing

- [Analyze and Score](https://github.com/dharshinimk-521/printready/blob/main/backend/services/imageService.js): `backend/services/imageService.js`
- [Vendor Specifications](https://github.com/dharshinimk-521/printready/blob/main/backend/services/vendorTemplates.js): `backend/services/vendorTemplates.js`
- [Print PDF](https://github.com/dharshinimk-521/printready/blob/main/backend/services/pdfService.js): `backend/services/pdfService.js`

### Persistence and Files

- [PostgreSQL](https://github.com/dharshinimk-521/printready/blob/main/backend/config/db.js): `backend/config/db.js`
- [Azure Blob Storage](https://github.com/dharshinimk-521/printready/blob/main/backend/config/azure.js): `backend/config/azure.js`

### Other components

- **Customer**
- **Print Shop**

## Connections

- Customer → React App: uses (evidence: `README.md`)
- Print Shop → React App: uses (evidence: `README.md`)
- React App → Upload Page: routes to (evidence: `frontend/src/App.jsx`)
- React App → Job History: routes to (evidence: `frontend/src/App.jsx`)
- React App → Printer Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- React App → Login and Register: opens (evidence: `frontend/src/App.jsx`)
- React App → Auth State: uses (evidence: `frontend/src/App.jsx`)
- Upload Page → Upload Controls: renders (evidence: `frontend/src/pages/UploadPage.jsx`)
- Upload Page → Template Selector: renders (evidence: `frontend/src/pages/UploadPage.jsx`)
- Upload Page → Results View: renders (evidence: `frontend/src/pages/UploadPage.jsx`)
- Upload Page → Upload Hook: uses (evidence: `frontend/src/pages/UploadPage.jsx`)
- Upload Hook → API Client: sends requests (evidence: `frontend/src/hooks/useUpload.js`)
- Template Selector → API Client: fetches specs (evidence: `frontend/src/components/TemplateSelector.jsx`)
- Job History → API Client: fetches history (evidence: `frontend/src/pages/HistoryPage.jsx`)
- Printer Dashboard → API Client: manages jobs (evidence: `frontend/src/pages/PrinterDashboard.jsx`)
- Login and Register → API Client: authenticates (evidence: `frontend/src/components/AuthModal.jsx`)
- API Client → Express Server: calls API (evidence: `README.md`)
- Express Server → Job Routes: mounts (evidence: `backend/server.js`)
- Express Server → Auth Routes: mounts (evidence: `backend/server.js`)
- Express Server → Printer Routes: mounts (evidence: `backend/server.js`)
- Job Routes → Job Workflow: dispatches (evidence: `backend/routes/jobs.js`)
- Job Routes → JWT Access Control: applies (evidence: `backend/routes/jobs.js`)
- Printer Routes → Job Workflow: dispatches (evidence: `backend/routes/printer.js`)
- Printer Routes → JWT Access Control: applies (evidence: `backend/routes/printer.js`)
- Auth Routes → Authentication: dispatches (evidence: `backend/routes/auth.js`)
- Auth Routes → JWT Access Control: protects (evidence: `backend/routes/auth.js`)
- Authentication → PostgreSQL: reads and writes (evidence: `backend/controllers/authController.js`)
- JWT Access Control → PostgreSQL: looks up users (evidence: `backend/middleware/auth.js`)
- Job Workflow → Vendor Specifications: gets specifications (evidence: `backend/controllers/jobController.js`)
- Job Workflow → Analyze and Score: analyzes and processes (evidence: `backend/controllers/jobController.js`)
- Job Workflow → Print PDF: generates PDF (evidence: `backend/controllers/jobController.js`)
- Job Workflow → Azure Blob Storage: stores files (evidence: `backend/controllers/jobController.js`)
- Job Workflow → PostgreSQL: records and queries jobs (evidence: `backend/controllers/jobController.js`)
