Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5b6d9b6
Initial plan
Copilot Jan 12, 2026
79cbdac
Add ObjectGridTable component with metadata-driven field type recogni…
Copilot Jan 12, 2026
c5e544f
Add integration guide and enhanced ObjectListView example
Copilot Jan 12, 2026
f4d8d69
Add Chinese documentation for ObjectGridTable
Copilot Jan 12, 2026
4a480e6
Fix type safety issues and improve currency formatting
Copilot Jan 12, 2026
976c9bc
Remove unused import and add currency configuration notes
Copilot Jan 12, 2026
ac69081
Add comprehensive implementation summary document
Copilot Jan 12, 2026
7a924e1
Add ObjectForm: metadata-driven form component with automatic validation
Copilot Jan 12, 2026
3ab2567
Add ObjectForm implementation summary document
Copilot Jan 12, 2026
f5914ad
更新 EnhancedObjectListView.tsx
hotlong Jan 12, 2026
40119bf
更新 object-form.tsx
hotlong Jan 12, 2026
23b016d
更新 object-grid-table.tsx
hotlong Jan 12, 2026
c2a25af
更新 object-grid-table.tsx
hotlong Jan 12, 2026
298ad6e
Address code review feedback: useCallback, type safety, XSS prevention
Copilot Jan 12, 2026
3ae142d
Fix custom regex precedence and improve email validation
Copilot Jan 12, 2026
30c1e98
Add '@objectql/types' dependency version 1.4.0 to pnpm-lock.yaml
hotlong Jan 12, 2026
10410ba
Remove Chinese docs and update dependencies
hotlong Jan 12, 2026
08c836d
Add SQLite and MongoDB support to auth client
hotlong Jan 12, 2026
a506188
Add '@objectos/web' dependency and update build scripts for improved …
hotlong Jan 12, 2026
b9deb09
Update development workflow instructions in CONTRIBUTING.md and QUICK…
hotlong Jan 12, 2026
ed7bbfe
Remove outdated documentation files for AG Grid migration and ObjectG…
hotlong Jan 12, 2026
643d2de
Add architecture overview and UI framework documentation
hotlong Jan 12, 2026
de66a76
Enhance field type recognition in UI framework documentation
hotlong Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist

.env
.env.local
*.db

# VitePress cache
docs/.vitepress/cache
Expand Down
16 changes: 15 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,23 @@ pnpm run test
### Development Workflow

```bash
# Start the development server (watches for changes)
# Start the full stack development environment
# - Server runs in watch mode on http://localhost:3000
# - Web runs in build watch mode (changes auto-compile)
pnpm run dev

# Start only the server (without frontend build watch)
pnpm run server

# Start only the frontend build watch
pnpm run web:watch

# Build for production (compiles both server and web)
pnpm run build

# Run the production build (starts server serving built web assets)
pnpm run start

# Run tests in watch mode
pnpm run test --watch

Expand Down
5 changes: 3 additions & 2 deletions QUICK_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ ObjectQL (Protocol) → ObjectOS (Runtime) → Your Application
git clone https://github.com/objectql/objectos.git
cd objectos
pnpm install
pnpm run build
pnpm run dev
pnpm run dev # Start development (Server + Web Watch)
pnpm run build # Build for production
pnpm run start # Run production build
```

