# Overview

## Building blocks

| Part | Path | Responsibility |
|---|---|---|
| Core | `libs/aura-core` | Bindings (`aura/core/binding.h`), logging, string helpers, `TaskRunner` (`aura/core/tasks.h`), capture date from EXIF (`aura/core/exif.h`), machine information (`aura/core/system.h`: free space, uptime, process runtime, memory, kernel, CPU data/load/temperature, fans, board, drives, networking from `/proc` and `/sys`), streaming a directory as a tar archive with a known length and extracting it (`aura/core/tar.h`); no graphics |
| Networking | `libs/aura-net` | HTTP(S) client (`aura/net/http.h`, libcurl), HTTP(S) server with regex routes, streamed responses, uploads to disk and optional client certificates (`aura/net/server.h`, cpp-httplib), certificate creation and verification (`aura/net/tls.h`); web applications on top (`aura/net/web_app.h`: routes with access bits named by the application and assigned through `identify()`, HEAD/OPTIONS, 401 with a Basic challenge or 403, CSRF protection, security headers, CORS between the application's own ports, uploads only after access checks, `onRequest`/`onRouted`/`onResponse` hooks, JSON/file/query helpers), sliding-expiration sessions (`aura/net/sessions.h`) and cryptography (`aura/net/crypto.h`, `aura::crypto`: randomness, Hex/Base64/Base32, MD5/SHA/HMAC, HOTP/TOTP per RFC 4226/6238, AES-256-GCM as IV\|ciphertext\|tag, RSA-OAEP, signatures, key verification and generation, constant-time comparison); no graphics, option `AURA_WITH_NET` |
| Scripting | `libs/aura-script` | JavaScript (ES2023, QuickJS-ng) and Lua (5.4) behind one API: `aura::script::Context` (`Context(Language::Lua)`) with memory and time limits, native functions (`function()`, the same for both languages), values to/from JSON, `console` to logging; no file or network access, Lua includes only safe libraries; option `AURA_WITH_SCRIPT` |
| Remote control | `libs/aura-remote` | Operate and observe an application over HTTP: screenshots (PNG with 304 while unchanged, JPEG), MJPEG stream, taps/drags, keys, scene as JSON (`screen`, `nodes`, `actions`, `screentextelements`, `session`). `aura/remote/remote.h` (routes, aura-net only) provides the `Target` interface; `aura/remote/controller.h` (`aura::remote_ui`) implements it for an `Application`, with hooks for screen/dialog names, session and custom key names. The application determines access rules and path prefix. |
| Language | `libs/aura-lang` | Lexer, parser, AST (`aura/lang/ast.h`), element types and properties (`aura/lang/schema.h`), C++ generator (`src/codegen/`). No dependencies, allowing it to build as a host tool for cross-compilation. |
| Generator | `tools/aurac` | `aurac --out <dir> [--header h] [--context-include h] [--context-type T] [--namespace ns] [--no-line] datei.aura...` |
| UI | `libs/aura-ui` | Scene graph and windows (`aura/ui/node.h`, `application.h`, …), generated-code helpers (`aura/ui/runtime.h`: bindings, blocks, `pressSink`, `str`, …), context (`context.h`), runtime values (`value.h`), dynamic-mode loader (`loader.h`, interpreter in `src/builder/`), QImage-like images (`image.h`: `readImageInfo`, `loadImage` with EXIF rotation and downscaling, HEIF through libheif, `scaled`/`scaledToWidth` Fast/Smooth, `cropped`, `mirrored`, `rotated`, `isGrey`, `grey`, `toRgb` on `sk_sp<SkImage>`), image encoders (`image_codec.h`) and printable codes (`barcode.h`: EAN-13, `BarcodeNode`, pixel-exact QR images) |
| CMake | `cmake/Aura.cmake` | `aura_add_ui(<target> [CONTEXT_INCLUDE <h> CONTEXT_TYPE <T>] [NAMESPACE <ns>] FILES ...)` |

Generator and loader use the same tables (`aura/lang/schema.h`) and rules (property order, dependencies, rebuilding). They therefore construct the same tree.

## An example

```qml
// The smallest AURA dialog (examples/hello): a text and a button that counts the taps.
Dialog Hello {
    signal countChanged(int value)
    property int count
    size: screen.width, screen.height

    Rect {
        id: background
        color: #dede97
        size: parent.width, parent.height
    }
    Text {
        id: title
        text: tr("hello_title", "Hallo AURA")
        pixelSize: 40
        place: centerX, top 120
    }
    Rect {
        id: button
        color: button.pressed ? #1d5bb0 : #246ccc
        radius: 8
        size: 260, 64
        place: centerX, below title 60
        onTap: countChanged(count + 1)
        Text {
            text: "Getippt: " + str(count)
            pixelSize: 24
            color: #ffffff
            place: center
        }
    }
}
```

The example is in `examples/hello/hello.aura` and opens directly with `aura-view examples/hello`. The host provides the context and dialog frame; the loader builds the content and connects properties and signals.
