# johnnyalex77/prueba_aws architecture

> Architecture diagram of the GitHub repository johnnyalex77/prueba_aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/johnnyalex77/prueba_aws
- Repository: https://github.com/johnnyalex77/prueba_aws

## Overview

#### Purpose and entry point
A standalone, offline Python desktop practice quiz for AWS Academy Cloud Architecting. The executable entry point is `app/main.py`; it loads a local question bank from `app/questions.json` and presents a Tkinter GUI. There is no server, database, web client, or AWS runtime integration.

#### Application shell and UI control
`app/main.py` owns the Tkinter application lifecycle, window/view construction, and user-driven control flow. The interface renders one single-choice question at a time, exposes answer radio buttons, progress, and Previous/Next/Clear/Finish actions. UI state changes drive quiz navigation and eventual result/review windows.

#### Question-bank ingestion and validation boundary
`app/questions.json` is the durable content boundary. It contains question objects with identifiers, prompt text, options, a single correct answer letter, and optional justification. `app/main.py` reads this local JSON at startup; failure to locate or parse it prevents normal quiz initialization.

#### Quiz session initialization
At launch, `app/main.py` randomly selects 25 questions from the local bank. This selected set defines the in-memory session scope, so each run can present a different exam while leaving `app/questions.json` unchanged. The application requires a bank large enough to support the fixed sample size.

#### Answer state and navigation
`app/main.py` maintains the current question index and an in-memory mapping of selected answers. Choosing an option saves it automatically; navigation restores the saved value for each question. Clearing removes only the current answer. This state is transient and is not described as being persisted across application executions.

#### Scoring and review
Finishing the session in `app/main.py` evaluates recorded answers against each question’s `correct` field. It displays the aggregate score and opens a detailed review view covering all sampled questions, selected answers, correct answers, and available justifications. This is the primary assessment boundary: content data enters from JSON, while score and review data are computed locally.

#### PDF export and dependencies
The review flow can export a PDF report from `app/main.py`. This capability depends on ReportLab, declared or installable through `app/requirements.txt`; it is optional and should fail or be unavailable without that package. Python 3.6+ and Tkinter are the material runtime requirements. All normal quiz operation remains local and offline.

Main entry points: [`app/main.py`](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py) (Quiz state), [`app/questions.json`](https://github.com/johnnyalex77/prueba_aws/blob/main/app/questions.json) (Question bank), [`app/requirements.txt`](https://github.com/johnnyalex77/prueba_aws/blob/main/app/requirements.txt) (Dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop runtime"]
  node_main["Tkinter app controller<br/>Python entry point<br/>[main.py]"]
  node_tkinter["Tkinter GUI<br/>Python UI runtime"]
end

subgraph group_content["Local content"]
  node_question_bank["Question bank<br/>JSON content<br/>[questions.json]"]
  node_requirements["Dependencies<br/>requirements file<br/>[requirements.txt]"]
end

subgraph group_session["Quiz session"]
  node_sampler["25-question sampler<br/>session initialization<br/>[main.py]"]
  node_quiz_state["Quiz state<br/>in-memory state<br/>[main.py]"]
  node_navigation["Navigation actions<br/>UI interaction<br/>[main.py]"]
end

subgraph group_output["Assessment output"]
  node_scoring["Scoring engine<br/>local assessment<br/>[main.py]"]
  node_results["Results and review<br/>Tkinter views<br/>[main.py]"]
  node_pdf_export["PDF report export<br/>optional ReportLab output<br/>[main.py]"]
  node_reportlab["ReportLab<br/>optional Python package"]
end

node_main -->|"creates views"| node_tkinter
node_main -->|"loads at startup"| node_question_bank
node_question_bank -->|"source questions"| node_sampler
node_sampler -->|"defines session scope"| node_quiz_state
node_tkinter -->|"user actions"| node_navigation
node_navigation -->|"save, restore, clear"| node_quiz_state
node_quiz_state -->|"current question and progress"| node_tkinter
node_quiz_state -->|"recorded answers"| node_scoring
node_sampler -->|"sampled questions"| node_scoring
node_scoring -->|"score and review data"| node_results
node_results -->|"export request"| node_pdf_export
node_requirements -.->|"declares"| node_reportlab
node_reportlab -.->|"generates report"| node_pdf_export

click node_main "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"
click node_question_bank "https://github.com/johnnyalex77/prueba_aws/blob/main/app/questions.json"
click node_requirements "https://github.com/johnnyalex77/prueba_aws/blob/main/app/requirements.txt"
click node_sampler "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"
click node_quiz_state "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"
click node_navigation "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"
click node_scoring "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"
click node_results "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"
click node_pdf_export "https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_tkinter toneBlue
class node_question_bank,node_requirements toneAmber
class node_sampler,node_quiz_state,node_navigation toneMint
class node_scoring,node_results,node_pdf_export,node_reportlab toneRose
```

## Components

### Desktop runtime

- [Tkinter app controller](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): Python entry point · Owns lifecycle, views, and quiz control flow. · `app/main.py`
- **Tkinter GUI**: Python UI runtime · Renders questions, controls, progress, and result views.

### Local content

- [Question bank](https://github.com/johnnyalex77/prueba_aws/blob/main/app/questions.json): JSON content · Durable questions, options, correct answers, and justifications. · `app/questions.json`
- [Dependencies](https://github.com/johnnyalex77/prueba_aws/blob/main/app/requirements.txt): requirements file · Declares ReportLab for optional PDF export. · `app/requirements.txt`

### Quiz session

- [25-question sampler](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): session initialization · Randomly selects the fixed exam set at launch. · `app/main.py`
- [Quiz state](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): in-memory state · Tracks current index and selected answers. · `app/main.py`
- [Navigation actions](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): UI interaction · Previous, Next, and Clear update or restore session state. · `app/main.py`

### Assessment output

- [Scoring engine](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): local assessment · Compares recorded answers with each question's correct field. · `app/main.py`
- [Results and review](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): Tkinter views · Shows aggregate score and per-question review. · `app/main.py`
- [PDF report export](https://github.com/johnnyalex77/prueba_aws/blob/main/app/main.py): optional ReportLab output · Exports the review report when ReportLab is available. · `app/main.py`
- **ReportLab**: optional Python package

## Connections

- Tkinter app controller → Tkinter GUI: creates views
- Tkinter app controller → Question bank: loads at startup
- Question bank → 25-question sampler: source questions
- 25-question sampler → Quiz state: defines session scope
- Tkinter GUI → Navigation actions: user actions
- Navigation actions → Quiz state: save, restore, clear
- Quiz state → Tkinter GUI: current question and progress
- Quiz state → Scoring engine: recorded answers
- 25-question sampler → Scoring engine: sampled questions
- Scoring engine → Results and review: score and review data
- Results and review → PDF report export: export request
- Dependencies → ReportLab: declares
- ReportLab → PDF report export: generates report
