# johndward01/variables_quiz-01 architecture

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

- Interactive diagram: https://gitdiagram.com/johndward01/variables_quiz-01
- Repository: https://github.com/johndward01/variables_quiz-01

## Overview

##### Project type and purpose
- This is a simple C# console-based quiz application (a single-project .NET solution).
- Its goal is to present a series of variable-related questions to the user via the console, accept answers, track the score, and display results.

##### File structure
- Top-level:
- Variables_Quiz-01.sln – the Visual Studio solution
- Variables_Quiz01/Program.cs – the only code file, containing Main() and quiz logic
- Variables_Quiz01/Variables_Quiz-01.csproj – project metadata
- No external services, no GUI/frontend folder, no database. All functionality lives in Program.cs as a console app.

##### Extract insights from the README
- Confirms it’s a quiz app, run in Visual Studio, score-driven game.
- No mention of external dependencies or architectural layers.

##### Main components
a. Console I/O Layer
- Responsibilities: display questions and prompts (Console.WriteLine), read user answers (Console.ReadLine), show final score.
b. Quiz Engine
- Responsibilities: drive quiz flow (iterate through questions, validate answers, call scoring).
c. Question Repository
- Responsibilities: store or supply the list of questions (hard-coded in memory).
d. Scoring Engine
- Responsibilities: calculate and update the user’s score based on correctness.
e. Application Entry Point
- Main() method: initializes components, starts the quiz loop.

##### Relationships and interactions
- Main() → initializes Quiz Engine
- Quiz Engine ↔ Question Repository (fetch next question)
- Quiz Engine → Console I/O Layer (show question)
- Console I/O Layer → user input → Quiz Engine
- Quiz Engine → Scoring Engine (pass answer, receive score delta)
- Scoring Engine → Quiz Engine (return updated score)
- After last question, Quiz Engine → Console I/O Layer (display final score)

##### Architectural patterns and principles
- Modular Monolith: The application is a single deployable unit, but internally split by responsibility.
- Separation of Concerns: Each module (I/O, quiz flow, data, scoring) has a clear responsibility boundary.
- In-memory Data: Questions are stored in code, no persistence layer.

##### Technologies and frameworks
- .NET Runtime (console application)
- C# language
- System.Console for I/O

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Variables_Quiz-01 Console App"
        Container["Variables_Quiz-01 Console App"]:::container
        F["Project Metadata (.csproj)"]:::metadata
        A["Application Entry Point (Main)"]:::entry
        B["Console I/O Layer"]:::io
        C["Quiz Engine"]:::logic
        D["Question Repository"]:::data
        E["Scoring Engine"]:::logic
    end

    A -->|"initializes"| C
    C -->|"GetNextQuestion()"| D
    C -->|"ShowQuestion()"| B
    B -->|"user input"| C
    C -->|"SubmitAnswer(ans)"| E
    E -->|"UpdateScore()"| C
    C -->|"ShowFinalScore()"| B

    click Container "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz-01.sln"
    click F "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz01/Variables_Quiz-01.csproj"
    click A "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz01/Program.cs"
    click B "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz01/Program.cs"
    click C "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz01/Program.cs"
    click D "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz01/Program.cs"
    click E "https://github.com/johndward01/variables_quiz-01/blob/main/Variables_Quiz01/Program.cs"

    classDef container fill:#FDEDEC,stroke:#D35400,stroke-width:2px;
    classDef entry fill:#D6EAF8,stroke:#3498DB;
    classDef io fill:#D5F5E3,stroke:#27AE60;
    classDef logic fill:#FCF3CF,stroke:#F1C40F;
    classDef data fill:#FADBD8,stroke:#E74C3C;
    classDef metadata fill:#E8DAEF,stroke:#8E44AD;
```