### Create Your First Object
Expand Down
2 changes: 2 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"type": "module",
"scripts": {
"dev": "vite",
"build:watch": "vite build --watch",
"build": "tsc -b && vite build",
"test": "echo \"No tests specified\" && exit 0",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@objectos/ui": "workspace:*",
"@objectql/types": "^1.4.0",
"better-auth": "^1.4.10",
"clsx": "^2.1.0",
"lucide-react": "^0.344.0",
Expand Down
130 changes: 130 additions & 0 deletions apps/web/src/components/dashboard/EnhancedObjectListView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import { useState, useEffect, useCallback } from 'react';
import { ObjectGridTable } from '@objectos/ui';
import type { ObjectConfig } from '@objectql/types';

/**
* Enhanced ObjectListView using ObjectGridTable
* This is an improved version that uses metadata-driven AG Grid table
*/

interface EnhancedObjectListViewProps {
objectName: string;
user: any;
}

export function EnhancedObjectListView({ objectName, user }: EnhancedObjectListViewProps) {
const [data, setData] = useState<any[]>([]);
const [objectConfig, setObjectConfig] = useState<ObjectConfig | null>(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);

const getHeaders = useCallback(() => {
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
// Use the actual user ID from props instead of hard-coded value
if (user?.id || user?._id) {
headers['x-user-id'] = user.id || user._id;
}
return headers;
}, [user]);

// Fetch object metadata
useEffect(() => {
if (!objectName) return;

fetch(`/api/metadata/object/${objectName}`, { headers: getHeaders() })
.then(async res => {
if (!res.ok) {
throw new Error(await res.text() || res.statusText);
}
return res.json();
})
.then(config => {
setObjectConfig(config);
})
.catch(err => {
console.error('Failed to load object metadata:', err);
setError(err.message);
});
}, [objectName, getHeaders]);

// Fetch data
useEffect(() => {
if (!objectName) return;

setLoading(true);
setError(null);

fetch(`/api/data/${objectName}`, { headers: getHeaders() })
.then(async res => {
if (!res.ok) {
const contentType = res.headers.get("content-type");
if (contentType && contentType.indexOf("application/json") !== -1) {
const json = await res.json();
throw new Error(json.error || "Failed to load data");
}
throw new Error(await res.text() || res.statusText);
}
return res.json();
})
.then(result => {
const items = Array.isArray(result) ? result : (result.list || []);
setData(items);
})
.catch(err => {
console.error(err);
setError(err.message);
setData([]);
})
.finally(() => setLoading(false));
}, [objectName, getHeaders]);

const handleSelectionChanged = (selectedRows: any[]) => {
console.log('Selected rows:', selectedRows);
// You can add more selection handling logic here
};

if (error) {
return (
<div className="p-6">
<div className="mb-4 p-4 text-destructive bg-destructive/10 rounded-lg border border-destructive/20">
{error}
</div>
</div>
);
}

if (!objectConfig) {
return (
<div className="flex items-center justify-center h-full">
<div className="text-muted-foreground">Loading object metadata...</div>
</div>
);
}

return (
<div className="flex flex-col h-full bg-background p-6">
<div className="mb-4">
<h2 className="text-2xl font-bold">{objectConfig.label || objectName}</h2>
{objectConfig.description && (
<p className="text-muted-foreground mt-1">{objectConfig.description}</p>
)}
</div>

{loading ? (
<div className="flex items-center justify-center flex-1">
<div className="text-muted-foreground">Loading data...</div>
</div>
) : (
<ObjectGridTable
objectConfig={objectConfig}
data={data}
height="calc(100vh - 200px)"
pagination={true}
pageSize={20}
rowSelection="multiple"
onSelectionChanged={handleSelectionChanged}
/>
)}
</div>
);
}
14 changes: 13 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ export default defineConfig({
sidebar: {
// Sidebar for Guide section
'/guide/': [
{
text: 'Architecture Overview',
items: [
{ text: 'Architecture Diagram', link: '/guide/architecture' },
{ text: 'Platform Components', link: '/guide/platform-components' }
]
},
{
text: 'Getting Started',
items: [
{ text: 'Introduction', link: '/guide/' },
{ text: 'Architecture Overview', link: '/guide/architecture' },
{ text: 'Data Modeling', link: '/guide/data-modeling' },
{ text: 'Security Guide', link: '/guide/security-guide' }
]
Expand All @@ -38,6 +44,12 @@ export default defineConfig({
{ text: 'Writing Hooks', link: '/guide/logic-hooks' },
{ text: 'Custom Actions', link: '/guide/logic-actions' }
]
},
{
text: 'User Interface',
items: [
{ text: 'UI Framework Overview', link: '/guide/ui-framework' }
]
}
],

Expand Down
Loading