# slovnicki/beamer architecture

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

- Interactive diagram: https://gitdiagram.com/slovnicki/beamer
- Repository: https://github.com/slovnicki/beamer

## Overview

##### And Label Main Components
- Core Navigation Library:
- “beamer.dart” as the entry point.
- Submodules/components in the “package/lib/src” like:
▸ beam_guard.dart
▸ beam_interceptor.dart and beam_interceptor_scope.dart
▸ beam_page.dart and beam_stack.dart
▸ beam_state.dart, beamer_parser.dart, beam_provider.dart, and related dispatcher files.
- That these components work together to implement advanced navigation and state management using Flutter’s Router API.
- Code Generation Bricks:
- “bricks” directory, with a focus on “beam_location”, which includes a brick template for creating beam location files. This helps developers scaffold parts of their applications.
- Usage Examples:
- Together the various examples (under “examples”) that demonstrate authentication, navigation, deep links, multiple beamers, nested navigation, etc.
- Each example can be shown as a client implementation that uses the core navigation library.
- Website/Documentation:
- The “website” folder contains a Flutter web app that likely serves as the documentation and demo portal.
- External Dependencies:
- Flutter itself (especially Navigator 2.0 / Router) as a foundational layer.
- CI/CD (indicated by the “.github/workflows” folder) and community support components (links for Discord, buy-me-a-coffee, etc.)

##### Relationships and Data Flow
- That the bricks are used to generate code that integrates with or expands the core functionality.
- That the documentation/website provides guidance and examples that reference the core package and generated code.
- For example, show how the Beamer Delegate depends on the Parser, which in turn interacts with beam state and beam stack builders.
- That security or guard components (like beam_guard.dart) interact with navigation flows.

##### Architectural Patterns and Design Principles
- The package abstracts complex navigation logic by encapsulating it within well-defined modules.
- It demonstrates modular design, where each module (e.g., interceptors, providers, state management) has a clear responsibility.
- The examples represent different ways to use the package, showing extensibility and flexibility.
- The use of code-generation bricks hints at a DRY (Don’t Repeat Yourself) approach and improved developer ergonomics.

## Diagram (Mermaid)

```mermaid
graph TD
    External["Flutter (Navigator 2.0)"]:::external

    subgraph "Beamer Core Library"
        EntryPoint["Entry Point: beamer.dart"]:::core
        Internal["Internal Modules: package/lib/src (beam_guard.dart, beam_interceptor.dart, beam_interceptor_scope.dart, beam_page.dart, beam_stack.dart, beam_state.dart, beamer_parser.dart, beamer_provider.dart, etc.)"]:::core
        EntryPoint -->|"calls"| Internal
    end

    CodeBricks["Code Generation Bricks"]:::bricks
    Usage["Usage Examples"]:::examples
    Website["Website/Documentation"]:::website

    External -->|"supports"| EntryPoint
    CodeBricks -->|"generatesCodeFor"| Internal
    Internal -->|"providesAPI"| Usage
    Internal -->|"demonstratedBy"| Website

    click EntryPoint "https://github.com/slovnicki/beamer/blob/master/package/lib/beamer.dart"
    click Internal "https://github.com/slovnicki/beamer/tree/master/package/lib/src"
    click CodeBricks "https://github.com/slovnicki/beamer/tree/master/bricks/beam_location"
    click Usage "https://github.com/slovnicki/beamer/tree/master/examples"
    click Website "https://github.com/slovnicki/beamer/tree/master/website"

    classDef core fill:#bbdefb,stroke:#0d47a1,stroke-width:2px,color:#000;
    classDef bricks fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px,color:#000;
    classDef examples fill:#ffe082,stroke:#ff6f00,stroke-width:2px,color:#000;
    classDef website fill:#ffccbc,stroke:#bf360c,stroke-width:2px,color:#000;
    classDef external fill:#d1c4e9,stroke:#512da8,stroke-width:2px,color:#000;
```
