# thomas-mewily/hexga architecture

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

- Interactive diagram: https://gitdiagram.com/thomas-mewily/hexga
- Repository: https://github.com/thomas-mewily/hexga

## Overview

HexGa is an experimental, trait-oriented Rust workspace of reusable crates rather than a single application. Its user workflow is crate selection and composition: Rust developers import a crate or prelude, then use capabilities such as math, bit operations, collections, encoding, assets, or graphics. The tree shows distinct domain libraries and an experimental engine stack, but sampled evidence does not establish most runtime call paths between them. Edges below are limited to module references visible in the source index or excerpts; unsampled capabilities are represented without guessed connections.

Main entry points: [`crates/hexga_core/src/lib.rs`](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/lib.rs) (Core traits), [`experimental/hexga_asset/src/asset.rs`](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_asset/src/asset.rs) (Asset management), [`experimental/hexga_engine/src/app/application.rs`](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_engine/src/app/application.rs) (Application runner), [`crates/hexga_core/src/collections/collection.rs`](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/collections/collection.rs) (Collections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Core utilities"]
  node_hexga["HexGa facade<br/>[lib.rs]"]
  node_core["Core traits<br/>[lib.rs]"]
  node_allocation["Allocation<br/>[alloc.rs]"]
  node_collections["Collections<br/>[collection.rs]"]
  node_iterators["Iterator utilities<br/>[try_from_iter.rs]"]
  node_format["Formatting<br/>[format.rs]"]
  node_wrapper["Type wrappers<br/>[wrapper.rs]"]
  node_mapon["Token mapping macros<br/>[map_on_common.rs]"]
end

subgraph group_data["Data and math"]
  node_bit["Bit operations<br/>[bit_pattern.rs]"]
  node_bitderive["Bit derive macros<br/>[traits.rs]"]
  node_bitflags["Bitflags<br/>[lib.rs]"]
  node_arrays["Array utilities<br/>[array.rs]"]
  node_generational["Generational collections<br/>[gen_seq.rs]"]
  node_math["Math and geometry"]
  node_numbers["Number types<br/>[floating.rs]"]
end

subgraph group_experimental["Experimental services"]
  node_encoding["Encoding and serialization"]
  node_io["File and path I/O"]
  node_assets["Asset management<br/>[asset.rs]"]
end

subgraph group_engine["Engine and graphics"]
  node_eventloop["Event loop and input<br/>[event_handler.rs]"]
  node_engineapp["Application runner<br/>[application.rs]"]
  node_graphics["Graphics and meshes"]
  node_image["Image and color<br/>[img.rs]"]
  node_wgpu["GPU backend<br/>[context.rs]"]
end

node_developer(("Rust developer"))

node_developer -->|"imports crate"| node_hexga
node_core -->|"exports module"| node_allocation
node_core -->|"exports module"| node_collections
node_core -->|"exports module"| node_iterators
node_core -->|"exports module"| node_format
node_collections -.->|"uses iteration"| node_iterators
node_bitderive -->|"generates trait impls"| node_bit
node_mapon -->|"maps number types"| node_numbers
node_engineapp -.->|"runs events"| node_eventloop
node_engineapp -.->|"uses rendering"| node_graphics
node_graphics -.->|"uses GPU backend"| node_wgpu
node_assets -.->|"uses file I/O"| node_io
node_assets -.->|"uses encoding"| node_encoding

click node_hexga "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga/src/lib.rs"
click node_core "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/lib.rs"
click node_allocation "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/allocation/alloc.rs"
click node_collections "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/collections/collection.rs"
click node_iterators "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/iter/try_from_iter.rs"
click node_format "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/format.rs"
click node_wrapper "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/wrapper.rs"
click node_mapon "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_map_on/src/map_on_common.rs"
click node_bit "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_bit/src/bit_pattern.rs"
click node_bitderive "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_bit_derive/src/traits.rs"
click node_bitflags "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_bitflags/src/lib.rs"
click node_arrays "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_array/src/array.rs"
click node_generational "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_generational/src/gen_seq.rs"
click node_math "https://github.com/thomas-mewily/hexga/tree/master/crates/hexga_math/src/geometry"
click node_numbers "https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_number/src/arithmetic/floating.rs"
click node_encoding "https://github.com/thomas-mewily/hexga/tree/master/experimental/hexga_encoding/src"
click node_io "https://github.com/thomas-mewily/hexga/tree/master/experimental/hexga_io/src"
click node_assets "https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_asset/src/asset.rs"
click node_eventloop "https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_event_loop/src/event_loop/event_handler.rs"
click node_engineapp "https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_engine/src/app/application.rs"
click node_graphics "https://github.com/thomas-mewily/hexga/tree/master/experimental/hexga_graphics/src"
click node_image "https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_image/src/image/img.rs"
click node_wgpu "https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_wgpu/src/context.rs"

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_hexga,node_core,node_allocation,node_collections,node_iterators,node_format,node_wrapper,node_mapon toneBlue
class node_bit,node_bitderive,node_bitflags,node_arrays,node_generational,node_math,node_numbers toneAmber
class node_encoding,node_io,node_assets toneMint
class node_eventloop,node_engineapp,node_graphics,node_image,node_wgpu toneRose
class node_developer toneIndigo
```

## Components

### Core utilities

- [HexGa facade](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga/src/lib.rs): `crates/hexga/src/lib.rs`
- [Core traits](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/lib.rs): `crates/hexga_core/src/lib.rs`
- [Allocation](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/allocation/alloc.rs): `crates/hexga_core/src/allocation/alloc.rs`
- [Collections](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/collections/collection.rs): `crates/hexga_core/src/collections/collection.rs`
- [Iterator utilities](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/iter/try_from_iter.rs): `crates/hexga_core/src/iter/try_from_iter.rs`
- [Formatting](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/format.rs): `crates/hexga_core/src/format.rs`
- [Type wrappers](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_core/src/wrapper.rs): `crates/hexga_core/src/wrapper.rs`
- [Token mapping macros](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_map_on/src/map_on_common.rs): `crates/hexga_map_on/src/map_on_common.rs`

### Data and math

- [Bit operations](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_bit/src/bit_pattern.rs): `crates/hexga_bit/src/bit_pattern.rs`
- [Bit derive macros](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_bit_derive/src/traits.rs): `crates/hexga_bit_derive/src/traits.rs`
- [Bitflags](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_bitflags/src/lib.rs): `crates/hexga_bitflags/src/lib.rs`
- [Array utilities](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_array/src/array.rs): `crates/hexga_array/src/array.rs`
- [Generational collections](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_generational/src/gen_seq.rs): `crates/hexga_generational/src/gen_seq.rs`
- [Math and geometry](https://github.com/thomas-mewily/hexga/tree/master/crates/hexga_math/src/geometry): `crates/hexga_math/src/geometry`
- [Number types](https://github.com/thomas-mewily/hexga/blob/master/crates/hexga_number/src/arithmetic/floating.rs): `crates/hexga_number/src/arithmetic/floating.rs`

### Experimental services

- [Encoding and serialization](https://github.com/thomas-mewily/hexga/tree/master/experimental/hexga_encoding/src): `experimental/hexga_encoding/src`
- [File and path I/O](https://github.com/thomas-mewily/hexga/tree/master/experimental/hexga_io/src): `experimental/hexga_io/src`
- [Asset management](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_asset/src/asset.rs): `experimental/hexga_asset/src/asset.rs`

### Engine and graphics

- [Event loop and input](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_event_loop/src/event_loop/event_handler.rs): `experimental/hexga_event_loop/src/event_loop/event_handler.rs`
- [Application runner](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_engine/src/app/application.rs): `experimental/hexga_engine/src/app/application.rs`
- [Graphics and meshes](https://github.com/thomas-mewily/hexga/tree/master/experimental/hexga_graphics/src): `experimental/hexga_graphics/src`
- [Image and color](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_image/src/image/img.rs): `experimental/hexga_image/src/image/img.rs`
- [GPU backend](https://github.com/thomas-mewily/hexga/blob/master/experimental/hexga_wgpu/src/context.rs): `experimental/hexga_wgpu/src/context.rs`

### Other components

- **Rust developer**

## Connections

- Rust developer → HexGa facade: imports crate (evidence: `README.md`)
- Core traits → Allocation: exports module (evidence: `crates/hexga_core/src/lib.rs`)
- Core traits → Collections: exports module (evidence: `crates/hexga_core/src/lib.rs`)
- Core traits → Iterator utilities: exports module (evidence: `crates/hexga_core/src/lib.rs`)
- Core traits → Formatting: exports module (evidence: `crates/hexga_core/src/lib.rs`)
- Collections → Iterator utilities: uses iteration
- Bit derive macros → Bit operations: generates trait impls
- Token mapping macros → Number types: maps number types
- Application runner → Event loop and input: runs events
- Application runner → Graphics and meshes: uses rendering
- Graphics and meshes → GPU backend: uses GPU backend
- Asset management → File and path I/O: uses file I/O
- Asset management → Encoding and serialization: uses encoding
