# artixxkrieger/artixpos architecture

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

- Interactive diagram: https://gitdiagram.com/artixxkrieger/artixpos
- Repository: https://github.com/artixxkrieger/artixpos

## Overview

ArtixPOS is an industry-adapted, multi-branch point-of-sale platform. The main workflow is staff using the register to record sales, with product and inventory data supporting operations and sales/reporting features available alongside it. The README documents offline selling and later synchronization, plus industry-specific modules. The source excerpts show client query caching and server persistence/auth patterns; many feature routes are unsampled, so their detailed call paths are omitted.

Main entry points: [`server/routes/sales.ts`](https://github.com/artixxkrieger/artixpos/blob/main/server/routes/sales.ts) (Sales endpoints), [`server/db.ts`](https://github.com/artixxkrieger/artixpos/blob/main/server/db.ts) (Database access), [`client/src/lib/queryClient.ts`](https://github.com/artixxkrieger/artixpos/blob/main/client/src/lib/queryClient.ts) (API and query cache), [`client/src/App.tsx`](https://github.com/artixxkrieger/artixpos/blob/main/client/src/App.tsx) (POS application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront"]
  node_app["POS application<br/>[App.tsx]"]
  node_client_api["API and query cache<br/>[queryClient.ts]"]
  node_offline[("Offline storage<br/>[offline-db.ts]")]
end

subgraph group_sales["Sales and stock"]
  node_sales_ui["Register and sales<br/>[pos.tsx]"]
  node_products_ui["Products and inventory<br/>[inventory-hub.tsx]"]
  node_sales_routes["Sales endpoints<br/>[sales.ts]"]
  node_products_routes["Product endpoints<br/>[products.ts]"]
end

subgraph group_operations["Business operations"]
  node_industry["Industry workflows"]
  node_analytics["Analytics and reports<br/>[analytics.tsx]"]
  node_payroll["Staff and payroll<br/>[payroll-routes.ts]"]
  node_admin_routes["Admin endpoints<br/>[admin-routes.ts]"]
  node_admin_store["Tenant administration<br/>[admin-storage.ts]"]
end

subgraph group_platform["Server platform"]
  node_auth["Authentication<br/>[core.ts]"]
  node_middleware["Access controls<br/>[middleware.ts]"]
  node_route_utils["Route utilities<br/>[route-utils.ts]"]
  node_cache["Server cache<br/>[cache.ts]"]
  node_brute_force["Login protection<br/>[brute-force.ts]"]
  node_redis[("Redis service<br/>[redis.ts]")]
end

subgraph group_data["Persistence"]
  node_sales_store["Sales persistence<br/>[sales.ts]"]
  node_inventory_store["Inventory persistence<br/>[inventory.ts]"]
  node_db[("Database access<br/>[db.ts]")]
  node_storage["Storage facade<br/>[index.ts]"]
  node_base["Persistence base<br/>[base.ts]"]
  node_schema["Data model<br/>[schema.ts]"]
  node_shifts_store["Shift persistence<br/>[shifts.ts]"]
end

node_staff(("Store staff"))

node_staff -->|"uses"| node_app
node_app -->|"opens register"| node_sales_ui
node_sales_ui -.->|"requests data"| node_client_api
node_client_api -->|"caches responses"| node_offline
node_client_api -.->|"calls API"| node_sales_routes
node_products_ui -.->|"requests data"| node_client_api
node_sales_routes -->|"uses persistence"| node_sales_store
node_sales_routes -->|"reads shifts"| node_shifts_store
node_products_routes -.->|"uses persistence"| node_inventory_store
node_industry -->|"routed by"| node_app
node_staff -->|"uses"| node_industry
node_staff -->|"reviews reports"| node_analytics
node_staff -->|"manages payroll"| node_payroll
node_admin_routes -->|"calls"| node_admin_store
node_admin_routes -->|"records failures"| node_brute_force
node_brute_force -->|"uses"| node_redis
node_sales_routes -->|"uses access checks"| node_middleware
node_sales_routes -->|"uses helpers"| node_route_utils
node_auth -->|"queries"| node_db
node_middleware -->|"queries"| node_db
node_admin_store -->|"queries"| node_db
node_storage -->|"delegates"| node_sales_store
node_storage -->|"delegates"| node_inventory_store
node_sales_store -.->|"uses base"| node_base
node_inventory_store -->|"uses base"| node_base
node_base -->|"queries"| node_db
node_db -->|"maps models"| node_schema
node_sales_routes -->|"invalidates"| node_cache

click node_app "https://github.com/artixxkrieger/artixpos/blob/main/client/src/App.tsx"
click node_client_api "https://github.com/artixxkrieger/artixpos/blob/main/client/src/lib/queryClient.ts"
click node_offline "https://github.com/artixxkrieger/artixpos/blob/main/client/src/lib/offline-db.ts"
click node_sales_ui "https://github.com/artixxkrieger/artixpos/blob/main/client/src/pages/pos.tsx"
click node_products_ui "https://github.com/artixxkrieger/artixpos/blob/main/client/src/pages/inventory-hub.tsx"
click node_sales_routes "https://github.com/artixxkrieger/artixpos/blob/main/server/routes/sales.ts"
click node_sales_store "https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/sales.ts"
click node_products_routes "https://github.com/artixxkrieger/artixpos/blob/main/server/routes/products.ts"
click node_inventory_store "https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/inventory.ts"
click node_industry "https://github.com/artixxkrieger/artixpos/tree/main/client/src/pages"
click node_analytics "https://github.com/artixxkrieger/artixpos/blob/main/client/src/pages/analytics.tsx"
click node_payroll "https://github.com/artixxkrieger/artixpos/blob/main/server/payroll-routes.ts"
click node_admin_routes "https://github.com/artixxkrieger/artixpos/blob/main/server/admin-routes.ts"
click node_admin_store "https://github.com/artixxkrieger/artixpos/blob/main/server/admin-storage.ts"
click node_auth "https://github.com/artixxkrieger/artixpos/blob/main/server/auth/core.ts"
click node_middleware "https://github.com/artixxkrieger/artixpos/blob/main/server/middleware.ts"
click node_route_utils "https://github.com/artixxkrieger/artixpos/blob/main/server/lib/route-utils.ts"
click node_cache "https://github.com/artixxkrieger/artixpos/blob/main/server/cache.ts"
click node_brute_force "https://github.com/artixxkrieger/artixpos/blob/main/server/brute-force.ts"
click node_redis "https://github.com/artixxkrieger/artixpos/blob/main/server/redis.ts"
click node_db "https://github.com/artixxkrieger/artixpos/blob/main/server/db.ts"
click node_storage "https://github.com/artixxkrieger/artixpos/blob/main/server/storage/index.ts"
click node_base "https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/base.ts"
click node_schema "https://github.com/artixxkrieger/artixpos/blob/main/shared/schema.ts"
click node_shifts_store "https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/shifts.ts"

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_client_api,node_offline toneBlue
class node_sales_ui,node_products_ui,node_sales_routes,node_products_routes toneAmber
class node_industry,node_analytics,node_payroll,node_admin_routes,node_admin_store toneMint
class node_auth,node_middleware,node_route_utils,node_cache,node_brute_force,node_redis toneRose
class node_sales_store,node_inventory_store,node_db,node_storage,node_base,node_schema,node_shifts_store,node_staff toneIndigo
```

## Components

### Storefront

- [POS application](https://github.com/artixxkrieger/artixpos/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [API and query cache](https://github.com/artixxkrieger/artixpos/blob/main/client/src/lib/queryClient.ts): `client/src/lib/queryClient.ts`
- [Offline storage](https://github.com/artixxkrieger/artixpos/blob/main/client/src/lib/offline-db.ts): `client/src/lib/offline-db.ts`

### Sales and stock

- [Register and sales](https://github.com/artixxkrieger/artixpos/blob/main/client/src/pages/pos.tsx): `client/src/pages/pos.tsx`
- [Products and inventory](https://github.com/artixxkrieger/artixpos/blob/main/client/src/pages/inventory-hub.tsx): `client/src/pages/inventory-hub.tsx`
- [Sales endpoints](https://github.com/artixxkrieger/artixpos/blob/main/server/routes/sales.ts): `server/routes/sales.ts`
- [Product endpoints](https://github.com/artixxkrieger/artixpos/blob/main/server/routes/products.ts): `server/routes/products.ts`

### Business operations

- [Industry workflows](https://github.com/artixxkrieger/artixpos/tree/main/client/src/pages): `client/src/pages`
- [Analytics and reports](https://github.com/artixxkrieger/artixpos/blob/main/client/src/pages/analytics.tsx): `client/src/pages/analytics.tsx`
- [Staff and payroll](https://github.com/artixxkrieger/artixpos/blob/main/server/payroll-routes.ts): `server/payroll-routes.ts`
- [Admin endpoints](https://github.com/artixxkrieger/artixpos/blob/main/server/admin-routes.ts): `server/admin-routes.ts`
- [Tenant administration](https://github.com/artixxkrieger/artixpos/blob/main/server/admin-storage.ts): `server/admin-storage.ts`

### Server platform

- [Authentication](https://github.com/artixxkrieger/artixpos/blob/main/server/auth/core.ts): `server/auth/core.ts`
- [Access controls](https://github.com/artixxkrieger/artixpos/blob/main/server/middleware.ts): `server/middleware.ts`
- [Route utilities](https://github.com/artixxkrieger/artixpos/blob/main/server/lib/route-utils.ts): `server/lib/route-utils.ts`
- [Server cache](https://github.com/artixxkrieger/artixpos/blob/main/server/cache.ts): `server/cache.ts`
- [Login protection](https://github.com/artixxkrieger/artixpos/blob/main/server/brute-force.ts): `server/brute-force.ts`
- [Redis service](https://github.com/artixxkrieger/artixpos/blob/main/server/redis.ts): `server/redis.ts`

### Persistence

- [Sales persistence](https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/sales.ts): `server/infrastructure/persistence/sales.ts`
- [Inventory persistence](https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/inventory.ts): `server/infrastructure/persistence/inventory.ts`
- [Database access](https://github.com/artixxkrieger/artixpos/blob/main/server/db.ts): `server/db.ts`
- [Storage facade](https://github.com/artixxkrieger/artixpos/blob/main/server/storage/index.ts): `server/storage/index.ts`
- [Persistence base](https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/base.ts): `server/infrastructure/persistence/base.ts`
- [Data model](https://github.com/artixxkrieger/artixpos/blob/main/shared/schema.ts): `shared/schema.ts`
- [Shift persistence](https://github.com/artixxkrieger/artixpos/blob/main/server/infrastructure/persistence/shifts.ts): `server/infrastructure/persistence/shifts.ts`

### Other components

- **Store staff**

## Connections

- Store staff → POS application: uses (evidence: `README.md`)
- POS application → Register and sales: opens register (evidence: `client/src/App.tsx`)
- Register and sales → API and query cache: requests data
- API and query cache → Offline storage: caches responses (evidence: `client/src/lib/queryClient.ts`)
- API and query cache → Sales endpoints: calls API
- Products and inventory → API and query cache: requests data
- Sales endpoints → Sales persistence: uses persistence (evidence: `server/routes/sales.ts`)
- Sales endpoints → Shift persistence: reads shifts (evidence: `server/routes/sales.ts`)
- Product endpoints → Inventory persistence: uses persistence
- Industry workflows → POS application: routed by (evidence: `client/src/App.tsx`)
- Store staff → Industry workflows: uses (evidence: `README.md`)
- Store staff → Analytics and reports: reviews reports (evidence: `README.md`)
- Store staff → Staff and payroll: manages payroll (evidence: `README.md`)
- Admin endpoints → Tenant administration: calls (evidence: `server/admin-routes.ts`)
- Admin endpoints → Login protection: records failures (evidence: `server/admin-routes.ts`)
- Login protection → Redis service: uses (evidence: `server/brute-force.ts`)
- Sales endpoints → Access controls: uses access checks (evidence: `server/routes/sales.ts`)
- Sales endpoints → Route utilities: uses helpers (evidence: `server/routes/sales.ts`)
- Authentication → Database access: queries (evidence: `server/auth/core.ts`)
- Access controls → Database access: queries (evidence: `server/middleware.ts`)
- Tenant administration → Database access: queries (evidence: `server/admin-storage.ts`)
- Storage facade → Sales persistence: delegates (evidence: `server/storage/index.ts`)
- Storage facade → Inventory persistence: delegates (evidence: `server/storage/index.ts`)
- Sales persistence → Persistence base: uses base
- Inventory persistence → Persistence base: uses base (evidence: `server/infrastructure/persistence/inventory.ts`)
- Persistence base → Database access: queries (evidence: `server/infrastructure/persistence/base.ts`)
- Database access → Data model: maps models (evidence: `server/db.ts`)
- Sales endpoints → Server cache: invalidates (evidence: `server/routes/sales.ts`)
