openadminjs 0.1.4 → 0.1.5
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/README.md +16 -113
- package/dist/create-project.d.ts +34 -0
- package/dist/create-project.js +245 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +138 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +7 -0
- package/dist/resource-slug.d.ts +2 -0
- package/dist/resource-slug.js +4 -0
- package/dist/resource-slug.test.d.ts +1 -0
- package/dist/resource-slug.test.js +9 -0
- package/package.json +35 -24
- package/.env.example +0 -9
- package/.github/FUNDING.yml +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -10
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -10
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -9
- package/.github/dependabot.yml +0 -10
- package/.github/workflows/ci.yml +0 -26
- package/CHANGELOG.md +0 -5
- package/CODE_OF_CONDUCT.md +0 -3
- package/CONTRIBUTING.md +0 -11
- package/LICENSE +0 -21
- package/ROADMAP.md +0 -7
- package/SECURITY.md +0 -11
- package/apps/admin/app/api/auth/login/route.ts +0 -51
- package/apps/admin/app/api/auth/logout/route.ts +0 -11
- package/apps/admin/app/api/auth/refresh/route.ts +0 -46
- package/apps/admin/app/api-tokens/page.tsx +0 -253
- package/apps/admin/app/audit-logs/page.tsx +0 -5
- package/apps/admin/app/dashboard/page.tsx +0 -392
- package/apps/admin/app/files/page.tsx +0 -5
- package/apps/admin/app/globals.css +0 -206
- package/apps/admin/app/jobs/page.tsx +0 -19
- package/apps/admin/app/layout.tsx +0 -57
- package/apps/admin/app/login/page.test.tsx +0 -18
- package/apps/admin/app/login/page.tsx +0 -161
- package/apps/admin/app/login/safe-next-param.ts +0 -4
- package/apps/admin/app/notifications/page.tsx +0 -146
- package/apps/admin/app/page.tsx +0 -5
- package/apps/admin/app/plugins/page.tsx +0 -407
- package/apps/admin/app/profile/page.tsx +0 -116
- package/apps/admin/app/resources/[resource]/[id]/edit/page.tsx +0 -45
- package/apps/admin/app/resources/[resource]/[id]/page.tsx +0 -449
- package/apps/admin/app/resources/[resource]/create/page.tsx +0 -34
- package/apps/admin/app/resources/[resource]/page.tsx +0 -100
- package/apps/admin/app/settings/page.tsx +0 -233
- package/apps/admin/components/ai-assistant-widget.tsx +0 -684
- package/apps/admin/components/app-shell.tsx +0 -305
- package/apps/admin/components/auth-guard.test.tsx +0 -55
- package/apps/admin/components/auth-guard.tsx +0 -39
- package/apps/admin/components/jobs-panel.tsx +0 -103
- package/apps/admin/components/logo.tsx +0 -30
- package/apps/admin/components/resource-form.tsx +0 -349
- package/apps/admin/components/resource-table.tsx +0 -277
- package/apps/admin/lib/ai-events.ts +0 -23
- package/apps/admin/lib/api.test.ts +0 -118
- package/apps/admin/lib/api.ts +0 -135
- package/apps/admin/lib/auth-flow.e2e.test.ts +0 -79
- package/apps/admin/lib/brand.ts +0 -14
- package/apps/admin/lib/locale.ts +0 -49
- package/apps/admin/lib/tokens.ts +0 -93
- package/apps/admin/middleware.ts +0 -58
- package/apps/admin/next-env.d.ts +0 -6
- package/apps/admin/next.config.mjs +0 -7
- package/apps/admin/package.json +0 -44
- package/apps/admin/postcss.config.mjs +0 -6
- package/apps/admin/public/brand/apple-touch-icon.png +0 -0
- package/apps/admin/public/brand/favicon.svg +0 -1
- package/apps/admin/public/brand/og-image.png +0 -0
- package/apps/admin/public/brand/openadminjs-icon-new.png +0 -0
- package/apps/admin/public/brand/openadminjs-logo-monochrome.png +0 -0
- package/apps/admin/public/brand/openadminjs-logo-new.png +0 -0
- package/apps/admin/tailwind.config.ts +0 -37
- package/apps/admin/tsconfig.json +0 -23
- package/apps/admin/vitest.config.ts +0 -7
- package/apps/api/package.json +0 -56
- package/apps/api/plugins.manifest.example.json +0 -34
- package/apps/api/plugins.manifest.json +0 -4
- package/apps/api/src/access/catalog.ts +0 -112
- package/apps/api/src/access/derive-permissions.test.ts +0 -26
- package/apps/api/src/access/derive-permissions.ts +0 -36
- package/apps/api/src/access/public-catalog.ts +0 -28
- package/apps/api/src/admin/admin-ai.controller.ts +0 -125
- package/apps/api/src/admin/admin-ai.events.ts +0 -23
- package/apps/api/src/admin/admin-ai.service.ts +0 -1271
- package/apps/api/src/admin/admin-analytics.service.ts +0 -164
- package/apps/api/src/admin/admin-plugins.controller.ts +0 -32
- package/apps/api/src/admin/admin-plugins.service.ts +0 -267
- package/apps/api/src/admin/admin-resource.service.test.ts +0 -118
- package/apps/api/src/admin/admin-resource.service.ts +0 -375
- package/apps/api/src/admin/admin.controller.ts +0 -72
- package/apps/api/src/admin/admin.module.ts +0 -30
- package/apps/api/src/admin/dto/plugins.dto.ts +0 -55
- package/apps/api/src/admin/validate-resource-payload.test.ts +0 -44
- package/apps/api/src/admin/validate-resource-payload.ts +0 -103
- package/apps/api/src/app.module.ts +0 -45
- package/apps/api/src/auth/auth.controller.ts +0 -70
- package/apps/api/src/auth/auth.dto.ts +0 -49
- package/apps/api/src/auth/auth.module.ts +0 -30
- package/apps/api/src/auth/auth.service.test.ts +0 -75
- package/apps/api/src/auth/auth.service.ts +0 -231
- package/apps/api/src/common/auth-realm.decorator.ts +0 -6
- package/apps/api/src/common/auth.guard.test.ts +0 -61
- package/apps/api/src/common/auth.guard.ts +0 -78
- package/apps/api/src/common/casl-ability.factory.test.ts +0 -33
- package/apps/api/src/common/casl-ability.factory.ts +0 -41
- package/apps/api/src/common/current-user.decorator.ts +0 -6
- package/apps/api/src/common/permission.decorator.ts +0 -7
- package/apps/api/src/common/permissions.guard.ts +0 -31
- package/apps/api/src/common/prisma.service.ts +0 -13
- package/apps/api/src/health/health.controller.ts +0 -25
- package/apps/api/src/mail/mail.module.ts +0 -9
- package/apps/api/src/mail/mail.service.ts +0 -115
- package/apps/api/src/main.ts +0 -37
- package/apps/api/src/plugins/bootstrap.ts +0 -4
- package/apps/api/src/plugins/bundled/admin-widget.plugin.ts +0 -25
- package/apps/api/src/plugins/bundled/hello.plugin.ts +0 -19
- package/apps/api/src/plugins/bundled/image-optimizer.plugin.ts +0 -22
- package/apps/api/src/plugins/bundled/registry.ts +0 -13
- package/apps/api/src/plugins/bundled/seo.plugin.ts +0 -25
- package/apps/api/src/plugins/manifest-path.ts +0 -35
- package/apps/api/src/plugins/manifest.schema.test.ts +0 -36
- package/apps/api/src/plugins/manifest.schema.ts +0 -58
- package/apps/api/src/plugins/plugin-api.interceptor.ts +0 -47
- package/apps/api/src/plugins/plugin-loader.ts +0 -134
- package/apps/api/src/plugins/plugin-runtime.test.ts +0 -24
- package/apps/api/src/plugins/plugin-runtime.ts +0 -85
- package/apps/api/src/queue/queue.controller.ts +0 -28
- package/apps/api/src/queue/queue.module.ts +0 -23
- package/apps/api/src/queue/queue.processor.ts +0 -47
- package/apps/api/src/queue/queue.service.ts +0 -50
- package/apps/api/src/resources/categories.resource.ts +0 -21
- package/apps/api/src/resources/commerce.resource.ts +0 -157
- package/apps/api/src/resources/operations.resource.ts +0 -111
- package/apps/api/src/resources/posts.resource.ts +0 -88
- package/apps/api/src/resources/registry.ts +0 -27
- package/apps/api/src/resources/resource-hooks.install.ts +0 -18
- package/apps/api/src/resources/resource-hooks.registry.test.ts +0 -72
- package/apps/api/src/resources/resource-hooks.registry.ts +0 -66
- package/apps/api/src/resources/resource-hooks.runner.ts +0 -93
- package/apps/api/src/resources/system.resource.ts +0 -51
- package/apps/api/src/resources/users.resource.ts +0 -19
- package/apps/api/src/store/payment/payment.controller.ts +0 -98
- package/apps/api/src/store/payment/payment.module.ts +0 -14
- package/apps/api/src/store/payment/payment.provider.ts +0 -38
- package/apps/api/src/store/payment/payment.service.ts +0 -235
- package/apps/api/src/store/store.controller.ts +0 -26
- package/apps/api/src/store/store.module.ts +0 -12
- package/apps/api/src/test-setup.ts +0 -1
- package/apps/api/tsconfig.json +0 -11
- package/apps/api/vitest.config.ts +0 -21
- package/apps/web/README.md +0 -12
- package/apps/web/app/globals.css +0 -12
- package/apps/web/app/layout.tsx +0 -18
- package/apps/web/app/page.tsx +0 -27
- package/apps/web/app/posts/[slug]/page.tsx +0 -38
- package/apps/web/app/posts/page.tsx +0 -20
- package/apps/web/app/robots.txt/route.ts +0 -9
- package/apps/web/app/sitemap.xml/route.ts +0 -20
- package/apps/web/components/public-fields.tsx +0 -22
- package/apps/web/lib/openadmin-client.ts +0 -82
- package/apps/web/lib/seo.test.ts +0 -41
- package/apps/web/lib/seo.ts +0 -53
- package/apps/web/next-env.d.ts +0 -6
- package/apps/web/next.config.mjs +0 -5
- package/apps/web/package.json +0 -30
- package/apps/web/postcss.config.mjs +0 -6
- package/apps/web/public/brand/apple-touch-icon.png +0 -0
- package/apps/web/public/brand/favicon.svg +0 -1
- package/apps/web/public/brand/og-image.png +0 -0
- package/apps/web/public/brand/openadminjs-icon-new.png +0 -0
- package/apps/web/public/brand/openadminjs-logo-monochrome.png +0 -0
- package/apps/web/public/brand/openadminjs-logo-new.png +0 -0
- package/apps/web/tailwind.config.ts +0 -21
- package/apps/web/test/next-stub.ts +0 -7
- package/apps/web/tsconfig.json +0 -23
- package/apps/web/vitest.config.ts +0 -19
- package/docs/content/security.md +0 -7
- package/eslint.config.mjs +0 -11
- package/examples/README.md +0 -80
- package/examples/basic-admin/README.md +0 -24
- package/examples/basic-admin/package.json +0 -17
- package/examples/basic-admin/prisma/models.fragment.prisma +0 -12
- package/examples/basic-admin/src/index.test.ts +0 -8
- package/examples/basic-admin/src/index.ts +0 -5
- package/examples/basic-admin/src/resources/lead.resource.ts +0 -30
- package/examples/basic-admin/tsconfig.json +0 -7
- package/examples/basic-admin/vitest.config.ts +0 -16
- package/examples/blog-admin/README.md +0 -18
- package/examples/blog-admin/package.json +0 -17
- package/examples/blog-admin/prisma/models.fragment.prisma +0 -30
- package/examples/blog-admin/src/index.test.ts +0 -8
- package/examples/blog-admin/src/index.ts +0 -5
- package/examples/blog-admin/src/resources/authors.resource.ts +0 -21
- package/examples/blog-admin/src/resources/tags.resource.ts +0 -20
- package/examples/blog-admin/tsconfig.json +0 -7
- package/examples/blog-admin/vitest.config.ts +0 -16
- package/examples/crm-admin/README.md +0 -17
- package/examples/crm-admin/package.json +0 -17
- package/examples/crm-admin/prisma/models.fragment.prisma +0 -50
- package/examples/crm-admin/src/index.test.ts +0 -9
- package/examples/crm-admin/src/index.ts +0 -7
- package/examples/crm-admin/src/resources/activities.resource.ts +0 -29
- package/examples/crm-admin/src/resources/companies.resource.ts +0 -21
- package/examples/crm-admin/src/resources/contacts.resource.ts +0 -24
- package/examples/crm-admin/src/resources/deals.resource.ts +0 -30
- package/examples/crm-admin/tsconfig.json +0 -7
- package/examples/crm-admin/vitest.config.ts +0 -16
- package/examples/ecommerce-admin/README.md +0 -17
- package/examples/ecommerce-admin/package.json +0 -17
- package/examples/ecommerce-admin/prisma/models.fragment.prisma +0 -43
- package/examples/ecommerce-admin/src/index.test.ts +0 -8
- package/examples/ecommerce-admin/src/index.ts +0 -7
- package/examples/ecommerce-admin/src/resources/customers.resource.ts +0 -21
- package/examples/ecommerce-admin/src/resources/order-items.resource.ts +0 -22
- package/examples/ecommerce-admin/src/resources/orders.resource.ts +0 -27
- package/examples/ecommerce-admin/src/resources/products.resource.ts +0 -23
- package/examples/ecommerce-admin/tsconfig.json +0 -7
- package/examples/ecommerce-admin/vitest.config.ts +0 -16
- package/examples/marketplace-admin/README.md +0 -17
- package/examples/marketplace-admin/package.json +0 -17
- package/examples/marketplace-admin/prisma/models.fragment.prisma +0 -32
- package/examples/marketplace-admin/src/index.test.ts +0 -8
- package/examples/marketplace-admin/src/index.ts +0 -6
- package/examples/marketplace-admin/src/resources/listings.resource.ts +0 -29
- package/examples/marketplace-admin/src/resources/payouts.resource.ts +0 -28
- package/examples/marketplace-admin/src/resources/sellers.resource.ts +0 -28
- package/examples/marketplace-admin/tsconfig.json +0 -7
- package/examples/marketplace-admin/vitest.config.ts +0 -16
- package/examples/support-admin/README.md +0 -18
- package/examples/support-admin/package.json +0 -17
- package/examples/support-admin/prisma/models.fragment.prisma +0 -20
- package/examples/support-admin/src/index.test.ts +0 -8
- package/examples/support-admin/src/index.ts +0 -5
- package/examples/support-admin/src/resources/ticket-messages.resource.ts +0 -22
- package/examples/support-admin/src/resources/tickets.resource.ts +0 -35
- package/examples/support-admin/tsconfig.json +0 -7
- package/examples/support-admin/vitest.config.ts +0 -16
- package/packages/auth/package.json +0 -17
- package/packages/auth/src/index.test.ts +0 -10
- package/packages/auth/src/index.ts +0 -17
- package/packages/auth/tsconfig.json +0 -8
- package/packages/brand/apps/admin/public/brand/apple-touch-icon.png +0 -0
- package/packages/brand/apps/admin/public/brand/favicon.svg +0 -1
- package/packages/brand/apps/admin/public/brand/og-image.png +0 -0
- package/packages/brand/apps/admin/public/brand/openadminjs-icon-new.png +0 -0
- package/packages/brand/apps/admin/public/brand/openadminjs-logo-monochrome.png +0 -0
- package/packages/brand/apps/admin/public/brand/openadminjs-logo-new.png +0 -0
- package/packages/brand/apps/web/public/brand/apple-touch-icon.png +0 -0
- package/packages/brand/apps/web/public/brand/favicon.svg +0 -1
- package/packages/brand/apps/web/public/brand/og-image.png +0 -0
- package/packages/brand/apps/web/public/brand/openadminjs-icon-new.png +0 -0
- package/packages/brand/apps/web/public/brand/openadminjs-logo-monochrome.png +0 -0
- package/packages/brand/apps/web/public/brand/openadminjs-logo-new.png +0 -0
- package/packages/brand/package.json +0 -19
- package/packages/brand/site/assets/brand/favicon.svg +0 -1
- package/packages/brand/site/assets/brand/og-image.svg +0 -1
- package/packages/brand/site/assets/brand/openadminjs-icon.svg +0 -1
- package/packages/brand/site/assets/brand/openadminjs-logo-dark.svg +0 -1
- package/packages/brand/site/assets/brand/openadminjs-logo-horizontal.svg +0 -1
- package/packages/brand/site/assets/brand/openadminjs-logo-monochrome.svg +0 -1
- package/packages/brand/site/assets/brand/openadminjs-logo.svg +0 -1
- package/packages/brand/src/generate-assets.mjs +0 -182
- package/packages/brand/src/index.test.ts +0 -9
- package/packages/brand/src/index.ts +0 -7
- package/packages/brand/tsconfig.json +0 -7
- package/packages/cli/package.json +0 -44
- package/packages/cli/src/create-project.ts +0 -316
- package/packages/cli/src/index.test.ts +0 -8
- package/packages/cli/src/index.ts +0 -149
- package/packages/cli/src/resource-slug.test.ts +0 -10
- package/packages/cli/src/resource-slug.ts +0 -4
- package/packages/cli/template/.env.example +0 -6
- package/packages/cli/template/README.md +0 -13
- package/packages/cli/template/apps/web/README.md +0 -12
- package/packages/cli/template/apps/web/app/globals.css +0 -12
- package/packages/cli/template/apps/web/app/layout.tsx +0 -18
- package/packages/cli/template/apps/web/app/page.tsx +0 -27
- package/packages/cli/template/apps/web/app/posts/[slug]/page.tsx +0 -38
- package/packages/cli/template/apps/web/app/posts/page.tsx +0 -20
- package/packages/cli/template/apps/web/app/robots.txt/route.ts +0 -9
- package/packages/cli/template/apps/web/app/sitemap.xml/route.ts +0 -20
- package/packages/cli/template/apps/web/components/public-fields.tsx +0 -22
- package/packages/cli/template/apps/web/lib/openadmin-client.ts +0 -71
- package/packages/cli/template/apps/web/lib/seo.ts +0 -42
- package/packages/cli/template/apps/web/next-env.d.ts +0 -2
- package/packages/cli/template/apps/web/next.config.mjs +0 -5
- package/packages/cli/template/apps/web/package.json +0 -29
- package/packages/cli/template/apps/web/postcss.config.mjs +0 -6
- package/packages/cli/template/apps/web/public/brand/apple-touch-icon.png +0 -0
- package/packages/cli/template/apps/web/public/brand/favicon.svg +0 -1
- package/packages/cli/template/apps/web/public/brand/og-image.png +0 -0
- package/packages/cli/template/apps/web/public/brand/openadminjs-icon-new.png +0 -0
- package/packages/cli/template/apps/web/public/brand/openadminjs-logo-monochrome.png +0 -0
- package/packages/cli/template/apps/web/public/brand/openadminjs-logo-new.png +0 -0
- package/packages/cli/template/apps/web/tailwind.config.ts +0 -21
- package/packages/cli/template/apps/web/tsconfig.json +0 -23
- package/packages/cli/template/package.json +0 -19
- package/packages/cli/template/pnpm-workspace.yaml +0 -3
- package/packages/cli/tsconfig.json +0 -10
- package/packages/core/package.json +0 -20
- package/packages/core/src/index.js +0 -1
- package/packages/core/src/index.test.ts +0 -27
- package/packages/core/src/index.ts +0 -61
- package/packages/core/tsconfig.json +0 -8
- package/packages/create-openadminjs/package.json +0 -25
- package/packages/create-openadminjs/src/index.ts +0 -122
- package/packages/create-openadminjs/src/package-name.test.ts +0 -13
- package/packages/create-openadminjs/src/package-name.ts +0 -8
- package/packages/create-openadminjs/src/render-files.test.ts +0 -26
- package/packages/create-openadminjs/src/render-files.ts +0 -21
- package/packages/create-openadminjs/template/.env.example +0 -7
- package/packages/create-openadminjs/template/README.md +0 -13
- package/packages/create-openadminjs/template/apps/web/README.md +0 -12
- package/packages/create-openadminjs/template/apps/web/app/globals.css +0 -12
- package/packages/create-openadminjs/template/apps/web/app/layout.tsx +0 -18
- package/packages/create-openadminjs/template/apps/web/app/page.tsx +0 -27
- package/packages/create-openadminjs/template/apps/web/app/posts/[slug]/page.tsx +0 -38
- package/packages/create-openadminjs/template/apps/web/app/posts/page.tsx +0 -20
- package/packages/create-openadminjs/template/apps/web/app/robots.txt/route.ts +0 -9
- package/packages/create-openadminjs/template/apps/web/app/sitemap.xml/route.ts +0 -20
- package/packages/create-openadminjs/template/apps/web/components/public-fields.tsx +0 -22
- package/packages/create-openadminjs/template/apps/web/lib/openadmin-client.ts +0 -71
- package/packages/create-openadminjs/template/apps/web/lib/seo.ts +0 -42
- package/packages/create-openadminjs/template/apps/web/next-env.d.ts +0 -2
- package/packages/create-openadminjs/template/apps/web/next.config.mjs +0 -5
- package/packages/create-openadminjs/template/apps/web/package.json +0 -29
- package/packages/create-openadminjs/template/apps/web/postcss.config.mjs +0 -6
- package/packages/create-openadminjs/template/apps/web/public/brand/apple-touch-icon.png +0 -0
- package/packages/create-openadminjs/template/apps/web/public/brand/favicon.svg +0 -1
- package/packages/create-openadminjs/template/apps/web/public/brand/og-image.png +0 -0
- package/packages/create-openadminjs/template/apps/web/public/brand/openadminjs-icon-new.png +0 -0
- package/packages/create-openadminjs/template/apps/web/public/brand/openadminjs-logo-monochrome.png +0 -0
- package/packages/create-openadminjs/template/apps/web/public/brand/openadminjs-logo-new.png +0 -0
- package/packages/create-openadminjs/template/apps/web/tailwind.config.ts +0 -21
- package/packages/create-openadminjs/template/apps/web/tsconfig.json +0 -23
- package/packages/create-openadminjs/template/package.json +0 -19
- package/packages/create-openadminjs/template/pnpm-workspace.yaml +0 -3
- package/packages/create-openadminjs/tsconfig.json +0 -10
- package/packages/mail/package.json +0 -18
- package/packages/mail/src/index.test.ts +0 -23
- package/packages/mail/src/index.ts +0 -246
- package/packages/mail/tsconfig.json +0 -5
- package/packages/notifications/package.json +0 -16
- package/packages/notifications/src/index.test.ts +0 -9
- package/packages/notifications/src/index.ts +0 -5
- package/packages/notifications/tsconfig.json +0 -5
- package/packages/payments/package.json +0 -15
- package/packages/payments/src/index.ts +0 -256
- package/packages/payments/tsconfig.json +0 -9
- package/packages/permissions/package.json +0 -17
- package/packages/permissions/src/blueprints.js +0 -57
- package/packages/permissions/src/blueprints.test.ts +0 -62
- package/packages/permissions/src/blueprints.ts +0 -89
- package/packages/permissions/src/index.js +0 -11
- package/packages/permissions/src/index.test.ts +0 -34
- package/packages/permissions/src/index.ts +0 -22
- package/packages/permissions/tsconfig.json +0 -8
- package/packages/plugin-sdk/package.json +0 -26
- package/packages/plugin-sdk/src/hooks.ts +0 -135
- package/packages/plugin-sdk/src/index.ts +0 -42
- package/packages/plugin-sdk/src/sdk.test.ts +0 -13
- package/packages/plugin-sdk/tsconfig.json +0 -8
- package/packages/plugin-sdk/vitest.config.ts +0 -5
- package/packages/queue/package.json +0 -16
- package/packages/queue/src/index.test.ts +0 -12
- package/packages/queue/src/index.ts +0 -6
- package/packages/queue/tsconfig.json +0 -5
- package/packages/resource/package.json +0 -17
- package/packages/resource/src/index.js +0 -177
- package/packages/resource/src/index.test.ts +0 -151
- package/packages/resource/src/index.ts +0 -344
- package/packages/resource/tsconfig.json +0 -8
- package/packages/storage/package.json +0 -16
- package/packages/storage/src/index.test.ts +0 -10
- package/packages/storage/src/index.ts +0 -23
- package/packages/storage/tsconfig.json +0 -5
- package/pnpm-workspace.yaml +0 -4
- package/prisma/migrations/20260505151751_baseline_init_all_tables/migration.sql +0 -371
- package/prisma/migrations/migration_lock.toml +0 -3
- package/prisma/schema.prisma +0 -291
- package/prisma/seed.ts +0 -210
- package/scripts/check-static-site.mjs +0 -17
- package/scripts/e2e-smoke.mjs +0 -17
- package/scripts/make-executable.mjs +0 -4
- package/site/.nojekyll +0 -0
- package/site/assets/brand/apple-touch-icon.png +0 -0
- package/site/assets/brand/favicon.svg +0 -1
- package/site/assets/brand/og-image.png +0 -0
- package/site/assets/brand/openadminjs-icon-new.png +0 -0
- package/site/assets/brand/openadminjs-logo-monochrome.png +0 -0
- package/site/assets/brand/openadminjs-logo-new.png +0 -0
- package/site/assets/css/styles.css +0 -1521
- package/site/assets/js/main.js +0 -193
- package/site/assets/partners/arcbyte.svg +0 -11
- package/site/assets/partners/gridstack.svg +0 -8
- package/site/assets/partners/nebula.svg +0 -12
- package/site/assets/partners/orbitlab.svg +0 -7
- package/site/assets/partners/pulseforge.svg +0 -11
- package/site/assets/partners/vertex.svg +0 -6
- package/site/docs.html +0 -1459
- package/site/index.html +0 -357
- package/tsconfig.base.json +0 -23
package/apps/web/next-env.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="next" />
|
|
2
|
-
/// <reference types="next/image-types/global" />
|
|
3
|
-
/// <reference path="./.next/types/routes.d.ts" />
|
|
4
|
-
|
|
5
|
-
// NOTE: This file should not be edited
|
|
6
|
-
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
package/apps/web/next.config.mjs
DELETED
package/apps/web/package.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@openadminjs/web",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "next dev --port 3001",
|
|
8
|
-
"build": "next build",
|
|
9
|
-
"start": "next start --port 3001",
|
|
10
|
-
"lint": "tsc -p tsconfig.json --noEmit",
|
|
11
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
12
|
-
"test": "vitest run"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@openadminjs/core": "workspace:*",
|
|
16
|
-
"next": "^15.1.0",
|
|
17
|
-
"react": "^19.0.0",
|
|
18
|
-
"react-dom": "^19.0.0"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@types/node": "^22.10.2",
|
|
22
|
-
"@types/react": "^19.0.1",
|
|
23
|
-
"@types/react-dom": "^19.0.2",
|
|
24
|
-
"autoprefixer": "^10.4.20",
|
|
25
|
-
"postcss": "^8.4.49",
|
|
26
|
-
"tailwindcss": "^3.4.17",
|
|
27
|
-
"typescript": "^5.7.2",
|
|
28
|
-
"vitest": "^2.1.8"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512" role="img" aria-label="OpenAdminJS"><image xlink:href="openadminjs-icon-new.png" href="openadminjs-icon-new.png" width="512" height="512" preserveAspectRatio="xMidYMid meet"/></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Config } from "tailwindcss";
|
|
2
|
-
|
|
3
|
-
const config: Config = {
|
|
4
|
-
content: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./lib/**/*.{ts,tsx}"],
|
|
5
|
-
theme: {
|
|
6
|
-
extend: {
|
|
7
|
-
colors: {
|
|
8
|
-
brand: {
|
|
9
|
-
DEFAULT: "#059669",
|
|
10
|
-
hover: "#047857",
|
|
11
|
-
soft: "#ECFDF5",
|
|
12
|
-
border: "#A7F3D0",
|
|
13
|
-
accent: "#34D399"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
plugins: []
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default config;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type Metadata = {
|
|
2
|
-
title?: string | string[];
|
|
3
|
-
description?: string;
|
|
4
|
-
alternates?: { canonical?: string };
|
|
5
|
-
openGraph?: { title?: string; description?: string; url?: string; type?: string };
|
|
6
|
-
twitter?: { card?: string; title?: string; description?: string };
|
|
7
|
-
};
|
package/apps/web/tsconfig.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"noEmit": true,
|
|
6
|
-
"plugins": [
|
|
7
|
-
{
|
|
8
|
-
"name": "next"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"allowJs": true,
|
|
12
|
-
"incremental": true
|
|
13
|
-
},
|
|
14
|
-
"include": [
|
|
15
|
-
"next-env.d.ts",
|
|
16
|
-
"**/*.ts",
|
|
17
|
-
"**/*.tsx",
|
|
18
|
-
".next/types/**/*.ts"
|
|
19
|
-
],
|
|
20
|
-
"exclude": [
|
|
21
|
-
"node_modules"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { dirname, resolve } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { defineConfig } from "vitest/config";
|
|
4
|
-
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
const repoRoot = resolve(__dirname, "../..");
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
test: {
|
|
10
|
-
environment: "node"
|
|
11
|
-
},
|
|
12
|
-
resolve: {
|
|
13
|
-
alias: {
|
|
14
|
-
next: resolve(__dirname, "test/next-stub.ts"),
|
|
15
|
-
"@openadminjs/core": resolve(repoRoot, "packages/core/src/index.ts"),
|
|
16
|
-
"@openadminjs/resource": resolve(repoRoot, "packages/resource/src/index.ts")
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
});
|
package/docs/content/security.md
DELETED
package/eslint.config.mjs
DELETED
package/examples/README.md
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# Examples
|
|
2
|
-
|
|
3
|
-
Each folder is a **small reference package**: Prisma fragments you can merge into your app, `defineResource` modules for the API admin layer, and a typed export you can mirror in `registry.ts`. They are **not** full standalone servers — create an app with the CLI, then copy or adapt the snippets.
|
|
4
|
-
|
|
5
|
-
From the repo root, typecheck or test all example packages:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm install
|
|
9
|
-
pnpm --filter "./examples/*" typecheck
|
|
10
|
-
pnpm --filter "./examples/*" test
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
| Example | Focus |
|
|
14
|
-
| -------- | ------ |
|
|
15
|
-
| [basic-admin](./basic-admin/) | Minimal stack: users, roles, posts, files, audit, settings |
|
|
16
|
-
| [blog-admin](./blog-admin/) | Editorial: posts, categories, authors, publish workflow |
|
|
17
|
-
| [crm-admin](./crm-admin/) | Sales: contacts, companies, deals, activities |
|
|
18
|
-
| [ecommerce-admin](./ecommerce-admin/) | Catalog: products, variants, orders, inventory |
|
|
19
|
-
| [marketplace-admin](./marketplace-admin/) | Two-sided: listings, sellers, payouts, disputes |
|
|
20
|
-
| [support-admin](./support-admin/) | Ops: tickets, SLAs, canned replies, assignments |
|
|
21
|
-
|
|
22
|
-
## Publishing packages to npm (maintainers)
|
|
23
|
-
|
|
24
|
-
These steps apply when you publish the single public package from this repo (`openadminjs`), not the whole monorepo root (the root is `private` and is not meant to be published as one package).
|
|
25
|
-
|
|
26
|
-
### 1. Prerequisites
|
|
27
|
-
|
|
28
|
-
- [npm](https://docs.npmjs.com/) account with publish rights.
|
|
29
|
-
- One-time login: `npm login`
|
|
30
|
-
- Built artifacts: from the repo root, run `pnpm --filter openadminjs build` (or `pnpm build`).
|
|
31
|
-
|
|
32
|
-
### 2. Package manifest
|
|
33
|
-
|
|
34
|
-
In the package you publish (e.g. `packages/cli/package.json`):
|
|
35
|
-
|
|
36
|
-
- Ensure **`"private": true` is not set** on that package (templates may be private; the CLI package should be publishable).
|
|
37
|
-
- Prefer a **`"files"`** field so only `dist/` (and README) are packed, for example: `"files": ["dist", "README.md"]`.
|
|
38
|
-
- For scoped public packages, add:
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"access": "public"
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
For `openadminjs` (unscoped), public publish is the default; keeping `publishConfig.access=public` is still explicit and recommended.
|
|
47
|
-
|
|
48
|
-
### 3. Dry run
|
|
49
|
-
|
|
50
|
-
From the package directory:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
cd packages/cli
|
|
54
|
-
npm pack
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Inspect the generated `.tgz` (or use `npm publish --dry-run`) to confirm contents.
|
|
58
|
-
|
|
59
|
-
### 4. Publish
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
cd packages/cli
|
|
63
|
-
npm publish
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
First publish of a scoped package usually needs public access (see `publishConfig` above), or once: `npm publish --access public`.
|
|
67
|
-
|
|
68
|
-
**Version bumps:** edit `version` in that package’s `package.json`, commit, then publish again. Follow [semver](https://semver.org/).
|
|
69
|
-
|
|
70
|
-
**pnpm:** you can use `pnpm publish` from the package folder instead of `npm publish`; behavior is similar for registry upload.
|
|
71
|
-
|
|
72
|
-
### 5. CI (optional)
|
|
73
|
-
|
|
74
|
-
Use an automation token (`NPM_TOKEN`) in GitHub Actions with `npm publish` in a release workflow, only on tagged releases, with provenance if you use npm’s OIDC integration.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
If you only want to **start a new project** from npm (not publish), use:
|
|
79
|
-
|
|
80
|
-
`npx openadminjs create my-app`.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Basic Admin
|
|
2
|
-
|
|
3
|
-
Minimal generated OpenAdminJS project with users, roles, posts, files, audit logs and settings. Use as the default starting point before specializing the schema.
|
|
4
|
-
|
|
5
|
-
**Suggested resources:** `User`, `Role`, `Post`, `File`, `AuditLog`, `Setting`.
|
|
6
|
-
|
|
7
|
-
## Code in this folder
|
|
8
|
-
|
|
9
|
-
| Path | Purpose |
|
|
10
|
-
|------|---------|
|
|
11
|
-
| `prisma/models.fragment.prisma` | `Lead` model — append to your app `schema.prisma`, then migrate. |
|
|
12
|
-
| `src/resources/lead.resource.ts` | Resource definition — copy into `apps/api/src/resources/`. |
|
|
13
|
-
| `src/index.ts` | `basicExampleResources` — merge into `apps/api/src/resources/registry.ts`. |
|
|
14
|
-
|
|
15
|
-
### Merge into your app
|
|
16
|
-
|
|
17
|
-
1. Run `npx openadminjs create my-app` (or use your existing app).
|
|
18
|
-
2. Append `prisma/models.fragment.prisma` to `prisma/schema.prisma`.
|
|
19
|
-
3. Copy `src/resources/*.ts` into `apps/api/src/resources/`.
|
|
20
|
-
4. Import resources in `registry.ts` and add them to the `resources` array (see `basicExampleResources` in `src/index.ts`).
|
|
21
|
-
5. Register matching permissions in your seed / RBAC layer (`leads.read`, …).
|
|
22
|
-
6. `pnpm db:migrate` (or your migrate command).
|
|
23
|
-
|
|
24
|
-
This package is part of the monorepo so `pnpm exec tsc` can typecheck snippets against `@openadminjs/core`; it is not a standalone runnable server.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@openadminjs/example-basic",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Reference code: one extra Lead model on top of a generated OpenAdminJS app.",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
9
|
-
"lint": "tsc -p tsconfig.json --noEmit",
|
|
10
|
-
"test": "vitest run"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@openadminjs/core": "workspace:*",
|
|
14
|
-
"typescript": "^5.7.2",
|
|
15
|
-
"vitest": "^2.1.8"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Append these models to apps/*/prisma/schema.prisma (below datasource), then run prisma migrate.
|
|
2
|
-
|
|
3
|
-
model Lead {
|
|
4
|
-
id String @id @default(cuid())
|
|
5
|
-
email String?
|
|
6
|
-
name String?
|
|
7
|
-
company String?
|
|
8
|
-
status String @default("new")
|
|
9
|
-
notes String?
|
|
10
|
-
createdAt DateTime @default(now())
|
|
11
|
-
updatedAt DateTime @updatedAt
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { basicExampleResources } from "./index";
|
|
3
|
-
|
|
4
|
-
describe("basicExampleResources", () => {
|
|
5
|
-
it("includes leads resource", () => {
|
|
6
|
-
expect(basicExampleResources.map((r) => r.name)).toContain("leads");
|
|
7
|
-
});
|
|
8
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ResourceConfig } from "@openadminjs/core";
|
|
2
|
-
import lead from "./resources/lead.resource";
|
|
3
|
-
|
|
4
|
-
/** Copy resources into `apps/api/src/resources/` and merge this array into `registry.ts`. */
|
|
5
|
-
export const basicExampleResources = [lead] satisfies ResourceConfig[];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineResource } from "@openadminjs/core";
|
|
2
|
-
|
|
3
|
-
export default defineResource({
|
|
4
|
-
name: "leads",
|
|
5
|
-
label: "Leads",
|
|
6
|
-
model: "lead",
|
|
7
|
-
titleField: "name",
|
|
8
|
-
icon: "UserPlus",
|
|
9
|
-
permissions: {
|
|
10
|
-
read: "leads.read",
|
|
11
|
-
create: "leads.create",
|
|
12
|
-
update: "leads.update",
|
|
13
|
-
delete: "leads.delete"
|
|
14
|
-
},
|
|
15
|
-
fields: {
|
|
16
|
-
id: { type: "id", label: "ID", create: false, edit: false, list: false },
|
|
17
|
-
name: { type: "text", label: "Name", searchable: true, sortable: true },
|
|
18
|
-
email: { type: "email", label: "Email", searchable: true },
|
|
19
|
-
company: { type: "text", label: "Company", searchable: true },
|
|
20
|
-
status: {
|
|
21
|
-
type: "select",
|
|
22
|
-
label: "Status",
|
|
23
|
-
options: ["new", "contacted", "qualified", "lost"],
|
|
24
|
-
filterable: true,
|
|
25
|
-
sortable: true
|
|
26
|
-
},
|
|
27
|
-
notes: { type: "textarea", label: "Notes", list: false },
|
|
28
|
-
createdAt: { type: "datetime", label: "Created", create: false, edit: false, sortable: true }
|
|
29
|
-
}
|
|
30
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { dirname, resolve } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { defineConfig } from "vitest/config";
|
|
4
|
-
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
const repoRoot = resolve(__dirname, "../..");
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
test: { environment: "node" },
|
|
10
|
-
resolve: {
|
|
11
|
-
alias: {
|
|
12
|
-
"@openadminjs/core": resolve(repoRoot, "packages/core/src/index.ts"),
|
|
13
|
-
"@openadminjs/resource": resolve(repoRoot, "packages/resource/src/index.ts")
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Blog Admin
|
|
2
|
-
|
|
3
|
-
Blog-focused example using posts, categories, authors and publishing actions. Fits marketing sites and documentation hubs.
|
|
4
|
-
|
|
5
|
-
**Suggested resources:** `Post`, `Category`, `Author`, `Tag`, `Media`, `Redirect` (optional).
|
|
6
|
-
|
|
7
|
-
## Code in this folder
|
|
8
|
-
|
|
9
|
-
| Path | Purpose |
|
|
10
|
-
|------|---------|
|
|
11
|
-
| `prisma/models.fragment.prisma` | `Author`, `Tag`, `PostTag` — append to schema, then add `authorId`, `author`, `postTags` on your existing `Post` model (see comments in the fragment). |
|
|
12
|
-
| `src/resources/authors.resource.ts` | Authors admin resource. |
|
|
13
|
-
| `src/resources/tags.resource.ts` | Tags admin resource. |
|
|
14
|
-
| `src/index.ts` | `blogExampleResources` for merging into `registry.ts`. |
|
|
15
|
-
|
|
16
|
-
### Merge into your app
|
|
17
|
-
|
|
18
|
-
Follow the same steps as [basic-admin](../basic-admin/README.md#merge-into-your-app), using this folder’s Prisma fragment and resources. Extend your existing `posts.resource.ts` with `authorId` and optional tag relations once models exist.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@openadminjs/example-blog",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Reference code: authors, tags, and post↔tag join for an editorial stack.",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
9
|
-
"lint": "tsc -p tsconfig.json --noEmit",
|
|
10
|
-
"test": "vitest run"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@openadminjs/core": "workspace:*",
|
|
14
|
-
"typescript": "^5.7.2",
|
|
15
|
-
"vitest": "^2.1.8"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Append to schema.prisma, then extend your existing `Post` model with the fields below.
|
|
2
|
-
|
|
3
|
-
model Author {
|
|
4
|
-
id String @id @default(cuid())
|
|
5
|
-
name String
|
|
6
|
-
slug String @unique
|
|
7
|
-
bio String?
|
|
8
|
-
posts Post[]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
model Tag {
|
|
12
|
-
id String @id @default(cuid())
|
|
13
|
-
name String
|
|
14
|
-
slug String @unique
|
|
15
|
-
posts PostTag[]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
model PostTag {
|
|
19
|
-
postId String
|
|
20
|
-
tagId String
|
|
21
|
-
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
22
|
-
tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
|
|
23
|
-
|
|
24
|
-
@@id([postId, tagId])
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// On model Post, add (if not present):
|
|
28
|
-
// authorId String?
|
|
29
|
-
// author Author? @relation(fields: [authorId], references: [id])
|
|
30
|
-
// postTags PostTag[]
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { blogExampleResources } from "./index";
|
|
3
|
-
|
|
4
|
-
describe("blogExampleResources", () => {
|
|
5
|
-
it("includes authors and tags", () => {
|
|
6
|
-
expect(blogExampleResources.map((r) => r.name).sort()).toEqual(["authors", "tags"]);
|
|
7
|
-
});
|
|
8
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineResource } from "@openadminjs/core";
|
|
2
|
-
|
|
3
|
-
export default defineResource({
|
|
4
|
-
name: "authors",
|
|
5
|
-
label: "Authors",
|
|
6
|
-
model: "author",
|
|
7
|
-
titleField: "name",
|
|
8
|
-
icon: "PenLine",
|
|
9
|
-
permissions: {
|
|
10
|
-
read: "authors.read",
|
|
11
|
-
create: "authors.create",
|
|
12
|
-
update: "authors.update",
|
|
13
|
-
delete: "authors.delete"
|
|
14
|
-
},
|
|
15
|
-
fields: {
|
|
16
|
-
id: { type: "id", label: "ID", create: false, edit: false, list: false },
|
|
17
|
-
name: { type: "text", label: "Name", required: true, searchable: true, sortable: true },
|
|
18
|
-
slug: { type: "slug", label: "Slug", from: "name", searchable: true },
|
|
19
|
-
bio: { type: "textarea", label: "Bio", list: false }
|
|
20
|
-
}
|
|
21
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineResource } from "@openadminjs/core";
|
|
2
|
-
|
|
3
|
-
export default defineResource({
|
|
4
|
-
name: "tags",
|
|
5
|
-
label: "Tags",
|
|
6
|
-
model: "tag",
|
|
7
|
-
titleField: "name",
|
|
8
|
-
icon: "Tag",
|
|
9
|
-
permissions: {
|
|
10
|
-
read: "tags.read",
|
|
11
|
-
create: "tags.create",
|
|
12
|
-
update: "tags.update",
|
|
13
|
-
delete: "tags.delete"
|
|
14
|
-
},
|
|
15
|
-
fields: {
|
|
16
|
-
id: { type: "id", label: "ID", create: false, edit: false, list: false },
|
|
17
|
-
name: { type: "text", label: "Name", required: true, searchable: true, sortable: true },
|
|
18
|
-
slug: { type: "slug", label: "Slug", from: "name", searchable: true }
|
|
19
|
-
}
|
|
20
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { dirname, resolve } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { defineConfig } from "vitest/config";
|
|
4
|
-
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
const repoRoot = resolve(__dirname, "../..");
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
test: { environment: "node" },
|
|
10
|
-
resolve: {
|
|
11
|
-
alias: {
|
|
12
|
-
"@openadminjs/core": resolve(repoRoot, "packages/core/src/index.ts"),
|
|
13
|
-
"@openadminjs/resource": resolve(repoRoot, "packages/resource/src/index.ts")
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# CRM Admin
|
|
2
|
-
|
|
3
|
-
CRM-focused example for contacts, companies, deals and activity logs. Suitable for B2B sales and account management.
|
|
4
|
-
|
|
5
|
-
**Suggested resources:** `Contact`, `Company`, `Deal`, `Activity`, `Pipeline`, `Owner` (user relation).
|
|
6
|
-
|
|
7
|
-
## Code in this folder
|
|
8
|
-
|
|
9
|
-
| Path | Purpose |
|
|
10
|
-
|------|---------|
|
|
11
|
-
| `prisma/models.fragment.prisma` | `Contact`, `Company`, `Deal`, `Activity` models. |
|
|
12
|
-
| `src/resources/*.resource.ts` | Four resource modules. |
|
|
13
|
-
| `src/index.ts` | `crmExampleResources` — merge into `registry.ts`. |
|
|
14
|
-
|
|
15
|
-
### Merge into your app
|
|
16
|
-
|
|
17
|
-
See [basic-admin](../basic-admin/README.md#merge-into-your-app). Add permissions such as `contacts.read`, `companies.read`, `deals.read`, `activities.read` (and create/update/delete) to your permission seed.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@openadminjs/example-crm",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Reference code: contacts, companies, deals, activities for a sales CRM slice.",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
9
|
-
"lint": "tsc -p tsconfig.json --noEmit",
|
|
10
|
-
"test": "vitest run"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@openadminjs/core": "workspace:*",
|
|
14
|
-
"typescript": "^5.7.2",
|
|
15
|
-
"vitest": "^2.1.8"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Append to schema.prisma, then migrate.
|
|
2
|
-
|
|
3
|
-
model Contact {
|
|
4
|
-
id String @id @default(cuid())
|
|
5
|
-
email String?
|
|
6
|
-
firstName String
|
|
7
|
-
lastName String?
|
|
8
|
-
phone String?
|
|
9
|
-
companyId String?
|
|
10
|
-
company Company? @relation(fields: [companyId], references: [id])
|
|
11
|
-
deals Deal[]
|
|
12
|
-
activities Activity[]
|
|
13
|
-
createdAt DateTime @default(now())
|
|
14
|
-
updatedAt DateTime @updatedAt
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
model Company {
|
|
18
|
-
id String @id @default(cuid())
|
|
19
|
-
name String
|
|
20
|
-
website String?
|
|
21
|
-
contacts Contact[]
|
|
22
|
-
deals Deal[]
|
|
23
|
-
createdAt DateTime @default(now())
|
|
24
|
-
updatedAt DateTime @updatedAt
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
model Deal {
|
|
28
|
-
id String @id @default(cuid())
|
|
29
|
-
title String
|
|
30
|
-
stage String @default("lead")
|
|
31
|
-
amount Int @default(0)
|
|
32
|
-
companyId String?
|
|
33
|
-
company Company? @relation(fields: [companyId], references: [id])
|
|
34
|
-
contactId String?
|
|
35
|
-
contact Contact? @relation(fields: [contactId], references: [id])
|
|
36
|
-
activities Activity[]
|
|
37
|
-
createdAt DateTime @default(now())
|
|
38
|
-
updatedAt DateTime @updatedAt
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
model Activity {
|
|
42
|
-
id String @id @default(cuid())
|
|
43
|
-
type String
|
|
44
|
-
body String?
|
|
45
|
-
dealId String?
|
|
46
|
-
deal Deal? @relation(fields: [dealId], references: [id], onDelete: SetNull)
|
|
47
|
-
contactId String?
|
|
48
|
-
contact Contact? @relation(fields: [contactId], references: [id], onDelete: SetNull)
|
|
49
|
-
createdAt DateTime @default(now())
|
|
50
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { crmExampleResources } from "./index";
|
|
3
|
-
|
|
4
|
-
describe("crmExampleResources", () => {
|
|
5
|
-
it("exports four CRM resources", () => {
|
|
6
|
-
expect(crmExampleResources).toHaveLength(4);
|
|
7
|
-
expect(crmExampleResources.map((r) => r.name).sort()).toEqual(["activities", "companies", "contacts", "deals"]);
|
|
8
|
-
});
|
|
9
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ResourceConfig } from "@openadminjs/core";
|
|
2
|
-
import activities from "./resources/activities.resource";
|
|
3
|
-
import companies from "./resources/companies.resource";
|
|
4
|
-
import contacts from "./resources/contacts.resource";
|
|
5
|
-
import deals from "./resources/deals.resource";
|
|
6
|
-
|
|
7
|
-
export const crmExampleResources = [companies, contacts, deals, activities] satisfies ResourceConfig[];
|