# hanneswidrig/tech-screener architecture

> Architecture diagram of the GitHub repository hanneswidrig/tech-screener, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hanneswidrig/tech-screener
- Repository: https://github.com/hanneswidrig/tech-screener

## Overview

##### Project type and purpose
- This is a SvelteKit–powered single-page quiz application that runs entirely in the browser (no dedicated backend).
- The user takes a quiz using questions from a local question bank; the app manages state in client-side stores and displays scores and summaries.

##### File structure
- Top level:
- src/
– app.html, app.css: the HTML shell and global styles.
– lib/: reusable UI components (Button, Sidebar, ScoreSummary, etc.), data (question-bank.ts, topic-group.ts), state stores (quiz, questions, topic) and utility functions (calculate_score).
– routes/: file-based routing:
- +layout.svelte, +page.svelte for the main layout and home page
- /quiz/+page.svelte for the quiz UI page
- +error.svelte for error handling.
- static/: robots.txt and any other static assets.
- Config files for TypeScript, Vite, ESLint, Prettier, Playwright (e2e tests).
- e2e/: end-to-end tests written in Playwright.
- There is no separate “backend” directory; the entire logic lives client-side. The build system uses Vite and the SvelteKit adapter (presumably adapter-auto or static) to produce a static bundle.

##### README for additional insights
- The README is the default “create-svelte” template. It confirms that SvelteKit and Vite are the development frameworks, and that the project is intended to be deployed as a static or server-generated site.

→ from “Browser” to “Static Host” for initial GET
→ from “Bundle” to “Router” for runtime navigation
→ between components and stores to show reads/writes
- Blue rectangles for UI components
- Yellow rectangles for utility modules
- Gray clouds for external systems (e.g., static host, Playwright test runner)

##### Detailed capturing of essential elements
- Don’t overcomplicate: break the app into these main tiers—Hosting/Build, Client Runtime, Routing, UI Components, State, Data, Utilities, Testing.

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% Hosting & Build Layer
  subgraph "Hosting & Build Layer"
    SVELTEKIT["SvelteKit Runtime"]:::config
    VITE["Vite Dev Server & Bundler"]:::config
    HTML["App Shell<br>(src/app.html)"]:::external
    CSS["Global Styles<br>(src/app.css)"]:::external
    SVELTEKIT --> VITE
    HTML --> VITE
    CSS --> VITE
  end

  %% Static Assets Host
  subgraph "Static Assets Host"
    STATIC["Static Assets"]:::external
  end

  %% Client Runtime (Browser)
  subgraph "Client Runtime (Browser)"
    BROWSER["Browser"]:::external
    APPBundle["JS Bundle"]:::config
    BROWSER --> STATIC
    STATIC --> HTML
    STATIC --> APPBundle
    BROWSER --> APPBundle
  end

  %% Routing Layer
  subgraph "Routing Layer"
    Layout["Layout Component"]:::ui
    Home["Home Page"]:::ui
    QuizPage["Quiz Page"]:::ui
    ErrorPage["Error Page"]:::ui
    APPBundle --> Layout
    Layout --> Home
    Layout --> QuizPage
    Layout --> ErrorPage
  end

  %% UI Components
  subgraph "UI Components"
    Button["Button"]:::ui
    ContentSelector["ContentSelector"]:::ui
    Question["Question"]:::ui
    ScoreSummary["ScoreSummary"]:::ui
    Sidebar["Sidebar"]:::ui
    TopicSwitcher["TopicSwitcher"]:::ui
    Layout --> Button
    Layout --> ContentSelector
    Layout --> Question
    Layout --> ScoreSummary
    Layout --> Sidebar
    Layout --> TopicSwitcher
  end

  %% State Stores
  subgraph "State Stores"
    QuestionsStore["Questions Store"]:::store
    QuizStore["Quiz Store"]:::store
    TopicStore["Topic Store"]:::store
    Button --> QuestionsStore
    Question --> QuestionsStore
    ContentSelector --> TopicStore
    TopicSwitcher --> TopicStore
    ScoreSummary --> QuizStore
    Home --> QuizStore
    QuizPage --> QuizStore
  end

  %% Data Sources
  subgraph "Data Sources"
    QBank["Question Bank"]:::data
    TGroups["Topic Groups"]:::data
    QuestionsStore --> QBank
    TopicStore --> TGroups
  end

  %% Utilities
  subgraph "Utilities"
    CalcScore["calculate_score"]:::util
    QuizStore --> CalcScore
    CalcScore --> QuizStore
  end

  %% Testing
  subgraph "Testing"
    E2E["Playwright Tests"]:::external
    E2E --> BROWSER
  end

  %% Configurations
  subgraph "Configurations"
    SvelteConfig["svelte.config.js"]:::config
    ViteConfig["vite.config.ts"]:::config
    TSCConfig["tsconfig.json"]:::config
    PWConfig["playwright.config.ts"]:::config
    VITE --> ViteConfig
    SVELTEKIT --> SvelteConfig
    E2E --> PWConfig
  end

  %% Click Events
  click HTML "https://github.com/hanneswidrig/tech-screener/blob/main/src/app.html"
  click CSS "https://github.com/hanneswidrig/tech-screener/blob/main/src/app.css"
  click Layout "https://github.com/hanneswidrig/tech-screener/blob/main/src/routes/+layout.svelte"
  click Home "https://github.com/hanneswidrig/tech-screener/blob/main/src/routes/+page.svelte"
  click QuizPage "https://github.com/hanneswidrig/tech-screener/blob/main/src/routes/quiz/+page.svelte"
  click ErrorPage "https://github.com/hanneswidrig/tech-screener/blob/main/src/routes/+error.svelte"
  click Button "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/Button.svelte"
  click ContentSelector "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/ContentSelector.svelte"
  click Question "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/Question.svelte"
  click ScoreSummary "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/ScoreSummary.svelte"
  click Sidebar "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/Sidebar.svelte"
  click TopicSwitcher "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/TopicSwitcher.svelte"
  click QBank "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/data/question-bank.ts"
  click TGroups "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/data/topic-group.ts"
  click QuestionsStore "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/store/questions.svelte.ts"
  click QuizStore "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/store/quiz.svelte.ts"
  click TopicStore "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/store/topic.svelte.ts"
  click CalcScore "https://github.com/hanneswidrig/tech-screener/blob/main/src/lib/utils/calculate_score.ts"
  click STATIC "https://github.com/hanneswidrig/tech-screener/tree/main/static/"
  click E2E "https://github.com/hanneswidrig/tech-screener/blob/main/e2e/example.spec.ts"
  click SvelteConfig "https://github.com/hanneswidrig/tech-screener/blob/main/svelte.config.js"
  click ViteConfig "https://github.com/hanneswidrig/tech-screener/blob/main/vite.config.ts"
  click TSCConfig "https://github.com/hanneswidrig/tech-screener/blob/main/tsconfig.json"
  click PWConfig "https://github.com/hanneswidrig/tech-screener/blob/main/playwright.config.ts"

  %% Styles
  classDef ui fill:#D0E8FF,stroke:#0366d6
  classDef store fill:#D0FFD6,stroke:#028a0f
  classDef data fill:#FFF5BA,stroke:#d4a200
  classDef util fill:#FFF0D6,stroke:#d37f00
  classDef external fill:#E0E0E0,stroke:#999999,stroke-dasharray:5 5
  classDef config fill:#F0D6FF,stroke:#a52ed6
```
