Services Overview
98 service files in backend/src/services/ with matching interfaces in backend/src/interfaces/. Each service encapsulates business logic for a domain entity, injected into routes via the DI container.
DI Container
Services are created and wired in backend/src/services/create-services.ts, then attached to the Hono context as c.var.services. See Dependency Injection .
Key Services by Domain
Core Business
Service File Purpose BuildingsService buildings-service.tsBuilding CRUD, geometry, metadata ProjectService project-service.tsProjects lifecycle, phasesScenarioService scenario-service.tsScenarios comparisonBuildingComponentService building-component-service.tsBuilding Components managementMeasureService measure-service.tsMeasures per scenario
CRM
Service File Purpose ContactService contact-service.tsContacts CRUD, claimingCompanyService company-service.tsCompanies managementLeadService lead-service.tsLeads pipeline
Finance
Documents & Files
Service File Purpose DocumentRequestService document-request-service.tsDocuments request workflowDocumentObtainingService document-obtaining/Document Obtaining collectionFileService file-service.tsFiles upload/storagePdfExportService pdf-export-service.tsPDF Templates generation
Auth & Users
Service File Purpose AuthService auth-service.tsAuthentication , 2FA, password resetUserService user-service.tsUsers managementPortalService portal-service.tsPortal token operations
Automation & Scheduling
Service File Purpose WorkflowStateMachine workflow-state-machine.tsWorkflows state transitionsTaskService task-service.tsTask management AppointmentService appointment-service.tsAppointments schedulingFormService form-service.tsForms submission
External Integrations
Interface Pattern
Each service has a matching interface in backend/src/interfaces/:
backend/src/interfaces/buildings-service.interface.ts
backend/src/services/buildings-service.ts
The interface defines the contract; the service implements it. Routes depend on interfaces, not implementations.