Skip to main content

electron/services/database/SiteRepositoryService

Site repository service for data operations and dependency injection.

Remarks​

Provides a testable, dependency-injected service layer for site data operations, separating business logic from infrastructure concerns. Designed with the repository pattern and service layer architecture to enable comprehensive testing and maintainable code organization.

The service provides both data operations (SiteRepositoryService) and orchestration logic (SiteLoadingOrchestrator) to handle complex workflows while maintaining clean separation between pure functions and side effects.

Example​

const service = new SiteRepositoryService({
repositories: { site, monitor, history, settings },
logger,
eventEmitter,
});

const sites = await service.getSitesFromDatabase();
await service.loadSitesIntoCache(siteCache);

See​

Classes​