# kirtiraj01/printflow architecture

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

- Interactive diagram: https://gitdiagram.com/kirtiraj01/printflow
- Repository: https://github.com/kirtiraj01/printflow

## Overview

PrintFlow is a campus print-ordering and station-management product. Students upload PDFs, choose print options, pay, and track pickup; attendants authenticate, triage orders, inspect documents, manage pickup and configure station rates. The backend validates uploads and pricing, maintains order and student state, and serves the two user experiences. The README documents wallet top-up, refunds, and station hardware details; some client wiring and these implementation paths are not sampled, so uncertain links are omitted.

Main entry points: [`client/src/api/ordersApi.js`](https://github.com/kirtiraj01/printflow/blob/main/client/src/api/ordersApi.js) (Orders API), [`client/src/components/student/StudentApp.jsx`](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentApp.jsx) (Student ordering), [`client/src/components/admin/AdminDashboard.jsx`](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminDashboard.jsx) (Attendant dashboard), [`server/src/server.js`](https://github.com/kirtiraj01/printflow/blob/main/server/src/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student portal"]
  node_app["Application shell<br/>[App.jsx]"]
  node_student_flow["Student ordering<br/>[StudentApp.jsx]"]
  node_upload["Upload and options"]
  node_payment["Payment UI<br/>[PaymentModal.jsx]"]
  node_tracking["Order tracking"]
  node_profile["Student profile<br/>[StudentProfile.jsx]"]
  node_orders_view["Student orders<br/>[StudentOrders.jsx]"]
end

subgraph group_attendant["Attendant desk"]
  node_admin_login["Attendant login<br/>[AdminLoginGate.jsx]"]
  node_admin_dash["Attendant dashboard<br/>[AdminDashboard.jsx]"]
  node_queue["Order triage"]
  node_pickup["Pickup manager"]
  node_history["Order history"]
  node_inspection["PDF inspection"]
  node_station_ui["Station settings"]
end

subgraph group_api["Client API"]
  node_api_client["HTTP client<br/>[client.js]"]
  node_orders_api["Orders API<br/>[ordersApi.js]"]
  node_student_api["Student API<br/>[studentsApi.js]"]
  node_auth_api["Authentication API<br/>[authApi.js]"]
  node_station_api["Station API<br/>[stationApi.js]"]
end

subgraph group_backend["Backend services"]
  node_server["HTTP server<br/>[server.js]"]
  node_order_routes["Order routes<br/>[orderRoutes.js]"]
  node_student_routes["Student routes<br/>[studentRoutes.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_station_routes["Station routes<br/>[stationRoutes.js]"]
  node_order_controller["Order processing<br/>[orderController.js]"]
  node_student_controller["Student sessions"]
  node_auth_controller["Admin authentication<br/>[authController.js]"]
  node_station_controller["Station management"]
  node_upload_middleware["PDF upload handling<br/>[upload.js]"]
  node_pricing["Price calculation<br/>[priceCalculator.js]"]
  node_pdf_utils["PDF utilities<br/>[pdfUtils.js]"]
  node_codegen["Pickup code generation"]
end

subgraph group_state["Persistent state"]
end

node_student_actor(("Student"))
node_admin_actor(("Attendant"))

node_student_actor -->|"uses"| node_app
node_admin_actor -->|"opens desk"| node_app
node_app -->|"renders"| node_student_flow
node_app -->|"renders"| node_admin_dash
node_app -->|"opens login"| node_admin_login
node_student_flow -->|"presents upload"| node_upload
node_student_flow -->|"presents payment"| node_payment
node_student_flow -->|"presents tracking"| node_tracking
node_student_flow -->|"presents profile"| node_profile
node_student_flow -->|"presents orders"| node_orders_view
node_admin_dash -->|"presents queue"| node_queue
node_admin_dash -->|"presents pickup"| node_pickup
node_admin_dash -->|"presents history"| node_history
node_admin_dash -->|"presents settings"| node_station_ui
node_queue -->|"opens details"| node_inspection
node_upload -->|"submits order"| node_orders_api
node_payment -->|"submits payment choice"| node_orders_api
node_orders_view -->|"requests orders"| node_orders_api
node_tracking -->|"requests status"| node_orders_api
node_profile -->|"updates profile"| node_student_api
node_admin_login -->|"authenticates"| node_auth_api
node_queue -->|"updates status"| node_orders_api
node_pickup -->|"updates handover"| node_orders_api
node_inspection -->|"requests PDF"| node_orders_api
node_station_ui -->|"updates rates"| node_station_api
node_orders_api -->|"requests"| node_api_client
node_student_api -->|"requests"| node_api_client
node_auth_api -->|"requests"| node_api_client
node_station_api -->|"requests"| node_api_client
node_api_client -->|"sends HTTP"| node_server
node_server -->|"mounts"| node_order_routes
node_server -->|"mounts"| node_student_routes
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_station_routes
node_order_routes -->|"accepts upload"| node_upload_middleware
node_order_routes -->|"dispatches"| node_order_controller
node_student_routes -->|"dispatches"| node_student_controller
node_auth_routes -->|"dispatches"| node_auth_controller
node_station_routes -->|"dispatches"| node_station_controller
node_order_controller -->|"counts pages"| node_pdf_utils
node_order_controller -->|"calculates price"| node_pricing
node_order_controller -->|"generates code"| node_codegen

click node_app "https://github.com/kirtiraj01/printflow/blob/main/client/src/App.jsx"
click node_student_flow "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentApp.jsx"
click node_upload "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentUploadFlow.jsx"
click node_payment "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/PaymentModal.jsx"
click node_tracking "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/OrderStatusView.jsx"
click node_profile "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentProfile.jsx"
click node_orders_view "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentOrders.jsx"
click node_admin_login "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminLoginGate.jsx"
click node_admin_dash "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminDashboard.jsx"
click node_queue "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminOrderQueue.jsx"
click node_pickup "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminPickupList.jsx"
click node_history "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminHistoryList.jsx"
click node_inspection "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminOrderDetailModal.jsx"
click node_station_ui "https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminStationSettingsModal.jsx"
click node_api_client "https://github.com/kirtiraj01/printflow/blob/main/client/src/api/client.js"
click node_orders_api "https://github.com/kirtiraj01/printflow/blob/main/client/src/api/ordersApi.js"
click node_student_api "https://github.com/kirtiraj01/printflow/blob/main/client/src/api/studentsApi.js"
click node_auth_api "https://github.com/kirtiraj01/printflow/blob/main/client/src/api/authApi.js"
click node_station_api "https://github.com/kirtiraj01/printflow/blob/main/client/src/api/stationApi.js"
click node_server "https://github.com/kirtiraj01/printflow/blob/main/server/src/server.js"
click node_order_routes "https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/orderRoutes.js"
click node_student_routes "https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/studentRoutes.js"
click node_auth_routes "https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/authRoutes.js"
click node_station_routes "https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/stationRoutes.js"
click node_order_controller "https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/orderController.js"
click node_student_controller "https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/studentController.js"
click node_auth_controller "https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/authController.js"
click node_station_controller "https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/stationController.js"
click node_upload_middleware "https://github.com/kirtiraj01/printflow/blob/main/server/src/middleware/upload.js"
click node_pricing "https://github.com/kirtiraj01/printflow/blob/main/server/src/utils/priceCalculator.js"
click node_pdf_utils "https://github.com/kirtiraj01/printflow/blob/main/server/src/utils/pdfUtils.js"
click node_codegen "https://github.com/kirtiraj01/printflow/blob/main/server/src/utils/orderCodeGenerator.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_student_flow,node_upload,node_payment,node_tracking,node_profile,node_orders_view toneBlue
class node_admin_login,node_admin_dash,node_queue,node_pickup,node_history,node_inspection,node_station_ui toneAmber
class node_api_client,node_orders_api,node_student_api,node_auth_api,node_station_api toneMint
class node_server,node_order_routes,node_student_routes,node_auth_routes,node_station_routes,node_order_controller,node_student_controller,node_auth_controller,node_station_controller,node_upload_middleware,node_pricing,node_pdf_utils,node_codegen toneRose
class node_student_actor,node_admin_actor toneIndigo
```

## Components

### Student portal

- [Application shell](https://github.com/kirtiraj01/printflow/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Student ordering](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentApp.jsx): `client/src/components/student/StudentApp.jsx`
- [Upload and options](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentUploadFlow.jsx): `client/src/components/student/StudentUploadFlow.jsx`
- [Payment UI](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/PaymentModal.jsx): `client/src/components/student/PaymentModal.jsx`
- [Order tracking](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/OrderStatusView.jsx): `client/src/components/student/OrderStatusView.jsx`
- [Student profile](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentProfile.jsx): `client/src/components/student/StudentProfile.jsx`
- [Student orders](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/student/StudentOrders.jsx): `client/src/components/student/StudentOrders.jsx`

### Attendant desk

- [Attendant login](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminLoginGate.jsx): `client/src/components/admin/AdminLoginGate.jsx`
- [Attendant dashboard](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminDashboard.jsx): `client/src/components/admin/AdminDashboard.jsx`
- [Order triage](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminOrderQueue.jsx): `client/src/components/admin/AdminOrderQueue.jsx`
- [Pickup manager](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminPickupList.jsx): `client/src/components/admin/AdminPickupList.jsx`
- [Order history](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminHistoryList.jsx): `client/src/components/admin/AdminHistoryList.jsx`
- [PDF inspection](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminOrderDetailModal.jsx): `client/src/components/admin/AdminOrderDetailModal.jsx`
- [Station settings](https://github.com/kirtiraj01/printflow/blob/main/client/src/components/admin/AdminStationSettingsModal.jsx): `client/src/components/admin/AdminStationSettingsModal.jsx`

### Client API

- [HTTP client](https://github.com/kirtiraj01/printflow/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Orders API](https://github.com/kirtiraj01/printflow/blob/main/client/src/api/ordersApi.js): `client/src/api/ordersApi.js`
- [Student API](https://github.com/kirtiraj01/printflow/blob/main/client/src/api/studentsApi.js): `client/src/api/studentsApi.js`
- [Authentication API](https://github.com/kirtiraj01/printflow/blob/main/client/src/api/authApi.js): `client/src/api/authApi.js`
- [Station API](https://github.com/kirtiraj01/printflow/blob/main/client/src/api/stationApi.js): `client/src/api/stationApi.js`

### Backend services

- [HTTP server](https://github.com/kirtiraj01/printflow/blob/main/server/src/server.js): `server/src/server.js`
- [Order routes](https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/orderRoutes.js): `server/src/routes/orderRoutes.js`
- [Student routes](https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/studentRoutes.js): `server/src/routes/studentRoutes.js`
- [Auth routes](https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/authRoutes.js): `server/src/routes/authRoutes.js`
- [Station routes](https://github.com/kirtiraj01/printflow/blob/main/server/src/routes/stationRoutes.js): `server/src/routes/stationRoutes.js`
- [Order processing](https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/orderController.js): `server/src/controllers/orderController.js`
- [Student sessions](https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/studentController.js): `server/src/controllers/studentController.js`
- [Admin authentication](https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Station management](https://github.com/kirtiraj01/printflow/blob/main/server/src/controllers/stationController.js): `server/src/controllers/stationController.js`
- [PDF upload handling](https://github.com/kirtiraj01/printflow/blob/main/server/src/middleware/upload.js): `server/src/middleware/upload.js`
- [Price calculation](https://github.com/kirtiraj01/printflow/blob/main/server/src/utils/priceCalculator.js): `server/src/utils/priceCalculator.js`
- [PDF utilities](https://github.com/kirtiraj01/printflow/blob/main/server/src/utils/pdfUtils.js): `server/src/utils/pdfUtils.js`
- [Pickup code generation](https://github.com/kirtiraj01/printflow/blob/main/server/src/utils/orderCodeGenerator.js): `server/src/utils/orderCodeGenerator.js`

### Other components

- **Student**
- **Attendant**

## Connections

- Student → Application shell: uses
- Attendant → Application shell: opens desk
- Application shell → Student ordering: renders
- Application shell → Attendant dashboard: renders
- Application shell → Attendant login: opens login
- Student ordering → Upload and options: presents upload
- Student ordering → Payment UI: presents payment
- Student ordering → Order tracking: presents tracking
- Student ordering → Student profile: presents profile
- Student ordering → Student orders: presents orders
- Attendant dashboard → Order triage: presents queue
- Attendant dashboard → Pickup manager: presents pickup
- Attendant dashboard → Order history: presents history
- Attendant dashboard → Station settings: presents settings
- Order triage → PDF inspection: opens details
- Upload and options → Orders API: submits order
- Payment UI → Orders API: submits payment choice
- Student orders → Orders API: requests orders
- Order tracking → Orders API: requests status
- Student profile → Student API: updates profile
- Attendant login → Authentication API: authenticates
- Order triage → Orders API: updates status
- Pickup manager → Orders API: updates handover
- PDF inspection → Orders API: requests PDF
- Station settings → Station API: updates rates
- Orders API → HTTP client: requests
- Student API → HTTP client: requests
- Authentication API → HTTP client: requests
- Station API → HTTP client: requests
- HTTP client → HTTP server: sends HTTP
- HTTP server → Order routes: mounts
- HTTP server → Student routes: mounts
- HTTP server → Auth routes: mounts
- HTTP server → Station routes: mounts
- Order routes → PDF upload handling: accepts upload
- Order routes → Order processing: dispatches
- Student routes → Student sessions: dispatches
- Auth routes → Admin authentication: dispatches
- Station routes → Station management: dispatches
- Order processing → PDF utilities: counts pages
- Order processing → Price calculation: calculates price
- Order processing → Pickup code generation: generates code
