mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Set up database seeding architecture and E2E testing infrastructure
- Add CLAUDE.md: AI assistant instructions for MetaBuilder project architecture - Add TESTING.md: Comprehensive E2E testing guide and troubleshooting Core changes: - Create Playwright global.setup.ts to seed database before E2E tests - Add /api/setup endpoint to trigger database seeding via HTTP - Implement seed-home-page.ts module loaded from ui_home package metadata - Create ui_home/seed/metadata.json defining home page PageConfig seed data Architecture established: - Packages define seed data in seed/metadata.json - Seed functions are idempotent (check before creating) - Global setup calls /api/setup before running tests - Database schema must be created via 'npm run db:push' before seeding Test flow: 1. Playwright starts webServer (generates Prisma client, starts Next.js) 2. Global setup waits for server, calls POST /api/setup 3. Seeding creates default data from packages 4. E2E tests run against seeded database This establishes proper separation of concerns: - DBAL adapter for database access (not raw Prisma) - Package-driven seed data (not hardcoded in code) - HTTP endpoint for explicit database initialization - Idempotent seeds (safe to rerun) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
23
packages/ui_home/seed/metadata.json
Normal file
23
packages/ui_home/seed/metadata.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"packageId": "ui_home",
|
||||
"name": "Home Page",
|
||||
"version": "1.0.0",
|
||||
"description": "Seed data for ui_home package - defines the home page",
|
||||
"author": "MetaBuilder Team",
|
||||
"category": "ui",
|
||||
"exports": {
|
||||
"components": [],
|
||||
"pages": [
|
||||
{
|
||||
"path": "/",
|
||||
"title": "MetaBuilder",
|
||||
"description": "Data-driven application platform",
|
||||
"component": "home_page",
|
||||
"level": 0,
|
||||
"requiresAuth": false,
|
||||
"isPublished": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"dependencies": []
|
||||
}
|
||||
Reference in New Issue
Block a user