# cfluxx/cfx-base architecture

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

- Interactive diagram: https://gitdiagram.com/cfluxx/cfx-base
- Repository: https://github.com/cfluxx/cfx-base

## Overview

This is a C++ base library organized around coroutine primitives, filesystem operations, and typed results/errors. No README content was provided, and the sampled source only shows error formatting, so the graph preserves the visible product areas without asserting unsupported call paths between them.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coroutines["Coroutines"]
  node_tasks["Tasks and promises<br/>[task.cppm]"]
  node_handles["Coroutine handles<br/>[handle.cppm]"]
  node_concepts["Coroutine concepts<br/>[concepts.cppm]"]
  node_awaiter_core["Awaiter core<br/>[mod.cppm]"]
  node_io_awaiter["I/O awaiter<br/>[io.cppm]"]
  node_sleep_awaiter["Sleep awaiter<br/>[sleep.cppm]"]
  node_sync_awaiter["Sync awaiter<br/>[sync.cppm]"]
  node_generators["Generators<br/>[mod.cppm]"]
  node_async_generator["Async generator<br/>[async.cppm]"]
  node_sync_generator["Sync generator<br/>[sync.cppm]"]
  node_transform_partitions["Coroutine transforms"]
end

subgraph group_filesystem["Filesystem"]
  node_filesystem_paths["Path operations<br/>[path.cppm]"]
  node_filesystem_read["File reading<br/>[read.cppm]"]
  node_filesystem_write["File writing<br/>[write.cppm]"]
end

subgraph group_results["Results"]
  node_result_api["Result API<br/>[result.cppm]"]
  node_result_types["Result types<br/>[types.cppm]"]
  node_result_errors["Error model<br/>[error.cppm]"]
  node_error_formatting["Error formatting<br/>[error.cc]"]
  node_error_categories["Error categories<br/>[category.cppm]"]
  node_error_codes["Error codes<br/>[code.cppm]"]
  node_error_exceptions["Exception support<br/>[exception.cppm]"]
end

click node_tasks "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/task.cppm"
click node_handles "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/handle.cppm"
click node_concepts "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/concepts.cppm"
click node_awaiter_core "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/mod.cppm"
click node_io_awaiter "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/io.cppm"
click node_sleep_awaiter "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/sleep.cppm"
click node_sync_awaiter "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/sync.cppm"
click node_generators "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/generator/mod.cppm"
click node_async_generator "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/generator/async.cppm"
click node_sync_generator "https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/generator/sync.cppm"
click node_transform_partitions "https://github.com/cfluxx/cfx-base/tree/main/src/coroutine/partiton"
click node_filesystem_paths "https://github.com/cfluxx/cfx-base/blob/main/src/filesystem/path.cppm"
click node_filesystem_read "https://github.com/cfluxx/cfx-base/blob/main/src/filesystem/read.cppm"
click node_filesystem_write "https://github.com/cfluxx/cfx-base/blob/main/src/filesystem/write.cppm"
click node_result_api "https://github.com/cfluxx/cfx-base/blob/main/src/result/result.cppm"
click node_result_types "https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/types.cppm"
click node_result_errors "https://github.com/cfluxx/cfx-base/blob/main/src/result/error.cppm"
click node_error_formatting "https://github.com/cfluxx/cfx-base/blob/main/src/result/impl/error.cc"
click node_error_categories "https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/category.cppm"
click node_error_codes "https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/code.cppm"
click node_error_exceptions "https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/exception.cppm"

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_tasks,node_handles,node_concepts,node_awaiter_core,node_io_awaiter,node_sleep_awaiter,node_sync_awaiter,node_generators,node_async_generator,node_sync_generator,node_transform_partitions toneBlue
class node_filesystem_paths,node_filesystem_read,node_filesystem_write toneAmber
class node_result_api,node_result_types,node_result_errors,node_error_formatting,node_error_categories,node_error_codes,node_error_exceptions toneMint
```

## Components

### Coroutines

- [Tasks and promises](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/task.cppm): `src/coroutine/task.cppm`
- [Coroutine handles](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/handle.cppm): `src/coroutine/handle.cppm`
- [Coroutine concepts](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/concepts.cppm): `src/coroutine/concepts.cppm`
- [Awaiter core](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/mod.cppm): `src/coroutine/awaiter/mod.cppm`
- [I/O awaiter](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/io.cppm): `src/coroutine/awaiter/io.cppm`
- [Sleep awaiter](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/sleep.cppm): `src/coroutine/awaiter/sleep.cppm`
- [Sync awaiter](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/awaiter/sync.cppm): `src/coroutine/awaiter/sync.cppm`
- [Generators](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/generator/mod.cppm): `src/coroutine/generator/mod.cppm`
- [Async generator](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/generator/async.cppm): `src/coroutine/generator/async.cppm`
- [Sync generator](https://github.com/cfluxx/cfx-base/blob/main/src/coroutine/generator/sync.cppm): `src/coroutine/generator/sync.cppm`
- [Coroutine transforms](https://github.com/cfluxx/cfx-base/tree/main/src/coroutine/partiton): `src/coroutine/partiton`

### Filesystem

- [Path operations](https://github.com/cfluxx/cfx-base/blob/main/src/filesystem/path.cppm): `src/filesystem/path.cppm`
- [File reading](https://github.com/cfluxx/cfx-base/blob/main/src/filesystem/read.cppm): `src/filesystem/read.cppm`
- [File writing](https://github.com/cfluxx/cfx-base/blob/main/src/filesystem/write.cppm): `src/filesystem/write.cppm`

### Results

- [Result API](https://github.com/cfluxx/cfx-base/blob/main/src/result/result.cppm): `src/result/result.cppm`
- [Result types](https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/types.cppm): `src/result/partition/types.cppm`
- [Error model](https://github.com/cfluxx/cfx-base/blob/main/src/result/error.cppm): `src/result/error.cppm`
- [Error formatting](https://github.com/cfluxx/cfx-base/blob/main/src/result/impl/error.cc): `src/result/impl/error.cc`
- [Error categories](https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/category.cppm): `src/result/partition/category.cppm`
- [Error codes](https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/code.cppm): `src/result/partition/code.cppm`
- [Exception support](https://github.com/cfluxx/cfx-base/blob/main/src/result/partition/exception.cppm): `src/result/partition/exception.cppm`
