toga-ai 1.0.82 → 1.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/knowledge/INDEX.md
CHANGED
|
@@ -20,6 +20,10 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
|
|
|
20
20
|
- **toga2-view** (TOGa View Frontend) — 0 doc(s) → [2.0/apps/toga2-view/INDEX.md](2.0/apps/toga2-view/INDEX.md)
|
|
21
21
|
- **toga2-hub** (TOGa Hub) — 2 doc(s) → [2.0/apps/toga2-hub/INDEX.md](2.0/apps/toga2-hub/INDEX.md)
|
|
22
22
|
|
|
23
|
+
## standalone framework
|
|
24
|
+
|
|
25
|
+
- **togatech** (TOGA Technology Website) — 1 doc(s) → [standalone/apps/togatech/INDEX.md](standalone/apps/togatech/INDEX.md)
|
|
26
|
+
|
|
23
27
|
## Clients
|
|
24
28
|
|
|
25
29
|
- **Compass Canada** (`compass-canada`) → [clients/compass-canada/INDEX.md](clients/compass-canada/INDEX.md)
|
package/knowledge/registry.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
{ "repo": "toga2-view", "project": "TOGa View Frontend", "framework": "2.0", "role": "app", "dependsOn": ["api2"] },
|
|
11
11
|
{ "repo": "togadesk", "project": "TOGa Desk", "framework": "1.0", "role": "app", "dependsOn": [] },
|
|
12
12
|
{ "repo": "togaview", "project": "TOGa View", "framework": "1.0", "role": "app", "dependsOn": [] },
|
|
13
|
-
{ "repo": "toga2-hub", "project": "TOGa Hub", "framework": "2.0", "role": "app", "dependsOn": ["api2"] }
|
|
13
|
+
{ "repo": "toga2-hub", "project": "TOGa Hub", "framework": "2.0", "role": "app", "dependsOn": ["api2"] },
|
|
14
|
+
{ "repo": "togatech", "project": "TOGA Technology Website", "framework": "standalone", "role": "app", "dependsOn": [] }
|
|
14
15
|
|
|
15
16
|
]
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# togatech (TOGA Technology Website) — standalone knowledge
|
|
2
|
+
|
|
3
|
+
| Doc | Summary | Files |
|
|
4
|
+
|-----|---------|-------|
|
|
5
|
+
| [TOGA Technology Website Architecture](architecture.md) | The public-facing TOGA Technology corporate/marketing website. | togatech/src/main.tsx, togatech/src/App.tsx, togatech/src/routes.tsx, togatech/src/lib/api.ts, togatech/src/lib/contentful.ts, togatech/src/themeConfig/ThemeContext.tsx, togatech/vite.config.ts, togatech/package.json |
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TOGA Technology Website Architecture
|
|
3
|
+
framework: "standalone"
|
|
4
|
+
repo: togatech
|
|
5
|
+
project: TOGA Technology Website
|
|
6
|
+
client: shared
|
|
7
|
+
type: architecture
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-15
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- togatech/src/main.tsx
|
|
13
|
+
- togatech/src/App.tsx
|
|
14
|
+
- togatech/src/routes.tsx
|
|
15
|
+
- togatech/src/lib/api.ts
|
|
16
|
+
- togatech/src/lib/contentful.ts
|
|
17
|
+
- togatech/src/themeConfig/ThemeContext.tsx
|
|
18
|
+
- togatech/vite.config.ts
|
|
19
|
+
- togatech/package.json
|
|
20
|
+
related: []
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# TOGA Technology Website Architecture
|
|
24
|
+
|
|
25
|
+
The public-facing TOGA Technology corporate/marketing website. It is a **standalone
|
|
26
|
+
single-page React application** — it does **not** use either PHP framework (1.0 `App_`
|
|
27
|
+
or 2.0 `_underscore`), which is why it lives under the `standalone/` knowledge partition
|
|
28
|
+
rather than `1.0/` or `2.0/`. It consumes TOGA backend services (email + the Talos AI
|
|
29
|
+
API) over HTTP and pulls editorial content from Contentful, but ships no server code of
|
|
30
|
+
its own — it builds to static assets served from `dist/`.
|
|
31
|
+
|
|
32
|
+
Local path on dev machines is tracked in Claude memory (`repo-path-togatech`), not here.
|
|
33
|
+
|
|
34
|
+
## Stack
|
|
35
|
+
|
|
36
|
+
- **React 18.3 + TypeScript 5.8**, bundled with **Vite 5.4** (`@vitejs/plugin-react`).
|
|
37
|
+
- **Tailwind CSS 3.4** (+ PostCSS / autoprefixer) for styling; theme tokens are driven
|
|
38
|
+
from `src/themeConfig/themes.json`.
|
|
39
|
+
- **React Router 7.9** using `createBrowserRouter` (data-router API).
|
|
40
|
+
- **@agilant/toga-blox** (internal design-system / component + API library) — supplies
|
|
41
|
+
shared UI and the `apiGet` HTTP helper (`@agilant/toga-blox/dist/api/apiFunctions`).
|
|
42
|
+
- **FontAwesome Pro** icon set.
|
|
43
|
+
- **Cypress 15** for end-to-end tests.
|
|
44
|
+
|
|
45
|
+
## Application bootstrap
|
|
46
|
+
|
|
47
|
+
`src/main.tsx` → `src/App.tsx` → `src/routes.tsx`.
|
|
48
|
+
|
|
49
|
+
- `main.tsx` mounts `<App/>` inside `HelmetProvider` (react-helmet-async, for per-page
|
|
50
|
+
SEO `<head>` management) and `StrictMode`.
|
|
51
|
+
- `App.tsx` wires the global providers, in order:
|
|
52
|
+
1. `PersistQueryClientProvider` — TanStack **React Query** client persisted to
|
|
53
|
+
`localStorage` (persister key `"commerce"`); default query `staleTime` is 24h.
|
|
54
|
+
2. `ThemeProvider` (`src/themeConfig/ThemeContext.tsx`) — applies the active theme
|
|
55
|
+
from `themes.json` (color/btn token sets, e.g. the `DEFAULT` theme).
|
|
56
|
+
3. `RouterProvider` with the `routes` browser router.
|
|
57
|
+
- Also initializes **Google Analytics 4** (`react-ga4`, measurement ID is hardcoded
|
|
58
|
+
in `App.tsx`) and mounts React Query Devtools.
|
|
59
|
+
- **Zustand** is also a dependency for lightweight local state where React Query is not
|
|
60
|
+
the right fit.
|
|
61
|
+
|
|
62
|
+
## Routing
|
|
63
|
+
|
|
64
|
+
`src/routes.tsx` defines a single `createBrowserRouter`. All routes render under
|
|
65
|
+
`components/templates/AppLayout` (the shared header/footer chrome), and the index route
|
|
66
|
+
group has `ErrorPage` as its `ErrorBoundary`. Pages:
|
|
67
|
+
|
|
68
|
+
| Path | Page |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `/` (index) | `pages/Home` |
|
|
71
|
+
| `/about` | `pages/About` |
|
|
72
|
+
| `/what-we-do` | `pages/WhatWeDo` |
|
|
73
|
+
| `/our-platform` | `pages/OurPlatform` |
|
|
74
|
+
| `/contact` | `pages/Contact` |
|
|
75
|
+
| `/privacy-policy` | `pages/PrivacyPolicy` |
|
|
76
|
+
| `/terms-and-conditions` | `pages/TermsAndConditions` |
|
|
77
|
+
| `*` | `pages/NotFound` |
|
|
78
|
+
|
|
79
|
+
Lazy-route scaffolding is present but commented out (pages are eagerly imported today).
|
|
80
|
+
A Cypress-only test route swaps `WhatWeDoPage` for a component that throws, to exercise
|
|
81
|
+
the error boundary (`VITE_CY_TEST` / `window.Cypress`).
|
|
82
|
+
|
|
83
|
+
## Page structure — MVVM per page
|
|
84
|
+
|
|
85
|
+
Each page in `src/pages/<Page>/` follows a **view / viewModel** split, e.g. `Home`:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
pages/Home/
|
|
89
|
+
HomePage.tsx # entry, composes the view
|
|
90
|
+
index.ts # barrel export
|
|
91
|
+
types.ts # page-local types
|
|
92
|
+
view/ # presentational components (+ components/, index.ts)
|
|
93
|
+
viewModel/ # useHomeViewModel.ts, FIELDS/, index.ts — data + form logic
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The **viewModel** holds data fetching (React Query hooks), form field definitions
|
|
97
|
+
(`FIELDS`), and behavior; the **view** is presentational. This keeps page logic testable
|
|
98
|
+
and out of JSX.
|
|
99
|
+
|
|
100
|
+
## Shared layers
|
|
101
|
+
|
|
102
|
+
- `src/components/` — reusable UI (Header, Footer, Hero, Carousel/Swiper wrappers, Modal,
|
|
103
|
+
TalosChat + TalosChatInput, motion/animation helpers, animated SVGs, etc.).
|
|
104
|
+
- `src/components/templates/` — layout primitives: `AppLayout` (router root chrome),
|
|
105
|
+
`DefaultContainer`, `MarginContainer`, `GlowingContainer`, `ErrorContainer`.
|
|
106
|
+
- `src/lib/` — data/integration layer:
|
|
107
|
+
- `api.ts` — `useSendEmail` (contact-form submission) and `postTalosMessage` (AI chat).
|
|
108
|
+
- `contentful.ts` — Contentful delivery client (`createClient`).
|
|
109
|
+
- `talosSystemPrompt.ts` — system prompt for the Talos chat assistant.
|
|
110
|
+
- `types.ts` — shared API/domain types (`ChatMessage`, `OutputField`, `ChatAPIError`…).
|
|
111
|
+
- `src/utils/` — helpers (`emphasizeText`, `getFontAwesomeIcon`, `animateSections`) and
|
|
112
|
+
hooks (`useFocusTrap`, `useLockBgScroll`).
|
|
113
|
+
- `src/themeConfig/` — `ThemeContext.tsx`, `themes.json`, `types.ts`.
|
|
114
|
+
|
|
115
|
+
## External integrations
|
|
116
|
+
|
|
117
|
+
All configured via Vite `VITE_*` env vars (values in `.env`, never in the repo docs):
|
|
118
|
+
|
|
119
|
+
- **Email** — `useSendEmail` (`src/lib/api.ts`) calls toga-blox `apiGet` against the
|
|
120
|
+
`email-templates/sendEmail?uuid=…` endpoint (base `VITE_API`), passing a per-form
|
|
121
|
+
`templateUuid` plus a `fieldMapping` of form fields → template `varN` slots. This is
|
|
122
|
+
the consumer side of the 2.0 EmailTemplate `sendEmail` API.
|
|
123
|
+
- **Talos AI chat** — `postTalosMessage` POSTs to `VITE_TALOS_API` with header
|
|
124
|
+
`X-API-Key: VITE_TALOS_API_KEY`, body `{ model: VITE_TALOS_MODEL, system_prompt,
|
|
125
|
+
messages, output_schema, temperature, max_tokens }`. Surfaced by the `TalosChat` UI.
|
|
126
|
+
- **Contentful CMS** — `VITE_CONTENTFUL_SPACE_ID` / `VITE_CONTENTFUL_ACCESS_TOKEN`.
|
|
127
|
+
- **Sentry** (`@sentry/react`) for error monitoring; **GA4** for analytics.
|
|
128
|
+
|
|
129
|
+
## Build, environments, and deploy
|
|
130
|
+
|
|
131
|
+
- `package.json` scripts: `dev`, `togatech` (dev with `--host togatech`), `build`
|
|
132
|
+
(`tsc && vite build`), `buildBeta` (`--mode beta`), `buildGamma` (`--mode gamma`),
|
|
133
|
+
`preview`, `lint` (ESLint, `--max-warnings 0`).
|
|
134
|
+
- **Multi-environment**: `development`, `beta`, `gamma`, `production` (Vite modes).
|
|
135
|
+
- Vite `base: "/"`, output to `dist/`, `publicDir: public`. A custom `robotsPlugin`
|
|
136
|
+
copies `public/robots.prod.txt` or `public/robots.dev.txt` to `dist/robots.txt` at
|
|
137
|
+
`closeBundle` depending on prod detection (`NODE_ENV` + `VITE_ENV`).
|
|
138
|
+
- `@` path alias → `./src` (Vite `resolve.alias`).
|
|
139
|
+
- Dev server `allowedHosts: ["togatech"]` (matches the `togatech` host script).
|
|
140
|
+
|
|
141
|
+
## Testing
|
|
142
|
+
|
|
143
|
+
Cypress e2e under `cypress/` (config `cypress.config.ts`). The router exposes a
|
|
144
|
+
deliberate crash route under Cypress to verify the `ErrorPage` boundary.
|
|
145
|
+
|
|
146
|
+
## Notes / gotchas
|
|
147
|
+
|
|
148
|
+
- `togatech/.env` is currently **tracked in git** and holds the `VITE_*` credentials
|
|
149
|
+
(Contentful token, Talos API key). Treat those as committed secrets — they should be
|
|
150
|
+
rotated and the file removed from tracking / added to `.gitignore`.
|
|
151
|
+
- There is a nested `togatech/` folder inside the repo root containing its own small
|
|
152
|
+
`package.json` and a `cypress/` dir — appears to be a secondary/legacy Cypress setup;
|
|
153
|
+
the primary app lives at the repo root.
|
package/knowledge.js
CHANGED
|
@@ -30,7 +30,7 @@ const path = require('path');
|
|
|
30
30
|
|
|
31
31
|
const ROOT = path.join(__dirname, 'knowledge');
|
|
32
32
|
const REGISTRY = path.join(ROOT, 'registry.json');
|
|
33
|
-
const FRAMEWORKS = ['1.0', '2.0'];
|
|
33
|
+
const FRAMEWORKS = ['1.0', '2.0', 'standalone'];
|
|
34
34
|
const DOC_TYPES = ['feature', 'client-feature', 'workflow', 'architecture', 'standard', 'profile'];
|
|
35
35
|
const ELEVATED_TYPES = ['architecture', 'standard'];
|
|
36
36
|
|
package/package.json
CHANGED