@katarsaad/infrastructure
v1.0.4
Published
Infrastructure components and external service adapters
Downloads
3
Readme
@katarsaad/infrastructure
Enterprise-grade infrastructure components and external service adapters for the System monorepo.
Installation
npm install @katarsaad/infrastructureFeatures
- Database Abstraction - Prisma-based repository pattern
- Caching Layer - Redis and in-memory cache support
- Query Builder - Type-safe query construction
- Repository Factory - Dynamic repository creation
- Domain Services - Base classes for domain logic
Quick Start
import { InfrastructureModule, Infrastructure } from '@katarsaad/infrastructure';
@Module({
imports: [
InfrastructureModule.forRoot({
database: {
url: process.env.DATABASE_URL,
provider: 'postgresql'
},
cache: {
provider: 'redis',
url: process.env.REDIS_URL
}
})
]
})
export class AppModule {}API Reference
Infrastructure
Core infrastructure service providing database and cache access.
Repository Factory
Creates type-safe repositories for domain entities.
Query Builder
Constructs complex database queries with type safety.
Configuration
interface InfrastructureConfig {
database: {
url: string;
provider: 'mysql' | 'postgresql' | 'sqlite';
};
cache: {
provider: 'redis' | 'memory';
url?: string;
ttl?: number;
};
}License
MIT
