You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(web): integrate @objectstack/client SDK for data and metadata API
- Replace custom api.ts fetch wrapper with @objectstack/client singleton
- Align types/metadata.ts FieldType with @objectstack/spec (42 field types)
- Align AppDefinition with spec: name/label/active instead of id/name/status
- Refactor use-metadata.ts to use client.meta.* with mock fallback
- Refactor use-records.ts to use client.data.* with mock fallback
- Update FieldRenderer to support lookup, master_detail, multiselect, tags, etc.
- Update all pages/components for spec-aligned AppDefinition properties
- Update mock-data.ts to use spec-aligned types
- Update tests for new AppDefinition shape
- Update APPS_WEB_ROADMAP.md to reflect @objectstack/client usage
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
> **Note**: Until the server implements these endpoints, the frontend uses mock data with the same interface. The API layer (`src/lib/api.ts`) abstracts this so switching to real endpoints requires zero page-level changes.
223
+
> When the server is unreachable, hooks fall back to mock data from `lib/mock-data.ts`.
224
+
> This allows the UI to be developed independently of the backend.
226
225
227
226
---
228
227
@@ -238,7 +237,7 @@ apps/web/src/
238
237
│ └── metadata.ts # Object, Field, App type definitions
239
238
│
240
239
├── lib/
241
-
│ ├── api.ts # Fetch wrapper for /api/v1/*
240
+
│ ├── api.ts # @objectstack/client SDK singleton
242
241
│ ├── auth-client.ts # Better-Auth client
243
242
│ ├── app-registry.ts # App registry (mock → API)
244
243
│ ├── mock-data.ts # Mock metadata & records for dev
0 commit comments