{"id":51425163,"url":"https://github.com/xfcfam/lib-npm","last_synced_at":"2026-07-05T02:01:03.753Z","repository":{"id":363844471,"uuid":"1241815903","full_name":"xfcfam/lib-npm","owner":"xfcfam","description":"Reference TypeScript implementation of the XF Architecture Model (CFAM) — a technology-agnostic, layered component model. pnpm monorepo of @xfcfam/* packages.","archived":false,"fork":false,"pushed_at":"2026-06-27T13:23:15.000Z","size":922,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-27T15:13:09.737Z","etag":null,"topics":["architecture","cfam","design-pattern","layered-architecture","monorepo","pnpm","reference-implementation","software-architecture","typescript","xf"],"latest_commit_sha":null,"homepage":"https://xfcfam.org","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/xfcfam.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":null,"dco":null,"cla":null}},"created_at":"2026-05-17T21:10:52.000Z","updated_at":"2026-06-27T13:20:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xfcfam/lib-npm","commit_stats":null,"previous_names":["xfcfam/lib-npm"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/xfcfam/lib-npm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfcfam%2Flib-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfcfam%2Flib-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfcfam%2Flib-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfcfam%2Flib-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xfcfam","download_url":"https://codeload.github.com/xfcfam/lib-npm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfcfam%2Flib-npm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35141083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["architecture","cfam","design-pattern","layered-architecture","monorepo","pnpm","reference-implementation","software-architecture","typescript","xf"],"created_at":"2026-07-05T02:00:47.190Z","updated_at":"2026-07-05T02:01:03.713Z","avatar_url":"https://github.com/xfcfam.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧩 XF Architecture Model — TypeScript libraries\n\n\u003e Reference implementation of the **XF Architecture Model** (CFAM,\n\u003e Cross-Framework Architecture Model) for the TypeScript ecosystem — a\n\u003e [pnpm](https://pnpm.io) monorepo of independently-published `@xfcfam/*` packages.\n\n\u003e [!NOTE]\n\u003e XF is a technology-agnostic classification system: every component in an artefact\n\u003e belongs to exactly one **layer** (Access · Business · Interaction) × one **type**\n\u003e (Logical · Generalization · Injection · Utility · Transfer) — 15 cells of a 3 × 5\n\u003e matrix, with dependencies flowing strictly **downward**. Full specification →\n\u003e **[xfcfam.org](https://xfcfam.org)**.\n\n## 📦 Packages\n\n\u003e [!TIP]\n\u003e Every package depends on the core `@xfcfam/xf`; adapters add their contract package\n\u003e (e.g. `xf-kv` for `xf-kv-redis`). Install instructions live in each package's README.\n\n### Core\n\n| Package | What it provides |\n|---|---|\n| [`@xfcfam/xf`](./packages/xf) | The three-layer Generalizations (`Repository`/`Business`/`View` + variants), the `R`/`B`/`A` Injection contracts, and the `XF` lifecycle orchestrator. |\n\n### Access — reaching the outside world\n\n| Package | Role |\n|---|---|\n| [`xf-rest`](./packages/xf-rest) | REST client (**outbound** HTTP) over `ky` — `RestRepository` + ready-made retry. |\n| [`xf-fs`](./packages/xf-fs) | Filesystem over `node:fs` — `FileRepository` (+ `Cached` / `Audited`). |\n| [`xf-reactnative-fs`](./packages/xf-reactnative-fs) | React Native sibling of `xf-fs`, same API over `@dr.pogodin/react-native-fs`. |\n| [`xf-sql`](./packages/xf-sql) · [`-postgres`](./packages/xf-sql-postgres) | SQL over Kysely (dialect-agnostic) + the PostgreSQL adapter. |\n| [`xf-kv`](./packages/xf-kv) · [`-redis`](./packages/xf-kv-redis) · [`-memcached`](./packages/xf-kv-memcached) | Key-value / cache contract + Redis \u0026 Memcached adapters. |\n| [`xf-logger`](./packages/xf-logger) · [`-file`](./packages/xf-logger-file) | Logging access point (`R.logger`) + rotating file tree. |\n\n### Interaction — entry points \u0026 views\n\n| Package | Role |\n|---|---|\n| [`xf-server`](./packages/xf-server) | Transport-agnostic **inbound-server** contract (abstract). |\n| [`xf-server-http`](./packages/xf-server-http) | HTTP transport — REST · WebSocket · SSE · GraphQL (Fastify). |\n| [`-grpc`](./packages/xf-server-grpc) · [`-tcp`](./packages/xf-server-tcp) · [`-udp`](./packages/xf-server-udp) | gRPC / TCP / UDP transports — **sketches** (not production-ready). |\n| [`xf-react-view`](./packages/xf-react-view) | React presentation Generalizations — Mixin factories that graft the Interaction `View` onto a `React.Component` peer base. |\n\n## 🚀 Quick start\n\nThe smallest XF artefact wires the three layers through the canonical Injections:\n\n```ts\nimport { StatelessBusiness } from '@xfcfam/xf'\nimport { RetryRestRepository } from '@xfcfam/xf-rest'\n\nclass UsersRest extends RetryRestRepository {\n  constructor() { super('https://api.example.com') }\n  fetchUser(id: number) { return this.withRetry(() =\u003e this.get(`/users/${id}`)) }\n}\n// reached only through the injection:  R.users.fetchUser(42)\n```\n\n## 🧪 Examples\n\n| Example | Demonstrates |\n|---|---|\n| [`01-rest-basic`](./examples/01-rest-basic) | REST client artefact (`xf` + `xf-rest`). |\n| [`02-sql-postgres`](./examples/02-sql-postgres) | Postgres artefact (`xf` + `xf-sql` + `xf-sql-postgres`). |\n| [`03-rest-server`](./examples/03-rest-server) | HTTP server — REST / WS / SSE / GraphQL on one port. |\n| [`04-kv-memory`](./examples/04-kv-memory) | In-memory key-value cache, no server (`xf` + `xf-kv`). |\n| [`06-logger`](./examples/06-logger) | Logging from all three layers + a rotating file tree. |\n\n```bash\npnpm --filter @xfcfam-examples/01-rest-basic start\n```\n\n## 🛠️ Development\n\n```bash\npnpm install      # bootstrap the workspace (one-time)\npnpm build        # dist/ for every package\npnpm typecheck    # tsc --noEmit across the workspace\npnpm test         # vitest across the workspace\n```\n\nEach package follows the canonical XF folder structure — `src/repository/`,\n`src/business/`, `src/api/`, each with its `general/` · `logic/` · `transfers/` ·\n`utils/` partitions. Tests live in `tests/` and stay out of the published tarball.\n\n## 🤝 Contributing\n\nPull requests welcome. Please add or update tests for any change of behaviour, and\nkeep the XF canonicity of the source tree intact (no free functions or runtime state\nat module scope — follow the existing conventions).\n\n## ⚖️ License\n\nMIT — see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxfcfam%2Flib-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxfcfam%2Flib-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxfcfam%2Flib-npm/lists"}