# mykrotechltd-dev/atelierhq architecture

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

- Interactive diagram: https://gitdiagram.com/mykrotechltd-dev/atelierhq
- Repository: https://github.com/mykrotechltd-dev/atelierhq

## Overview

AtelierHQ is a tailoring-shop ERP: shop users manage customers and orders, coordinate workers and tasks, track payments, and use reporting, billing, and garment-pattern tools; a separate platform-admin area oversees shops and operations. The browser entry routes users into these areas, while the sampled worker dialog/query code demonstrates a concrete edit-to-Supabase path. README content is only a product name, and most page/query wiring was not sampled, so those internal connections are intentionally not inferred.

Main entry points: [`Tailoring_ERP/src/App.tsx`](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/App.tsx) (Route application), [`Tailoring_ERP/src/pages/app/patterns/page.tsx`](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/patterns/page.tsx) (Pattern workspace), [`Tailoring_ERP/src/lib/supabase/client.ts`](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/supabase/client.ts) (Supabase client), [`Tailoring_ERP/src/pages/app/orders/page.tsx`](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/orders/page.tsx) (Order management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["Route application<br/>[App.tsx]"]
end

subgraph group_shop["Shop operations"]
  node_onboarding["Shop onboarding<br/>[page.tsx]"]
  node_dashboard["Shop dashboard<br/>[page.tsx]"]
  node_customers["Customer records<br/>[page.tsx]"]
  node_orders["Order management<br/>[page.tsx]"]
  node_workers["Worker management<br/>[page.tsx]"]
  node_worker_dialog["Worker editor<br/>[worker-dialog.tsx]"]
  node_tasks["Task tracking<br/>[page.tsx]"]
  node_payments["Payment records<br/>[page.tsx]"]
  node_reports["Shop reports<br/>[page.tsx]"]
  node_billing["Subscription billing<br/>[page.tsx]"]
  node_invoice_pdf["Invoice export<br/>[invoice-pdf.ts]"]
end

subgraph group_tailoring["Tailoring tools"]
  node_patterns["Pattern workspace<br/>[page.tsx]"]
  node_pattern_engine["Pattern drafting<br/>[pattern-engine.ts]"]
  node_pattern_pdf["Pattern export<br/>[pattern-pdf.ts]"]
end

subgraph group_platform["Platform administration"]
  node_admin_login["Admin sign-in<br/>[login.tsx]"]
  node_admin_dashboard["Admin dashboard<br/>[page.tsx]"]
  node_admin_shops["Shop oversight<br/>[page.tsx]"]
  node_admin_ops["Admin operations<br/>[page.tsx]"]
  node_admin_auth["Admin access check<br/>[admin-auth.tsx]"]
end

subgraph group_services["Data and services"]
  node_worker_queries["Worker data queries<br/>[workers.ts]"]
  node_supabase_client["Supabase client<br/>[client.ts]"]
  node_checkout_fn["Checkout function<br/>[index.ts]"]
  node_billing_fn["Billing function<br/>[index.ts]"]
end

node_browser(("Shop user"))
node_supabase[("Supabase backend")]
node_fincra["Fincra checkout"]

node_browser -->|"opens"| node_app
node_app -->|"routes"| node_onboarding
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_customers
node_app -->|"routes"| node_orders
node_app -->|"routes"| node_workers
node_app -->|"routes"| node_tasks
node_app -->|"routes"| node_payments
node_app -->|"routes"| node_reports
node_app -->|"routes"| node_billing
node_app -->|"routes"| node_patterns
node_app -->|"routes"| node_admin_login
node_app -->|"routes"| node_admin_dashboard
node_app -->|"routes"| node_admin_shops
node_app -->|"routes"| node_admin_ops
node_worker_dialog -->|"mutates workers"| node_worker_queries
node_worker_queries -->|"queries"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_admin_auth -->|"checks admin"| node_supabase_client
node_patterns --> node_pattern_engine
node_patterns --> node_pattern_pdf
node_orders --> node_invoice_pdf
node_checkout_fn -.->|"checkout request"| node_fincra
node_billing_fn -.->|"billing request"| node_fincra

click node_app "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/App.tsx"
click node_onboarding "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/onboarding/page.tsx"
click node_dashboard "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/dashboard/page.tsx"
click node_customers "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/customers/page.tsx"
click node_orders "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/orders/page.tsx"
click node_workers "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/workers/page.tsx"
click node_worker_dialog "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/workers/_components/worker-dialog.tsx"
click node_tasks "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/tasks/page.tsx"
click node_payments "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/payments/page.tsx"
click node_reports "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/reports/page.tsx"
click node_billing "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/billing/page.tsx"
click node_patterns "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/patterns/page.tsx"
click node_pattern_engine "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/pattern-engine.ts"
click node_pattern_pdf "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/pattern-pdf.ts"
click node_invoice_pdf "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/invoice-pdf.ts"
click node_admin_login "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/login.tsx"
click node_admin_dashboard "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/dashboard/page.tsx"
click node_admin_shops "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/shops/page.tsx"
click node_admin_ops "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/orders/page.tsx"
click node_admin_auth "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/components/providers/admin-auth.tsx"
click node_worker_queries "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/queries/workers.ts"
click node_supabase_client "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/supabase/client.ts"
click node_checkout_fn "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/supabase/functions/fincra-checkout/index.ts"
click node_billing_fn "https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/supabase/functions/subscription-billing/index.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_browser toneBlue
class node_onboarding,node_dashboard,node_customers,node_orders,node_workers,node_worker_dialog,node_tasks,node_payments,node_reports,node_billing,node_invoice_pdf,node_supabase toneAmber
class node_patterns,node_pattern_engine,node_pattern_pdf toneMint
class node_admin_login,node_admin_dashboard,node_admin_shops,node_admin_ops,node_admin_auth toneRose
class node_worker_queries,node_supabase_client,node_checkout_fn,node_billing_fn,node_fincra toneIndigo
```

## Components

### App entry

- [Route application](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/App.tsx): `Tailoring_ERP/src/App.tsx`

### Shop operations

- [Shop onboarding](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/onboarding/page.tsx): `Tailoring_ERP/src/pages/onboarding/page.tsx`
- [Shop dashboard](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/dashboard/page.tsx): `Tailoring_ERP/src/pages/app/dashboard/page.tsx`
- [Customer records](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/customers/page.tsx): `Tailoring_ERP/src/pages/app/customers/page.tsx`
- [Order management](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/orders/page.tsx): `Tailoring_ERP/src/pages/app/orders/page.tsx`
- [Worker management](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/workers/page.tsx): `Tailoring_ERP/src/pages/app/workers/page.tsx`
- [Worker editor](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/workers/_components/worker-dialog.tsx): `Tailoring_ERP/src/pages/app/workers/_components/worker-dialog.tsx`
- [Task tracking](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/tasks/page.tsx): `Tailoring_ERP/src/pages/app/tasks/page.tsx`
- [Payment records](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/payments/page.tsx): `Tailoring_ERP/src/pages/app/payments/page.tsx`
- [Shop reports](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/reports/page.tsx): `Tailoring_ERP/src/pages/app/reports/page.tsx`
- [Subscription billing](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/billing/page.tsx): `Tailoring_ERP/src/pages/app/billing/page.tsx`
- [Invoice export](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/invoice-pdf.ts): `Tailoring_ERP/src/lib/invoice-pdf.ts`

### Tailoring tools

- [Pattern workspace](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/app/patterns/page.tsx): `Tailoring_ERP/src/pages/app/patterns/page.tsx`
- [Pattern drafting](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/pattern-engine.ts): `Tailoring_ERP/src/lib/pattern-engine.ts`
- [Pattern export](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/pattern-pdf.ts): `Tailoring_ERP/src/lib/pattern-pdf.ts`

### Platform administration

- [Admin sign-in](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/login.tsx): `Tailoring_ERP/src/pages/admin/login.tsx`
- [Admin dashboard](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/dashboard/page.tsx): `Tailoring_ERP/src/pages/admin/dashboard/page.tsx`
- [Shop oversight](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/shops/page.tsx): `Tailoring_ERP/src/pages/admin/shops/page.tsx`
- [Admin operations](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/pages/admin/orders/page.tsx): `Tailoring_ERP/src/pages/admin/orders/page.tsx`
- [Admin access check](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/components/providers/admin-auth.tsx): `Tailoring_ERP/src/components/providers/admin-auth.tsx`

### Data and services

- [Worker data queries](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/queries/workers.ts): `Tailoring_ERP/src/lib/queries/workers.ts`
- [Supabase client](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/src/lib/supabase/client.ts): `Tailoring_ERP/src/lib/supabase/client.ts`
- [Checkout function](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/supabase/functions/fincra-checkout/index.ts): `Tailoring_ERP/supabase/functions/fincra-checkout/index.ts`
- [Billing function](https://github.com/mykrotechltd-dev/atelierhq/blob/main/Tailoring_ERP/supabase/functions/subscription-billing/index.ts): `Tailoring_ERP/supabase/functions/subscription-billing/index.ts`

### Other components

- **Shop user**
- **Supabase backend**
- **Fincra checkout**

## Connections

- Shop user → Route application: opens
- Route application → Shop onboarding: routes
- Route application → Shop dashboard: routes
- Route application → Customer records: routes
- Route application → Order management: routes
- Route application → Worker management: routes
- Route application → Task tracking: routes
- Route application → Payment records: routes
- Route application → Shop reports: routes
- Route application → Subscription billing: routes
- Route application → Pattern workspace: routes
- Route application → Admin sign-in: routes
- Route application → Admin dashboard: routes
- Route application → Shop oversight: routes
- Route application → Admin operations: routes
- Worker editor → Worker data queries: mutates workers
- Worker data queries → Supabase client: queries
- Supabase client → Supabase backend: connects
- Admin access check → Supabase client: checks admin
- Pattern workspace → Pattern drafting
- Pattern workspace → Pattern export
- Order management → Invoice export
- Checkout function → Fincra checkout: checkout request
- Billing function → Fincra checkout: billing request
