# vishnuat18/xerox architecture

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

- Interactive diagram: https://gitdiagram.com/vishnuat18/xerox
- Repository: https://github.com/vishnuat18/xerox

## Overview

Smart Print Hub is a Next.js application for Xerox-shop operations. The visible workflow covers shop-owner registration and setup, authenticated shop management, and a customer-facing shop page reached by a shop slug or QR code. The landing page also describes document upload, print configuration, local Windows printing, and privacy features, but those product capabilities are not evidenced as implemented by the sampled runtime. The graph preserves them as documented capabilities; dashed edges mark those unverified integrations.

Main entry points: [`src/lib/db.ts`](https://github.com/vishnuat18/xerox/blob/master/src/lib/db.ts) (Prisma client), [`src/lib/auth.ts`](https://github.com/vishnuat18/xerox/blob/master/src/lib/auth.ts) (Auth & sessions), [`src/app/dashboard/page.tsx`](https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/page.tsx) (Owner dashboard), [`src/components/ui`](https://github.com/vishnuat18/xerox/tree/master/src/components/ui) (Shared UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Experience"]
  node_home["Home page<br/>[page.tsx]"]
  node_authpages["Login &amp; registration<br/>[page.tsx]"]
  node_dashboard["Owner dashboard<br/>[page.tsx]"]
  node_dashboardnav["Dashboard navigation<br/>[dashboard-nav.tsx]"]
  node_qrview["QR dashboard<br/>[page.tsx]"]
  node_settings["Shop settings<br/>[page.tsx]"]
  node_shopview["Shop landing<br/>[page.tsx]"]
  node_ui["Shared UI"]
end

subgraph group_api["API Workflows"]
  node_registerapi["Owner registration<br/>[route.ts]"]
  node_profileapi["Shop profile API<br/>[route.ts]"]
  node_qrapi["Shop QR API<br/>[route.ts]"]
  node_authapi["Session endpoints<br/>[route.ts]"]
end

subgraph group_identity["Identity &amp; Responses"]
  node_auth["Auth &amp; sessions<br/>[auth.ts]"]
  node_responses["API responses<br/>[api-response.ts]"]
  node_qr["QR generation<br/>[qr.ts]"]
end

subgraph group_data["Persistence"]
  node_dbclient["Prisma client<br/>[db.ts]"]
  node_database[("Shop data<br/>[schema.prisma]")]
end

node_owner(("Shop owner"))
node_customer(("Print customer"))
node_printagent["Windows print agent"]
node_printers["Printer hardware"]

node_owner -->|"opens"| node_authpages
node_owner -->|"manages shop"| node_dashboard
node_customer -->|"visits shop"| node_shopview
node_home -->|"resolves session"| node_auth
node_home -->|"reads shop stats"| node_dbclient
node_home -->|"renders"| node_ui
node_dashboard -->|"uses session"| node_auth
node_dashboard -->|"reads shop data"| node_dbclient
node_dashboard -->|"renders"| node_ui
node_dashboard -->|"uses navigation"| node_dashboardnav
node_qrview -->|"renders"| node_ui
node_settings -->|"renders"| node_ui
node_shopview -->|"reads shop"| node_dbclient
node_shopview -->|"renders"| node_ui
node_registerapi -->|"creates shop account"| node_dbclient
node_registerapi -->|"creates session"| node_auth
node_registerapi -->|"formats result"| node_responses
node_profileapi -->|"requires session"| node_auth
node_profileapi -->|"reads and updates"| node_dbclient
node_profileapi -->|"formats result"| node_responses
node_qrapi -->|"requires session"| node_auth
node_qrapi -->|"reads shop"| node_dbclient
node_qrapi -->|"generates QR"| node_qr
node_qrapi -->|"formats result"| node_responses
node_authapi -->|"resolves session"| node_auth
node_authapi -->|"formats result"| node_responses
node_auth -->|"loads user"| node_dbclient
node_dbclient -.->|"queries"| node_database
node_customer -.->|"uploads and configures"| node_printagent
node_printagent -.->|"dispatches jobs"| node_printers

click node_home "https://github.com/vishnuat18/xerox/blob/master/src/app/page.tsx"
click node_authpages "https://github.com/vishnuat18/xerox/blob/master/src/app/register/page.tsx"
click node_dashboard "https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/page.tsx"
click node_dashboardnav "https://github.com/vishnuat18/xerox/blob/master/src/components/dashboard/dashboard-nav.tsx"
click node_qrview "https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/qr/page.tsx"
click node_settings "https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/settings/page.tsx"
click node_shopview "https://github.com/vishnuat18/xerox/blob/master/src/app/s/%5Bslug%5D/page.tsx"
click node_registerapi "https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/auth/register-owner/route.ts"
click node_profileapi "https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/shops/profile/route.ts"
click node_qrapi "https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/shops/qr/route.ts"
click node_authapi "https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/auth/me/route.ts"
click node_auth "https://github.com/vishnuat18/xerox/blob/master/src/lib/auth.ts"
click node_responses "https://github.com/vishnuat18/xerox/blob/master/src/lib/api-response.ts"
click node_qr "https://github.com/vishnuat18/xerox/blob/master/src/lib/qr.ts"
click node_dbclient "https://github.com/vishnuat18/xerox/blob/master/src/lib/db.ts"
click node_database "https://github.com/vishnuat18/xerox/blob/master/prisma/schema.prisma"
click node_ui "https://github.com/vishnuat18/xerox/tree/master/src/components/ui"

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_home,node_authpages,node_dashboard,node_dashboardnav,node_qrview,node_settings,node_shopview,node_ui toneBlue
class node_registerapi,node_profileapi,node_qrapi,node_authapi toneAmber
class node_auth,node_responses,node_qr toneMint
class node_dbclient,node_database toneRose
class node_owner,node_customer,node_printagent,node_printers toneIndigo
```

## Components

### Web Experience

- [Home page](https://github.com/vishnuat18/xerox/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Login & registration](https://github.com/vishnuat18/xerox/blob/master/src/app/register/page.tsx): `src/app/register/page.tsx`
- [Owner dashboard](https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Dashboard navigation](https://github.com/vishnuat18/xerox/blob/master/src/components/dashboard/dashboard-nav.tsx): `src/components/dashboard/dashboard-nav.tsx`
- [QR dashboard](https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/qr/page.tsx): `src/app/dashboard/qr/page.tsx`
- [Shop settings](https://github.com/vishnuat18/xerox/blob/master/src/app/dashboard/settings/page.tsx): `src/app/dashboard/settings/page.tsx`
- [Shop landing](https://github.com/vishnuat18/xerox/blob/master/src/app/s/%5Bslug%5D/page.tsx): `src/app/s/[slug]/page.tsx`
- [Shared UI](https://github.com/vishnuat18/xerox/tree/master/src/components/ui): `src/components/ui`

### API Workflows

- [Owner registration](https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/auth/register-owner/route.ts): `src/app/api/v1/auth/register-owner/route.ts`
- [Shop profile API](https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/shops/profile/route.ts): `src/app/api/v1/shops/profile/route.ts`
- [Shop QR API](https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/shops/qr/route.ts): `src/app/api/v1/shops/qr/route.ts`
- [Session endpoints](https://github.com/vishnuat18/xerox/blob/master/src/app/api/v1/auth/me/route.ts): `src/app/api/v1/auth/me/route.ts`

### Identity & Responses

- [Auth & sessions](https://github.com/vishnuat18/xerox/blob/master/src/lib/auth.ts): `src/lib/auth.ts`
- [API responses](https://github.com/vishnuat18/xerox/blob/master/src/lib/api-response.ts): `src/lib/api-response.ts`
- [QR generation](https://github.com/vishnuat18/xerox/blob/master/src/lib/qr.ts): `src/lib/qr.ts`

### Persistence

- [Prisma client](https://github.com/vishnuat18/xerox/blob/master/src/lib/db.ts): `src/lib/db.ts`
- [Shop data](https://github.com/vishnuat18/xerox/blob/master/prisma/schema.prisma): `prisma/schema.prisma`

### Other components

- **Shop owner**
- **Print customer**
- **Windows print agent**
- **Printer hardware**

## Connections

- Shop owner → Login & registration: opens
- Shop owner → Owner dashboard: manages shop
- Print customer → Shop landing: visits shop
- Home page → Auth & sessions: resolves session (evidence: `src/app/page.tsx`)
- Home page → Prisma client: reads shop stats (evidence: `src/app/page.tsx`)
- Home page → Shared UI: renders (evidence: `src/app/page.tsx`)
- Owner dashboard → Auth & sessions: uses session (evidence: `src/app/dashboard/page.tsx`)
- Owner dashboard → Prisma client: reads shop data (evidence: `src/app/dashboard/page.tsx`)
- Owner dashboard → Shared UI: renders (evidence: `src/app/dashboard/page.tsx`)
- Owner dashboard → Dashboard navigation: uses navigation
- QR dashboard → Shared UI: renders (evidence: `src/app/dashboard/qr/page.tsx`)
- Shop settings → Shared UI: renders (evidence: `src/app/dashboard/settings/page.tsx`)
- Shop landing → Prisma client: reads shop (evidence: `src/app/s/[slug]/page.tsx`)
- Shop landing → Shared UI: renders (evidence: `src/app/s/[slug]/page.tsx`)
- Owner registration → Prisma client: creates shop account (evidence: `src/app/api/v1/auth/register-owner/route.ts`)
- Owner registration → Auth & sessions: creates session (evidence: `src/app/api/v1/auth/register-owner/route.ts`)
- Owner registration → API responses: formats result (evidence: `src/app/api/v1/auth/register-owner/route.ts`)
- Shop profile API → Auth & sessions: requires session (evidence: `src/app/api/v1/shops/profile/route.ts`)
- Shop profile API → Prisma client: reads and updates (evidence: `src/app/api/v1/shops/profile/route.ts`)
- Shop profile API → API responses: formats result (evidence: `src/app/api/v1/shops/profile/route.ts`)
- Shop QR API → Auth & sessions: requires session (evidence: `src/app/api/v1/shops/qr/route.ts`)
- Shop QR API → Prisma client: reads shop (evidence: `src/app/api/v1/shops/qr/route.ts`)
- Shop QR API → QR generation: generates QR (evidence: `src/app/api/v1/shops/qr/route.ts`)
- Shop QR API → API responses: formats result (evidence: `src/app/api/v1/shops/qr/route.ts`)
- Session endpoints → Auth & sessions: resolves session (evidence: `src/app/api/v1/auth/me/route.ts`)
- Session endpoints → API responses: formats result (evidence: `src/app/api/v1/auth/me/route.ts`)
- Auth & sessions → Prisma client: loads user (evidence: `src/lib/auth.ts`)
- Prisma client → Shop data: queries
- Print customer → Windows print agent: uploads and configures
- Windows print agent → Printer hardware: dispatches jobs
