How idevscode/networking-library_ios works
This is a Swift SafeCircle client/data library covering authentication and session state, profile and guardian management, live journeys, risk detection, consent, and push registration. The typical workflow is a client-driven use case, a repository implementation that builds network requests and maps responses into domain entities, and an HTTP or WebSocket service; profile data may also be cached locally. The excerpts confirm authentication, profile/guardian, token, and HTTP behavior. Several other product branches are present in the tree but their runtime wiring was not sampled, so those links are marked unverified rather than inferred as definite calls.
Main entry points: NetworkClient.swift HTTP client · MainRepositoryImpl.swift People repository · AuthRepoImpl.swift Authentication repository · JourneyRepoImpl.swift Journey repository
Components 25
Authentication
- Session orchestration
Sources/Data/UseCases/DefaultSessionUseCase.swift - Authentication contract
Sources/Domain/Repositories/AuthRepository.swift - Authentication repository
Sources/Data/Repositories/AuthRepoImpl.swift - OTP flow
Sources/Domain/VerifyOTPFlow.swift
Profile and guardians
- Profile use case
Sources/Domain/UseCases/GetMyProfileUseCase.swift - People repository contract
Sources/Domain/Repositories/MainRepository.swift - People repository
Sources/Data/Repositories/MainRepositoryImpl.swift - Guardian workflows
Sources/Domain/UseCases - User preferences
Sources/Data/Local/UserDefaultsManager.swift
Journey safety
- Journey workflows
Sources/Domain/UseCases - Journey repository
Sources/Data/Repositories/JourneyRepoImpl.swift - Journey entities
Sources/Domain/Entities/JourneyEntity.swift - Journey response mapping
Sources/Data/DTO/JourneyDTO.swift - Live journey socket
Sources/Data/Networking/JourneyWebSocketClient.swift - Risk detection
Sources/Domain/UseCases
Data and integrations
- Consent management
Sources/Domain/UseCases - Push registration
Sources/Domain/UseCases - HTTP client
Sources/Data/Networking/NetworkClient.swift - Request definitions
Sources/Data/NetworkRequests - Response DTOs
Sources/Data/DTO - Shared domain entities
Sources/Domain/Entities/DefaultEntity.swift - Access token store
Sources/Data/Local/KeychainManager.swift
Other components
- SDK client
- SafeCircle API
- Journey service
Connections 25
- Session orchestration → Authentication contract: delegates
Sources/Data/UseCases/DefaultSessionUseCase.swift - Session orchestration → Profile use case: validates via
Sources/Data/UseCases/DefaultSessionUseCase.swift - Authentication repository → Authentication contract: implements
Sources/Data/Repositories/AuthRepoImpl.swift - Authentication repository → HTTP client: executes requests
Sources/Data/Repositories/AuthRepoImpl.swift - Authentication repository → Access token store: reads and clears
Sources/Data/Repositories/AuthRepoImpl.swift - Authentication repository → OTP flow: uses OTP flow
Sources/Data/Repositories/AuthRepoImpl.swift - Profile use case → People repository contract: uses repository
- People repository → People repository contract: implements
Sources/Data/Repositories/MainRepositoryImpl.swift - People repository → HTTP client: executes requests
Sources/Data/Repositories/MainRepositoryImpl.swift - People repository → User preferences: caches profile
Sources/Data/Repositories/MainRepositoryImpl.swift - Guardian workflows → People repository contract: uses repository
- People repository → Response DTOs: maps responses
Sources/Data/Repositories/MainRepositoryImpl.swift - People repository → Shared domain entities: returns domain values
Sources/Data/Repositories/MainRepositoryImpl.swift - Journey workflows → Journey repository: uses repository
- Journey repository → HTTP client: executes requests
- Journey repository → Journey entities: maps journey data
- Journey response mapping → Journey entities: converts to
Sources/Data/DTO/JourneyDTO.swift - Live journey socket → Journey service: connects to
- Live journey socket → Journey entities: uses live events
- Risk detection → Journey repository: uses journey data
- Consent management → HTTP client: uses HTTP client
- Push registration → HTTP client: uses HTTP client
- HTTP client → SafeCircle API: sends HTTP requests
Sources/Data/Networking/NetworkClient.swift - HTTP client → Access token store: saves response token
Sources/Data/Networking/NetworkClient.swift - HTTP client → Request definitions: executes request