# essentialdevelopercom/quiz-app architecture

> Architecture diagram of the GitHub repository essentialdevelopercom/quiz-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/essentialdevelopercom/quiz-app
- Repository: https://github.com/essentialdevelopercom/quiz-app

## Overview

##### Project type and purpose
- This is a modular iOS quiz application built in Swift, using Test-Driven Development and Clean Architecture.
- It consists of three modules:
- BasicQuizDomain – the pure business-logic/​domain model
- QuizEngine – the “use-case” or application-logic layer
- QuizApp – the iOS app (presentation, UI, routing)
- The goal is to keep each layer independent, well-tested, and easily extendable.

##### File structure
Top-level folders:
- App/BasicQuizDomain: domain entities (Question, Score), a builder, plus domain tests
- Engine/QuizEngine: orchestrates quiz flow, defines Quiz & delegate, plus engine tests
- App/QuizApp: the Xcode app target, split into:
– Presentation (presenters for questions & results)
– UI/SwiftUI and UI/UIKit (views, view controllers, helpers)
– Routing (navigation controllers, view-controller factories, adapters)
– AppDelegate / QuizApp.swift (entry point, dependency wiring)
- .github/workflows/CI.yml: Continuous Integration pipeline running tests on push.

##### README for additional insights
- The project exemplifies TDD, modular design, and clean separation of concerns.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Domain Layer"
        Domain["BasicQuizDomain Target"]:::domain
        DomainTests["BasicQuizDomainTests"]:::domain
    end

    subgraph "Use-Case Layer"
        Engine["QuizEngine Target"]:::engine
        EngineTests["QuizEngineTests"]:::engine
    end

    subgraph "Presentation Layer"
        Pres["QuizApp Presentation"]:::presentation
        QPres["QuestionPresenter"]:::presentation
        RPres["ResultsPresenter"]:::presentation
    end

    subgraph "UI Layer"
        subgraph "SwiftUI Implementation"
            UI1["HeaderView"]:::ui
            UI2["SingleAnswerQuestion"]:::ui
            UI3["ResultView"]:::ui
        end
        subgraph "UIKit Implementation"
            UI4["UITableViewExtensions"]:::ui
            UI5["QuestionViewController"]:::ui
            UI6["ResultsViewController"]:::ui
        end
    end

    subgraph "Routing Layer"
        Routing["Routing"]:::routing
    end

    Orchestrator["AppDelegate & QuizApp.swift"]:::routing

    CI["GitHub Actions CI"]:::external

    Orchestrator -->|"wires up"| Routing
    Orchestrator -->|"launches UI"| UI1
    UI1 -->|"user actions"| QPres
    UI2 -->|"user actions"| QPres
    UI5 -->|"user actions"| QPres
    QPres -->|"advance quiz"| Engine
    Engine -->|"uses domain models"| Domain
    Engine -->|"notifies"| QPres
    RPres -->|"prepare results"| UI3
    Routing -->|"navigates"| UI5
    Routing -->|"navigates"| UI6

    click Domain "https://github.com/essentialdevelopercom/quiz-app/tree/master/App/BasicQuizDomain"
    click DomainTests "https://github.com/essentialdevelopercom/quiz-app/tree/master/App/BasicQuizDomainTests"
    click Engine "https://github.com/essentialdevelopercom/quiz-app/tree/master/Engine/QuizEngine"
    click EngineTests "https://github.com/essentialdevelopercom/quiz-app/tree/master/Engine/QuizEngineTests"
    click QPres "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/Presentation/Question/QuestionPresenter.swift"
    click RPres "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/Presentation/Result/ResultsPresenter.swift"
    click UI1 "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/UI/SwiftUI/Helpers/HeaderView.swift"
    click UI2 "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/UI/SwiftUI/Question/SingleAnswerQuestion.swift"
    click UI3 "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/UI/SwiftUI/Result/ResultView.swift"
    click UI4 "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/UI/UIKit/Helpers/UITableViewExtensions.swift"
    click UI5 "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/UI/UIKit/Question/QuestionViewController.swift"
    click UI6 "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/UI/UIKit/Result/ResultsViewController.swift"
    click Routing "https://github.com/essentialdevelopercom/quiz-app/tree/master/App/QuizApp/Routing"
    click Orchestrator "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/AppDelegate.swift"
    click Orchestrator "https://github.com/essentialdevelopercom/quiz-app/blob/master/App/QuizApp/QuizApp.swift"
    click CI "https://github.com/essentialdevelopercom/quiz-app/blob/master/.github/workflows/CI.yml"

    classDef domain fill:#AEDFF7,stroke:#000
    classDef engine fill:#A2F7A2,stroke:#000
    classDef presentation fill:#F7DFA2,stroke:#000
    classDef ui fill:#F7F7A2,stroke:#000
    classDef routing fill:#D3D3D3,stroke:#000
    classDef external fill:#F7A2A2,stroke:#000
```
