{"id":35788413,"url":"https://github.com/rineex/core","last_synced_at":"2026-02-22T08:28:19.575Z","repository":{"id":329092338,"uuid":"1117372216","full_name":"rineex/core","owner":"rineex","description":"Production-grade TypeScript/Node.js packages: DDD framework, NestJS adapters (Redis, PostgreSQL/Slonik), auth-core. Monorepo with @rineex/ddd, @rineex/ioredis, @rineex/pg-slonik \u0026 more.","archived":false,"fork":false,"pushed_at":"2026-02-10T14:27:24.000Z","size":927,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-15T18:59:25.470Z","etag":null,"topics":["authentication","ddd","domain-driven-design","monorepo","nestjs","postgresql","redis","slonik","turborepo","typescript","typescript-library"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rineex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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":"2025-12-16T08:14:40.000Z","updated_at":"2026-02-10T14:26:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rineex/core","commit_stats":null,"previous_names":["rineex/core"],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/rineex/core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rineex%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rineex%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rineex%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rineex%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rineex","download_url":"https://codeload.github.com/rineex/core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rineex%2Fcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29706836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T05:59:28.568Z","status":"ssl_error","status_checked_at":"2026-02-22T05:58:46.208Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["authentication","ddd","domain-driven-design","monorepo","nestjs","postgresql","redis","slonik","turborepo","typescript","typescript-library"],"created_at":"2026-01-07T07:26:06.405Z","updated_at":"2026-02-22T08:28:19.558Z","avatar_url":"https://github.com/rineex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rineex Core\n\n\u003e A monorepo containing essential, production-grade packages for building\n\u003e scalable and maintainable TypeScript/Node.js applications.\n\n\u003e ⚠️ **Note**: This package is currently under heavy development. APIs may\n\u003e change without notice.\n\n[![monorepo](https://img.shields.io/badge/monorepo-turbo-blue.svg)](https://turbo.build/)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.9+-blue.svg)](https://www.typescriptlang.org/)\n\n## Overview\n\nRineex Core is a collection of carefully crafted, battle-tested packages\ndesigned following Domain-Driven Design (DDD) principles and industry best\npractices. Each package is independently versioned and published to npm,\nenabling teams to adopt only what they need.\n\n## Packages\n\n### [`@rineex/ddd`](./packages/ddd) – Domain-Driven Design Framework\n\n[![npm version](https://img.shields.io/npm/v/@rineex/ddd)](https://www.npmjs.com/package/@rineex/ddd)\n[![npm downloads](https://img.shields.io/npm/dm/@rineex/ddd)](https://www.npmjs.com/package/@rineex/ddd)\n\nA comprehensive, production-grade TypeScript library providing battle-tested\nabstractions for implementing Domain-Driven Design patterns. Build maintainable,\nscalable applications with type-safe entities, aggregates, value objects, and\ndomain events.\n\n#### Quick Summary\n\n- **Value Objects**: Immutable objects distinguished by value, not identity\n- **Entities**: Objects with unique identity and lifecycle\n- **Aggregate Roots**: Entry points to aggregates with invariant enforcement and\n  event support\n- **Domain Events**: Immutable records of significant domain occurrences\n- **Application Services**: Orchestrators for use cases and commands\n- **Zero Dependencies**: Lightweight with only peer dependencies\n\n#### Key Features\n\n✨ **Type-Safe Abstractions** - Fully typed base classes for all DDD building\nblocks  \n🔒 **Immutability by Default** - Value objects and entities are frozen to\nprevent mutations  \n📡 **Domain Events Support** - First-class support for event sourcing and\nevent-driven architectures  \n✅ **Built-in Validation** - Enforce domain rules at aggregate boundaries  \n⚡ **Zero Dependencies** - Minimal bundle footprint for maximum flexibility  \n🏢 **Production Ready** - Used in high-performance systems at scale\n\n#### Quick Start\n\n```bash\nnpm install @rineex/ddd\n```\n\n```typescript\nimport {\n  AggregateRoot,\n  ValueObject,\n  AggregateId,\n  DomainEvent,\n} from '@rineex/ddd';\n\n// Define a Value Object\nclass Email extends ValueObject\u003cstring\u003e {\n  public static create(value: string) {\n    return new Email(value);\n  }\n  protected validate(props: string): void {\n    if (!props.includes('@')) throw new Error('Invalid email');\n  }\n}\n\n// Create an Aggregate Root\ninterface UserProps {\n  email: Email;\n  isActive: boolean;\n}\n\nclass User extends AggregateRoot\u003cUserProps\u003e {\n  get email(): Email {\n    return this.props.email;\n  }\n  protected validate(): void {\n    if (!this.email) throw new Error('Email is required');\n  }\n}\n\n// Use it\nconst user = new User({\n  id: AggregateId.create(),\n  createdAt: new Date(),\n  props: { email: Email.create('user@example.com'), isActive: true },\n});\n```\n\n#### Comprehensive Documentation\n\nFor in-depth guidance, examples, and best practices, see the\n[**@rineex/ddd Documentation**](./packages/ddd/README.md):\n\n- 📚 [Core Concepts Guide](./packages/ddd/README.md#core-concepts) - Value\n  Objects, Entities, Aggregates, Events\n- 🔧 [Complete API Reference](./packages/ddd/README.md#api-reference) - All\n  classes, interfaces, and methods\n- 💡 [Real-World Examples](./packages/ddd/README.md#examples) - Full order\n  management system implementation\n- ✅ [Best Practices](./packages/ddd/README.md#best-practices) - FAANG-level\n  patterns and principles\n- 🚨 [Error Handling](./packages/ddd/README.md#error-handling) - Proper error\n  management strategies\n- 🤝 [Contributing Guide](./packages/ddd/README.md#contributing) - Development\n  setup and guidelines\n\n#### Included Value Objects\n\n- `AggregateId` - Unique identifier for aggregates\n- `IPAddress` - IPv4/IPv6 validation\n- `URL` - Web URL validation\n- `UserAgent` - User agent string parsing\n\n---\n\n### [`@rineex/ioredis`](./packages/ioredis) – Redis Adapter for NestJS\n\n[![npm version](https://img.shields.io/npm/v/@rineex/ioredis)](https://www.npmjs.com/package/@rineex/ioredis)\n\nNestJS integration for [`ioredis`](https://www.npmjs.com/package/ioredis),\nproviding Redis client management with dependency injection, lifecycle\nmanagement, and health check integration.\n\n#### Key Features\n\n- **Multiple Connections** - Support for single instance or cluster\n  configurations with named connections\n- **Lifecycle Management** - Automatic connection health checks on bootstrap and\n  graceful shutdown\n- **Health Check Integration** - Built-in Terminus health indicator for\n  monitoring\n- **Dependency Injection** - Seamless NestJS DI integration with\n  `@InjectRedis()` decorator\n\n#### Quick Start\n\n```bash\nnpm install @rineex/ioredis\n```\n\n```typescript\nimport { Module, Injectable } from '@nestjs/common';\nimport { InjectRedis, RedisModule } from '@rineex/ioredis';\nimport type Redis from 'ioredis';\n\n@Module({\n  imports: [\n    RedisModule.register({\n      type: 'single',\n      url: process.env.REDIS_URL ?? 'redis://localhost:6379',\n    }),\n  ],\n})\nexport class AppModule {}\n\n@Injectable()\nexport class CacheService {\n  constructor(@InjectRedis() private readonly redis: Redis) {}\n\n  async setValue(key: string, value: string) {\n    await this.redis.set(key, value);\n  }\n}\n```\n\nFor complete documentation, see the\n[@rineex/ioredis README](./packages/ioredis/README.md).\n\n---\n\n### [`@rineex/pg-slonik`](./packages/pg-slonik) – PostgreSQL Adapter using Slonik\n\n[![npm version](https://img.shields.io/npm/v/@rineex/pg-slonik)](https://www.npmjs.com/package/@rineex/pg-slonik)\n\nNestJS module wrapper for [Slonik](https://github.com/gajus/slonik), providing\ntype-safe PostgreSQL database access with dependency injection, automatic retry\nlogic, and graceful shutdown handling.\n\n#### Key Features\n\n- **Type-Safe Database Access** - Full TypeScript support with Slonik's type\n  system\n- **Multiple Connections** - Support for multiple named database connections\n- **Automatic Retry Logic** - Built-in connection retry with configurable\n  attempts and delays\n- **SQL Safety** - Built-in SQL injection protection via Slonik's tagged\n  template literals\n- **Transaction Support** - First-class transaction handling\n\n#### Quick Start\n\n```bash\nnpm install @rineex/pg-slonik\n```\n\n```typescript\nimport { Module, Injectable } from '@nestjs/common';\nimport { InjectPool, SlonikModule } from '@rineex/pg-slonik';\nimport type { DatabasePool } from 'slonik';\n\n@Module({\n  imports: [\n    SlonikModule.register({\n      connections: [\n        {\n          name: 'DEFAULT',\n          dsn: process.env.DATABASE_URL!,\n        },\n      ],\n    }),\n  ],\n})\nexport class AppModule {}\n\n@Injectable()\nexport class UserService {\n  constructor(@InjectPool() private readonly pool: DatabasePool) {}\n\n  async findUser(id: string) {\n    const result = await this.pool.query(\n      this.pool.sql`SELECT * FROM users WHERE id = ${id}`,\n    );\n    return result.rows[0];\n  }\n}\n```\n\nFor complete documentation, see the\n[@rineex/pg-slonik README](./packages/pg-slonik/README.md).\n\n---\n\n### [`@rineex/auth-core`](./packages/authentication/core) – Authentication Core\n\n[![npm version](https://img.shields.io/npm/v/@rineex/auth-core)](https://www.npmjs.com/package/@rineex/auth-core)\n\nCore authentication package providing foundational abstractions for building\nauthentication systems. Designed following DDD principles with support for\nmultiple authentication methods.\n\n#### Key Features\n\n- **Domain-Driven Design** - Built on `@rineex/ddd` for maintainable\n  authentication logic\n- **Extensible Architecture** - Support for OTP, passwordless, and social login\n  methods\n- **Type-Safe** - Full TypeScript support with strict typing\n- **Framework Agnostic** - Core domain logic independent of framework specifics\n\nFor complete documentation, see the\n[@rineex/auth-core README](./packages/authentication/core/README.md).\n\n---\n\n### [`@rineex/libs`](./packages/libs) – Utility Libraries\n\n[![npm version](https://img.shields.io/npm/v/@rineex/libs)](https://www.npmjs.com/package/@rineex/libs)\n\nShared utility libraries and helper functions for Rineex core modules.\n\n---\n\n### NestJS Middleware Modules\n\nProduction-ready NestJS middleware modules for common web application needs:\n\n#### [`@rineex/helmet-mw-module`](./packages/nest/helmet-middleware-module)\n\n[![npm version](https://img.shields.io/npm/v/@rineex/helmet-mw-module)](https://www.npmjs.com/package/@rineex/helmet-mw-module)\n\nHelmet middleware module for securing HTTP headers in NestJS applications.\n\n#### [`@rineex/cors-mw-module`](./packages/nest/cors-middleware-module)\n\n[![npm version](https://img.shields.io/npm/v/@rineex/cors-mw-module)](https://www.npmjs.com/package/@rineex/cors-mw-module)\n\nCORS middleware module for handling cross-origin resource sharing in NestJS\napplications.\n\n#### [`@rineex/cookie-parser-mw-module`](./packages/nest/cookie-middleware-module)\n\n[![npm version](https://img.shields.io/npm/v/@rineex/cookie-parser-mw-module)](https://www.npmjs.com/package/@rineex/cookie-parser-mw-module)\n\nCookie parser middleware module for parsing cookies in NestJS applications.\n\n#### [`@rineex/response-time-mw-module`](./packages/nest/response-time-middleware-module)\n\n[![npm version](https://img.shields.io/npm/v/@rineex/response-time-mw-module)](https://www.npmjs.com/package/@rineex/response-time-mw-module)\n\nResponse time middleware module for measuring and reporting response times in\nNestJS applications.\n\n#### [`@rineex/favicon-ignore-mw-module`](./packages/nest/no-favicon-middleware-module)\n\n[![npm version](https://img.shields.io/npm/v/@rineex/favicon-ignore-mw-module)](https://www.npmjs.com/package/@rineex/favicon-ignore-mw-module)\n\nFavicon ignore middleware module to prevent favicon requests from cluttering\nlogs in NestJS applications.\n\n---\n\n### Shared Configuration Packages\n\n#### [`@rineex/eslint-config`](./packages/eslint-config)\n\nShared ESLint configuration for Rineex packages. Provides consistent linting\nrules across the monorepo.\n\n**Exports:**\n\n- `@rineex/eslint-config/base` - Base ESLint configuration\n- `@rineex/eslint-config/next-js` - Next.js specific configuration\n- `@rineex/eslint-config/react-internal` - React internal configuration\n- `@rineex/eslint-config/db` - Database/SQL linting configuration\n\n#### [`@rineex/typescript-config`](./packages/typescript-config)\n\nShared TypeScript configuration for Rineex packages. Provides consistent\nTypeScript compiler settings.\n\n**Exports:**\n\n- `@rineex/typescript-config/base` - Base TypeScript configuration\n- `@rineex/typescript-config/react-library` - React library configuration\n\n---\n\n## Project Structure\n\n```\n.\n├── packages/\n│   ├── ddd/                    # Domain-Driven Design framework\n│   │   ├── src/\n│   │   │   ├── domain/         # Core DDD building blocks\n│   │   │   ├── application/    # Application service ports\n│   │   │   ├── gateway/        # HTTP constants and utilities\n│   │   │   └── utils/          # Helper utilities\n│   │   ├── README.md           # Complete documentation\n│   │   └── package.json\n│   ├── ioredis/                # Redis adapter for NestJS\n│   ├── pg-slonik/              # PostgreSQL adapter using Slonik\n│   ├── libs/                   # Utility libraries\n│   ├── authentication/         # Authentication packages\n│   │   ├── core/              # Core authentication abstractions\n│   │   ├── methods/           # Authentication methods (OTP, passwordless)\n│   │   ├── adapters/          # Framework adapters\n│   │   ├── orchestration/     # Authentication orchestration\n│   │   └── policies/         # Authentication policies\n│   ├── nest/                  # NestJS middleware modules\n│   │   ├── helmet-middleware-module/\n│   │   ├── cors-middleware-module/\n│   │   ├── cookie-middleware-module/\n│   │   ├── response-time-middleware-module/\n│   │   └── no-favicon-middleware-module/\n│   ├── eslint-config/          # Shared ESLint configuration\n│   └── typescript-config/      # Shared TypeScript configuration\n├── scripts/                    # Build and utility scripts\n├── turbo.json                  # Turborepo configuration\n├── pnpm-workspace.yaml         # PNPM workspace configuration\n└── README.md\n```\n\n## Development\n\n### Prerequisites\n\n- **Node.js**: 18.0 or higher\n- **pnpm**: 8.0 or higher (npm/yarn supported but not recommended)\n- **TypeScript**: 5.9 or higher\n\n### Getting Started\n\n```bash\n# Install dependencies\npnpm install\n\n# Build all packages\npnpm build\n\n# Run tests\npnpm test\n\n# Run linter\npnpm lint\n\n# Check types\npnpm check-types\n```\n\n### Workspace Scripts\n\nThe monorepo uses [Turborepo](https://turbo.build/) for efficient task execution\nacross packages.\n\n```bash\n# Run command in all packages\npnpm turbo run build\n\n# Run command in specific package\npnpm --filter @rineex/ddd build\n\n# Watch mode for development\npnpm turbo run dev --parallel\n```\n\n## Publishing\n\nPackages are published automatically through GitHub Actions when changes are\nmerged to the main branch. Version management is handled via\n[Changesets](https://github.com/changesets/changesets).\n\n### Creating a Changeset\n\n```bash\npnpm changeset\n```\n\nFollow the prompts to document your changes. This will create a changeset file\nthat will be used to automatically bump versions and generate changelogs.\n\n## Architecture Principles\n\nThis monorepo follows these key principles:\n\n1. **Domain-Driven Design** - Clear separation of domain logic from\n   infrastructure\n2. **Type Safety** - Strict TypeScript configuration for compile-time safety\n3. **Immutability** - Default-immutable data structures to prevent bugs\n4. **Composition** - Small, focused packages that can be used independently\n5. **Zero Dependencies** - Minimal external dependencies for reliability\n6. **Testing** - Comprehensive test coverage with Vitest\n\n## Contributing\n\nWe welcome contributions! Please follow these guidelines when contributing:\n\n### Quick Start for Contributors\n\n```bash\n# Clone and setup\ngit clone https://github.com/rineex/core.git\ncd core\npnpm install\n\n# Create a feature branch\ngit checkout -b feature/your-feature\n\n# Make changes and test\npnpm test\npnpm lint\n\n# Push and open a PR\ngit push origin feature/your-feature\n```\n\n### Development Guidelines\n\n- **Code Style**: Follow the ESLint configuration provided by\n  `@rineex/eslint-config`\n- **Type Safety**: Ensure all code passes TypeScript type checking\n  (`pnpm check-types`)\n- **Testing**: Write tests for new functionality and ensure all tests pass\n- **Documentation**: Update relevant README files and add JSDoc comments for\n  public APIs\n- **Changesets**: Create a changeset for any package changes using\n  `pnpm changeset`\n\n### Package Generator\n\nUse the package generator to scaffold new packages following the established\nstructure:\n\n```bash\npnpm g:pkg \u003cpackage-name\u003e [description]\n```\n\nFor more details, see [PACKAGE_GENERATOR.md](./PACKAGE_GENERATOR.md).\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the\n[LICENSE](LICENSE) file for details.\n\n## Support\n\n- 📖 **Documentation** - See individual package READMEs\n- 🐛 **Issues** - Report bugs on\n  [GitHub Issues](https://github.com/rineex/core/issues)\n- 💬 **Discussions** - Ask questions on\n  [GitHub Discussions](https://github.com/rineex/core/discussions)\n\n## Related Resources\n\n- [Domain-Driven Design: Tackling Complexity in the Heart of Software](https://www.domainlanguage.com/ddd/)\n  by Eric Evans\n- [Implementing Domain-Driven Design](https://vaughnvernon.com/books/) by Vaughn\n  Vernon\n- [Turborepo Documentation](https://turbo.build/repo/docs)\n- [TypeScript Handbook](https://www.typescriptlang.org/docs/)\n\n---\n\n**Made with ❤️ by the Rineex Team**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frineex%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frineex%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frineex%2Fcore/lists"}