# sadroad/auspex architecture

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

- Interactive diagram: https://gitdiagram.com/sadroad/auspex
- Repository: https://github.com/sadroad/auspex

## Overview

##### The Client Application
- Located in the "client" directory with its own Cargo.toml and source files (client/src/main.rs).
- Likely responsible for user interaction or providing an interface that communicates with the backend server.

##### The Server Application
- Located in the "server" directory, again with its own Cargo.toml and a main source file (server/src/main.rs).
- This likely handles backend logic, business processes, data management, or acting as an API server.

##### Additional Artifacts and Configuration
- The top-level Cargo.lock, Cargo.toml indicate project-wide dependency tracking (if there is any shared configuration).
- Presence of flake.nix and flake.lock suggests that the project might use Nix for reproducible builds and dependency management.
- The justfile might be used for task automation (e.g., building, running tests, or deployments).

##### Main Components
a. Client (Frontend): Represent the client package as a component. Label it clearly as “Client (Rust)” or “User Interface”.
b. Server (Backend): Create a separate block for the server with a clear label, e.g., “Server (Rust)”.
c. Build and Deployment Tools: Optionally include nodes for “Nix Flake” and “Task Runner (Just)” to indicate the configuration and automation tooling used.

##### Relationships and Interactions
c. (Optional) Represent the integration between the Nix-based build environment and the overall build process, showing how it interacts with both client and server components.

##### Relevant Technologies and Frameworks
a. Rust: Mark both client and server as being built using Rust, which may have implications for how communication and concurrency are handled.
b. Cargo: For dependency management and building the Rust applications.
c. Nix: As indicated by flake.nix and flake.lock, highlight that there is a configuration for reproducible builds.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Application Components"
        Client["Client (Rust Application)"]
        Server["Server (Rust Application)"]
    end

    subgraph "Build & Automation Tools"
        Cargo["Cargo (Dependency Management)"]
        Nix["Nix (Reproducible Build)"]
        Just["Just (Task Automation)"]
    end

    Client <-->|"API calls"| Server
    Cargo -->|"builds"| Client
    Cargo -->|"builds"| Server
    Nix -->|"builds"| Client
    Nix -->|"builds"| Server
    Just -->|"automates"| Client
    Just -->|"automates"| Server

    click Client "https://github.com/sadroad/auspex/blob/main/client/Cargo.toml"
    click Client "https://github.com/sadroad/auspex/blob/main/client/src/main.rs"
    click Server "https://github.com/sadroad/auspex/blob/main/server/Cargo.toml"
    click Server "https://github.com/sadroad/auspex/blob/main/server/src/main.rs"
    click Cargo "https://github.com/sadroad/auspex/blob/main/Cargo.toml"
    click Cargo "https://github.com/sadroad/auspex/blob/main/Cargo.lock"
    click Nix "https://github.com/sadroad/auspex/blob/main/flake.nix"
    click Nix "https://github.com/sadroad/auspex/blob/main/flake.lock"
    click Just "https://github.com/sadroad/auspex/tree/main/justfile"

    classDef app fill:#b3e5fc,stroke:#0277bd,stroke-width:2px;
    classDef tool fill:#ffe082,stroke:#ff6f00,stroke-width:2px;
    class Client,Server app
    class Cargo,Nix,Just tool
```
