How mrphansum/hoc works
Purpose and Runtime
GauDenApp is a native SwiftUI iOS authentication-oriented application with a post-login dashboard. The Xcode project is GauDenApp/GauDenApp.xcodeproj, and project generation/build metadata also exists in GauDenApp/project.yml.
Application Entry and Root Routing
GauDenApp/GauDenApp/AuthApp.swift is the SwiftUI application entry point. Root presentation is organized through GauDenApp/GauDenApp/Presentation/ContentView.swift and shared application/session state in GauDenApp/GauDenApp/Presentation/State/AppState.swift, which forms the boundary between unauthenticated auth screens and authenticated dashboard screens.
Authentication Presentation
Authentication UI is a tabbed flow rooted at GauDenApp/GauDenApp/Presentation/Auth/AuthTabView.swift, with distinct login and registration views:
• GauDenApp/GauDenApp/Presentation/Auth/LoginView.swift
• GauDenApp/GauDenApp/Presentation/Auth/RegisterView.swift
• GauDenApp/GauDenApp/Presentation/Auth/AuthViewModel 2.swift
The view model coordinates user input, async auth actions, and UI-visible loading/error/session state rather than calling transport code directly.
Domain Authentication Workflow
Use cases isolate business operations from SwiftUI and repository details:
• GauDenApp/GauDenApp/Domain/UseCases/LoginUseCase 2.swift
• GauDenApp/GauDenApp/Domain/UseCases/RegisterUseCase 2.swift
• GauDenApp/GauDenApp/Domain/UseCases/TokenManagementUseCase.swift
They operate on domain representations such as GauDenApp/GauDenApp/Domain/Entities/UserEntity.swift. The expected flow is ViewModel → use case → repository, returning domain-level results for state updates and routing.
Data, API, and Error Boundary
The data layer translates between domain workflows and authentication API payloads:
• GauDenApp/GauDenApp/Data/Repositories/AuthRepository.swift
• GauDenApp/GauDenApp/Data/DTOs/AuthDTOs.swift
• GauDenApp/GauDenApp/Core/Network/AuthEndpoint.swift
GauDenApp/GauDenApp/Core/Network/NetworkClient.swift centralizes HTTP execution; Endpoint.swift defines request abstraction and APIError.swift establishes the API failure boundary. The external dependency is an unspecified remote authentication service accessed through these endpoint definitions.
Session and Secure Credential Handling
Authentication tokens/session material cross into persistent storage through:
• GauDenApp/GauDenApp/Data/Storage/SessionStorage.swift
• GauDenApp/GauDenApp/Core/SecureStorage/KeychainManager.swift
• GauDenApp/GauDenApp/Domain/UseCases/TokenManagementUseCase.swift
Keychain-backed storage is the security boundary for sensitive credentials. Restored or cleared session state feeds AppState, determining whether the app enters auth or dashboard presentation.
Authenticated Dashboard and Notifications
After successful authentication, the dashboard is composed under:
• GauDenApp/GauDenApp/Presentation/Dashboard/MainDashboardView.swift
• GauDenApp/GauDenApp/Presentation/Dashboard/HomeView.swift
• GauDenApp/GauDenApp/Presentation/Dashboard/DevicesView.swift
Notification-related behavior is separated behind GauDenApp/GauDenApp/Core/Notification/NotificationManager.swift and presented by GauDenApp/GauDenApp/Presentation/Dashboard/NotificationCenterView.swift, keeping platform notification integration outside dashboard UI views.
Main entry points: AppState.swift App state · AuthViewModel 2.swift Auth view model · AuthTabView.swift Auth tabs · MainDashboardView.swift Main dashboard
Components 20
SwiftUI Presentation
- GauDenApp
GauDenApp/GauDenApp/AuthApp.swift - Root content router
GauDenApp/GauDenApp/Presentation/ContentView.swift - App state · Selects authentication or dashboard presentation.
GauDenApp/GauDenApp/Presentation/State/AppState.swift - Auth tabs
GauDenApp/GauDenApp/Presentation/Auth/AuthTabView.swift - Login view
GauDenApp/GauDenApp/Presentation/Auth/LoginView.swift - Register view
GauDenApp/GauDenApp/Presentation/Auth/RegisterView.swift - Auth view model · Coordinates input, async actions, and visible auth state.
GauDenApp/GauDenApp/Presentation/Auth/AuthViewModel 2.swift - Main dashboard
GauDenApp/GauDenApp/Presentation/Dashboard/MainDashboardView.swift - Home & devices
GauDenApp/GauDenApp/Presentation/Dashboard/HomeView.swift - Notification center
GauDenApp/GauDenApp/Presentation/Dashboard/NotificationCenterView.swift
Authentication Domain
- Login & register
GauDenApp/GauDenApp/Domain/UseCases/LoginUseCase 2.swift - Token management
GauDenApp/GauDenApp/Domain/UseCases/TokenManagementUseCase.swift - User entity
GauDenApp/GauDenApp/Domain/Entities/UserEntity.swift
Data & Session
- Auth repository · Maps API data into domain-level auth results.
GauDenApp/GauDenApp/Data/Repositories/AuthRepository.swift - Session storage
GauDenApp/GauDenApp/Data/Storage/SessionStorage.swift
Platform Boundaries
- Auth endpoint & DTOs
GauDenApp/GauDenApp/Core/Network/AuthEndpoint.swift - Network client · Executes endpoint requests and surfaces API failures.
GauDenApp/GauDenApp/Core/Network/NetworkClient.swift - Keychain manager
GauDenApp/GauDenApp/Core/SecureStorage/KeychainManager.swift - Notification manager
GauDenApp/GauDenApp/Core/Notification/NotificationManager.swift
Other components
- Remote auth service · Unspecified authentication backend.
Connections 21
- GauDenApp → Root content router: hosts
- Root content router → App state: routes by
- App state → Auth tabs: unauthenticated
- App state → Main dashboard: authenticated
- Auth tabs → Login view: contains
- Auth tabs → Register view: contains
- Login view → Auth view model: binds
- Register view → Auth view model: binds
- Auth view model → Login & register: invokes
- Auth view model → Token management: updates session
- Login & register → User entity: returns
- Login & register → Auth repository: uses
- Auth repository → Auth endpoint & DTOs: builds requests
- Auth endpoint & DTOs → Network client: executed by
- Network client → Remote auth service: HTTP
- Token management → Session storage: persists/restores
- Session storage → Keychain manager: secures tokens
- Token management → App state: restores or clears
- Main dashboard → Home & devices: composes
- Main dashboard → Notification center: composes
- Notification center → Notification manager: uses