{"id":43162162,"url":"https://github.com/x3m-industries/x3m-payload","last_synced_at":"2026-02-10T14:01:05.981Z","repository":{"id":335759631,"uuid":"1146636503","full_name":"x3m-industries/x3m-payload","owner":"x3m-industries","description":"Payload CMS libraries and utilities","archived":false,"fork":false,"pushed_at":"2026-02-05T23:45:06.000Z","size":465,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-06T01:32:52.292Z","etag":null,"topics":["fields","payload","payload-plugin","payloadcms"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x3m-industries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-31T12:30:49.000Z","updated_at":"2026-02-05T23:42:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"f669a266-64a9-4f74-9e45-47f1b5ae2017","html_url":"https://github.com/x3m-industries/x3m-payload","commit_stats":null,"previous_names":["x3m-industries/x3m-payload"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/x3m-industries/x3m-payload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x3m-industries%2Fx3m-payload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x3m-industries%2Fx3m-payload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x3m-industries%2Fx3m-payload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x3m-industries%2Fx3m-payload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x3m-industries","download_url":"https://codeload.github.com/x3m-industries/x3m-payload/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x3m-industries%2Fx3m-payload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29302996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T12:55:56.056Z","status":"ssl_error","status_checked_at":"2026-02-10T12:55:55.692Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fields","payload","payload-plugin","payloadcms"],"created_at":"2026-02-01T01:24:08.655Z","updated_at":"2026-02-10T14:01:05.976Z","avatar_url":"https://github.com/x3m-industries.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @x3m-industries/payload\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)\n[![Payload CMS](https://img.shields.io/badge/Payload%20CMS-3.x-purple.svg)](https://payloadcms.com/)\n\n**The missing pieces for Payload CMS.** Type-safe services, production-ready fields, zero boilerplate.\n\n\u003e [!TIP]\n\u003e **Built for Payload 3.0+ and Next.js App Router.**\n\u003e Fully compatible with the new server-only architecture.\n\n![VS Code Autocomplete Demo](/docs/assets/autocomplete-demo.gif)\n_See the magic: Full TypeScript autocomplete for your entire backend logic._\n\n---\n\n## Why This Exists\n\nEvery Payload 3.0 project ends up with the same problems:\n\n❌ **Unsafe API calls** — `payload.find({ collection: 'orders' })` is just a magic string.  \n❌ **Manual Validation** — Rewriting generic phone/VAT/address regexes for every client.  \n❌ **Scattered Logic** — Service methods spread across 'utilities' folders with no structure.\n\n**This toolkit solves all three.** It brings the structure of NestJS to the flexibility of Payload.\n\n---\n\n## 🚀 Quick Start (Demo)\n\nWant to see it in action? Run the local demo in 2 minutes.\n\n```bash\n# 1. Clone the repo\ngit clone https://github.com/x3m-industries/x3m-payload.git\ncd x3m-payload\n\n# 2. Install dependencies\nyarn install\n\n# 3. Start the demo\nyarn demo\n```\n\nOpen [http://localhost:3000](http://localhost:3000) to explore the admin UI and frontend.\n\n---\n\n## 🔌 Plugin Mode: The Game Changer\n\nDefine services directly on your collections. Access them from `payload.services`. Fully typed.\n\n```typescript\n// payload.config.ts\nimport { servicesPlugin } from '@x3m-industries/lib-services';\n\nexport default buildConfig({\n  plugins: [servicesPlugin()],\n  collections: [Orders, Customers],\n  globals: [Settings],\n});\n```\n\n```typescript\n// collections/Orders.ts\nexport const Orders = {\n  slug: 'orders' as const,\n  fields: [...],\n  service: {\n    extensions: ({ getPayload, collection }) =\u003e ({\n      async markShipped({ id }: { id: string }) {\n        const payload = await getPayload();\n        return payload.update({ collection, id, data: { status: 'shipped' } });\n      },\n    }),\n    cache: { findMany: { life: 'hours', tags: ['orders'] } }, // \"use cache\"\n  },\n} satisfies CollectionConfig;\n```\n\n```typescript\n// collections/Customers.ts\n// Just standard CRUD? No problem.\nexport const Customers = {\n  slug: 'customers' as const,\n  fields: [...],\n  service: true, // Auto-enable default CRUD service\n} satisfies CollectionConfig;\n```\n\n```typescript\n// Anywhere in your app\nimport { getPayload } from './services'; // Centralized definition\n\nconst payload = await getPayload();\n\n// Default CRUD — fully typed\nawait payload.services.orders.findMany({ where: { status: { equals: 'pending' } } });\nawait payload.services.orders.findOneById({ id: '123' });\n\n// Custom methods — fully typed\nawait payload.services.orders.markShipped({ id: '123' });\n\n// Dynamic access\nawait payload.services('orders').createOne({ data: {...} });\n```\n\n**No casting. No magic strings. Full autocomplete.**\n\n---\n\n## 🛡️ Production Fields, Out of the Box\n\nStop rewriting validation logic. These fields work correctly the first time.\n\n```typescript\nimport { addressField, idField, phoneField, vatField } from '@x3m-industries/lib-fields';\n\nexport const Customers: CollectionConfig = {\n  slug: 'customers',\n  fields: [\n    idField({ config: { type: 'uuidv7' } }), // Auto-generated, prefixed IDs\n    phoneField({ overrides: { name: 'mobile' } }), // libphonenumber-js validation\n    vatField({ overrides: { name: 'vatNumber' } }), // EU VAT checksum validation\n    addressField(), // Complete address group\n  ],\n};\n```\n\n| Field          | What It Does                                           |\n| -------------- | ------------------------------------------------------ |\n| `idField`      | Auto-generated IDs (uuid, uuidv7, nanoid, ulid, cuid2) |\n| `phoneField`   | International phone validation via libphonenumber-js   |\n| `vatField`     | EU VAT validation with format + checksum               |\n| `addressField` | Street, city, state, zip, country — one line           |\n| `slugField`    | Auto-generated slugs with localization + locking       |\n| `emailField`   | Email validation with domain restrictions              |\n| `urlField`     | URL validation with protocol enforcement               |\n| `countryField` | Pre-filled country select                              |\n\n---\n\n## 📦 Installation\n\n```bash\n# Fields\nyarn add @x3m-industries/lib-fields\n\n# Services\nyarn add @x3m-industries/lib-services\n```\n\n---\n\n## 📚 Documentation\n\nFull API documentation in each package:\n\n- **[lib-fields](./packages/lib-fields/README.md)** — Field configuration, validation options, customization\n- **[lib-services](./packages/lib-services/README.md)** — Plugin setup, extensions, disable methods, type safety\n\n---\n\n## 🛠️ Development\n\n```bash\nyarn install      # Install dependencies\nyarn dev          # Development mode\nyarn validate     # Build + lint + typecheck + test\n```\n\n---\n\n## 📄 License\n\nMIT © [X3M Industries](https://x3m.industries)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx3m-industries%2Fx3m-payload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx3m-industries%2Fx3m-payload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx3m-industries%2Fx3m-payload/lists"}