feat(admin): add posts CRUD sandbox and shared CRUD foundation
This commit is contained in:
@@ -20,6 +20,7 @@ export default defineConfig({
|
||||
{ text: "Getting Started", link: "/getting-started" },
|
||||
{ text: "Architecture", link: "/architecture" },
|
||||
{ text: "Better Auth Baseline", link: "/product-engineering/auth-baseline" },
|
||||
{ text: "CRUD Baseline", link: "/product-engineering/crud-baseline" },
|
||||
{ text: "i18n Baseline", link: "/product-engineering/i18n-baseline" },
|
||||
{ text: "RBAC And Permissions", link: "/product-engineering/rbac-permission-model" },
|
||||
{ text: "Workflow", link: "/workflow" },
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- `apps/admin`: admin app
|
||||
- `packages/db`: prisma + data access
|
||||
- `packages/content`: shared schemas and domain contracts
|
||||
- `packages/crud`: shared CRUD service patterns (validation, errors, audit hooks)
|
||||
- `packages/ui`: shared UI layer
|
||||
- `packages/i18n`: shared locale definitions and i18n helpers
|
||||
- `packages/config`: shared TS config
|
||||
|
||||
33
docs/product-engineering/crud-baseline.md
Normal file
33
docs/product-engineering/crud-baseline.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# CRUD Baseline
|
||||
|
||||
## Scope
|
||||
|
||||
MVP0 now includes a shared CRUD foundation package: `@cms/crud`.
|
||||
|
||||
Current baseline:
|
||||
|
||||
- Shared service factory: `createCrudService`
|
||||
- Shared validation error type: `CrudValidationError`
|
||||
- Shared not-found error type: `CrudNotFoundError`
|
||||
- Shared mutation audit hook contract: `CrudAuditHook`
|
||||
- Shared mutation context contract (`actor`, `metadata`)
|
||||
|
||||
## First Integration
|
||||
|
||||
`@cms/db` `posts` now uses the shared CRUD foundation:
|
||||
|
||||
- `listPosts`
|
||||
- `getPostById`
|
||||
- `createPost`
|
||||
- `updatePost`
|
||||
- `deletePost`
|
||||
- `registerPostCrudAuditHook`
|
||||
|
||||
Validation for create/update is enforced by `@cms/content` schemas.
|
||||
|
||||
The admin dashboard currently includes a temporary posts CRUD sandbox to validate this flow through a real app UI.
|
||||
|
||||
## Notes
|
||||
|
||||
- This is the base layer for future entities (pages, navigation, media, users, commissions).
|
||||
- Audit hook persistence/transport is intentionally left for later implementation work.
|
||||
Reference in New Issue
Block a user