# jelisse/last-website-framy-connect architecture

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

- Interactive diagram: https://gitdiagram.com/jelisse/last-website-framy-connect
- Repository: https://github.com/jelisse/last-website-framy-connect

## Overview

Framy Connect is a private preview web application for customizable public profiles, product purchases, and account and business operations. A customer signs in, edits a profile or configures an order, and uses the workspace APIs to save data; public profile pages expose the published projection. Managers review orders and move them through fulfilment, while finance and subscription views support operational oversight. The README describes sandbox behavior and explicitly says production payments and several other integrations are not implemented. Edges reflect the README and source-index references; unsampled implementation details are not inferred.

Main entry points: [`app/api/workspace/route.ts`](https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/workspace/route.ts) (Workspace API), [`app/[slug]/page.tsx`](https://github.com/jelisse/last-website-framy-connect/blob/main/app/%5Bslug%5D/page.tsx) (Public profile), [`lib/server-db.ts`](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-db.ts) (D1 database), [`components/manager-workspace.tsx`](https://github.com/jelisse/last-website-framy-connect/blob/main/components/manager-workspace.tsx) (Manager workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Customer experience"]
  node_storefront["Storefront<br/>[page.tsx]"]
  node_catalogue["Product catalogue<br/>[page.tsx]"]
  node_purchase["Purchase configuration"]
  node_dashboard["Customer dashboard<br/>[page.tsx]"]
  node_workspaceui["Customer workspace<br/>[workspace.tsx]"]
end

subgraph group_profile["Profiles and plans"]
  node_profilepage["Public profile<br/>[page.tsx]"]
  node_profiledomain["Profile rules<br/>[domain.ts]"]
  node_plans["Plan entitlements<br/>[entitlement.ts]"]
  node_profileaccess["Profile access"]
  node_workspaceapi["Workspace API<br/>[route.ts]"]
end

subgraph group_commerce["Orders and fulfilment"]
  node_orderapi["Manager order API<br/>[route.ts]"]
  node_paysuite["PaySuite integration<br/>[server-paysuite.ts]"]
end

subgraph group_operations["Business operations"]
  node_managerui["Manager workspace"]
  node_financeapi["Finance API<br/>[route.ts]"]
  node_financeui["Finance view"]
  node_subscriptions["Subscription management"]
end

subgraph group_platform["Runtime services"]
  node_auth["Session authentication<br/>[chatgpt-auth.ts]"]
  node_serverauth["Server auth<br/>[server-auth.ts]"]
  node_catalogservice["Server catalogue<br/>[server-catalog.ts]"]
  node_financecalc["Finance reporting<br/>[finance-report.ts]"]
  node_database[("D1 database<br/>[server-db.ts]")]
end

node_customer(("Customer"))
node_manager(("Manager"))

node_customer -->|"browses"| node_storefront
node_storefront -->|"links to"| node_catalogue
node_customer -->|"searches products"| node_catalogue
node_customer -->|"configures order"| node_purchase
node_customer -->|"opens account"| node_dashboard
node_dashboard -->|"renders"| node_workspaceui
node_workspaceui -.->|"loads and saves"| node_workspaceapi
node_workspaceapi -->|"checks session"| node_auth
node_auth -->|"reads session"| node_serverauth
node_workspaceapi -->|"reads and writes"| node_database
node_workspaceapi -->|"loads products"| node_catalogservice
node_catalogservice -->|"reads products"| node_database
node_workspaceapi -->|"checks entitlements"| node_plans
node_profilepage -->|"loads profile access"| node_profileaccess
node_profilepage -->|"uses profile rules"| node_profiledomain
node_profilepage -->|"checks entitlements"| node_plans
node_profilepage -->|"reads profile data"| node_database
node_manager -->|"manages operations"| node_managerui
node_managerui -.->|"updates orders"| node_orderapi
node_orderapi -->|"checks session"| node_auth
node_orderapi -->|"reads and writes"| node_database
node_managerui -->|"renders"| node_financeui
node_financeui -->|"uses reports"| node_financecalc
node_managerui -->|"renders"| node_subscriptions
node_financeapi -->|"checks session"| node_auth
node_financeapi -->|"reads finance data"| node_database
node_financeapi -->|"builds reports"| node_financecalc
node_customer -->|"views published profile"| node_profilepage
node_purchase -.->|"optional checkout"| node_paysuite

click node_storefront "https://github.com/jelisse/last-website-framy-connect/blob/main/app/page.tsx"
click node_catalogue "https://github.com/jelisse/last-website-framy-connect/blob/main/app/produtos/page.tsx"
click node_purchase "https://github.com/jelisse/last-website-framy-connect/blob/main/components/purchase-configurator.tsx"
click node_dashboard "https://github.com/jelisse/last-website-framy-connect/blob/main/app/dashboard/page.tsx"
click node_workspaceui "https://github.com/jelisse/last-website-framy-connect/blob/main/components/workspace.tsx"
click node_profilepage "https://github.com/jelisse/last-website-framy-connect/blob/main/app/%5Bslug%5D/page.tsx"
click node_profiledomain "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/domain.ts"
click node_plans "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/entitlement.ts"
click node_profileaccess "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-profile-access.ts"
click node_workspaceapi "https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/workspace/route.ts"
click node_orderapi "https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/manager/route.ts"
click node_managerui "https://github.com/jelisse/last-website-framy-connect/blob/main/components/manager-workspace.tsx"
click node_financeapi "https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/manager-finance/route.ts"
click node_financeui "https://github.com/jelisse/last-website-framy-connect/blob/main/components/finance-manager.tsx"
click node_subscriptions "https://github.com/jelisse/last-website-framy-connect/blob/main/components/subscription-manager.tsx"
click node_auth "https://github.com/jelisse/last-website-framy-connect/blob/main/app/chatgpt-auth.ts"
click node_serverauth "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-auth.ts"
click node_catalogservice "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-catalog.ts"
click node_financecalc "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/finance-report.ts"
click node_database "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-db.ts"
click node_paysuite "https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-paysuite.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_storefront,node_catalogue,node_purchase,node_dashboard,node_workspaceui toneBlue
class node_profilepage,node_profiledomain,node_plans,node_profileaccess,node_workspaceapi toneAmber
class node_orderapi,node_paysuite toneMint
class node_managerui,node_financeapi,node_financeui,node_subscriptions toneRose
class node_auth,node_serverauth,node_catalogservice,node_financecalc,node_database,node_customer,node_manager toneIndigo
```

## Components

### Customer experience

- [Storefront](https://github.com/jelisse/last-website-framy-connect/blob/main/app/page.tsx): `app/page.tsx`
- [Product catalogue](https://github.com/jelisse/last-website-framy-connect/blob/main/app/produtos/page.tsx): `app/produtos/page.tsx`
- [Purchase configuration](https://github.com/jelisse/last-website-framy-connect/blob/main/components/purchase-configurator.tsx): `components/purchase-configurator.tsx`
- [Customer dashboard](https://github.com/jelisse/last-website-framy-connect/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Customer workspace](https://github.com/jelisse/last-website-framy-connect/blob/main/components/workspace.tsx): `components/workspace.tsx`

### Profiles and plans

- [Public profile](https://github.com/jelisse/last-website-framy-connect/blob/main/app/%5Bslug%5D/page.tsx): `app/[slug]/page.tsx`
- [Profile rules](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/domain.ts): `lib/domain.ts`
- [Plan entitlements](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/entitlement.ts): `lib/entitlement.ts`
- [Profile access](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-profile-access.ts): `lib/server-profile-access.ts`
- [Workspace API](https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/workspace/route.ts): `app/api/workspace/route.ts`

### Orders and fulfilment

- [Manager order API](https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/manager/route.ts): `app/api/manager/route.ts`
- [PaySuite integration](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-paysuite.ts): `lib/server-paysuite.ts`

### Business operations

- [Manager workspace](https://github.com/jelisse/last-website-framy-connect/blob/main/components/manager-workspace.tsx): `components/manager-workspace.tsx`
- [Finance API](https://github.com/jelisse/last-website-framy-connect/blob/main/app/api/manager-finance/route.ts): `app/api/manager-finance/route.ts`
- [Finance view](https://github.com/jelisse/last-website-framy-connect/blob/main/components/finance-manager.tsx): `components/finance-manager.tsx`
- [Subscription management](https://github.com/jelisse/last-website-framy-connect/blob/main/components/subscription-manager.tsx): `components/subscription-manager.tsx`

### Runtime services

- [Session authentication](https://github.com/jelisse/last-website-framy-connect/blob/main/app/chatgpt-auth.ts): `app/chatgpt-auth.ts`
- [Server auth](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-auth.ts): `lib/server-auth.ts`
- [Server catalogue](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-catalog.ts): `lib/server-catalog.ts`
- [Finance reporting](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/finance-report.ts): `lib/finance-report.ts`
- [D1 database](https://github.com/jelisse/last-website-framy-connect/blob/main/lib/server-db.ts): `lib/server-db.ts`

### Other components

- **Customer**
- **Manager**

## Connections

- Customer → Storefront: browses (evidence: `README.md`)
- Storefront → Product catalogue: links to
- Customer → Product catalogue: searches products (evidence: `README.md`)
- Customer → Purchase configuration: configures order (evidence: `README.md`)
- Customer → Customer dashboard: opens account (evidence: `README.md`)
- Customer dashboard → Customer workspace: renders (evidence: `app/dashboard/page.tsx`)
- Customer workspace → Workspace API: loads and saves
- Workspace API → Session authentication: checks session (evidence: `app/api/workspace/route.ts`)
- Session authentication → Server auth: reads session (evidence: `app/chatgpt-auth.ts`)
- Workspace API → D1 database: reads and writes (evidence: `app/api/workspace/route.ts`)
- Workspace API → Server catalogue: loads products (evidence: `app/api/workspace/route.ts`)
- Server catalogue → D1 database: reads products (evidence: `lib/server-catalog.ts`)
- Workspace API → Plan entitlements: checks entitlements (evidence: `app/api/workspace/route.ts`)
- Public profile → Profile access: loads profile access (evidence: `app/[slug]/page.tsx`)
- Public profile → Profile rules: uses profile rules (evidence: `app/[slug]/page.tsx`)
- Public profile → Plan entitlements: checks entitlements (evidence: `app/[slug]/page.tsx`)
- Public profile → D1 database: reads profile data (evidence: `app/[slug]/page.tsx`)
- Manager → Manager workspace: manages operations (evidence: `README.md`)
- Manager workspace → Manager order API: updates orders
- Manager order API → Session authentication: checks session (evidence: `app/api/manager/route.ts`)
- Manager order API → D1 database: reads and writes (evidence: `app/api/manager/route.ts`)
- Manager workspace → Finance view: renders (evidence: `components/manager-workspace.tsx`)
- Finance view → Finance reporting: uses reports (evidence: `components/finance-manager.tsx`)
- Manager workspace → Subscription management: renders (evidence: `components/manager-workspace.tsx`)
- Finance API → Session authentication: checks session (evidence: `app/api/manager-finance/route.ts`)
- Finance API → D1 database: reads finance data (evidence: `app/api/manager-finance/route.ts`)
- Finance API → Finance reporting: builds reports (evidence: `app/api/manager-finance/route.ts`)
- Customer → Public profile: views published profile (evidence: `README.md`)
- Purchase configuration → PaySuite integration: optional checkout
