# alcadox/lexora architecture

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

- Interactive diagram: https://gitdiagram.com/alcadox/lexora
- Repository: https://github.com/alcadox/lexora

## Overview

1. **Overall shape**
   - `Lexora` is a **Windows Forms desktop application** in C#/.NET, organized as a single UI-driven client plus a test project.
   - The solution is split into a **presentation layer** (`Pantallas`), a **shared core/helper layer** (`Core`), and placeholders for **data/business logic** (`Datos`, `Logica`).

2. **Application entry and shell**
   - `Program.cs` is the startup point and likely opens the main window.
   - `MainForm.cs` at the root of the app and `Pantallas/Menu/MainForm.cs` suggest the app’s primary shell is the **menu/dashboard form**, with a dedicated UI subtree for the logged-in experience.

3. **Authentication and onboarding flow**
   - The `Pantallas/InicioSesion` folder contains the full access flow:
     - `InicioSesion` for login,
     - `RegistrarCuenta` for account creation,
     - `FormVerificacion` for verification/confirmation.
   - This indicates a **pre-main-app gate** where user identity is established before entering the main menu.

4. **Main user interface areas**
   - `Pantallas/Menu` contains the post-login application surface.
   - `Pantallas/Menu/Filtros` suggests a dedicated screen or panel for browsing/filtering content, with `ClaseFiltros.cs` acting as the model/controller companion for that UI.
   - `Pantallas/Usuario/PerfilUsuario` is the user profile area, likely reachable from the main menu.

5. **Core subsystem responsibilities**
   - `Core` contains reusable services and cross-cutting logic rather than screen-specific code.
   - Key utilities include:
     - `GestorDBAuth` for authentication/database access,
     - `GestorLogs` for logging,
     - `CorreoUtil` for email actions,
     - `ArchivosUtil` for file operations,
     - `SeguridadUtil` and `SeguridadAvanzadaUtil` for security-related operations,
     - `MotorFiltros` for filter logic,
     - `GestorDragAndDrop`, `GestorMenuContextual`, `GestorMenuDiscos` for UI interaction management,
     - `UIBuilder` for building or wiring UI elements.

6. **Data and business logic boundaries**
   - `Datos` and `Logica` currently contain only `.gitkeep`, which means the architecture anticipates separate layers but they are not yet populated.
   - That suggests the current codebase is **mostly UI + helper-centric**, with future separation planned for persistence and domain logic.

7. **External/service boundary**
   - `Servicios/IAnalizadorIA.cs` defines an AI analysis contract, implying a plug-in or external service boundary for intelligent analysis features.
   - Because it is only an interface in the tree, the repository is prepared to integrate an implementation later without coupling the UI directly to a concrete AI provider.

8. **Cross-cutting concerns**
   - Security, logging, email, and file handling are treated as shared infrastructure concerns under `Core`.
   - This is important architecturally because these features are not isolated to a single screen; they likely support login, registration, verification, and user activity.

9. **Testing boundary**
   - `Lexora.Tests` is a separate test project with tests for `IniciarSesion` and `MainForm`.
   - That indicates at least the login flow and main shell are considered core user journeys and are intended to be validated independently from the app code.

10. **Configuration and resources**
    - The app uses `App.config`, `packages.config`, and an application manifest, so runtime behavior is configured through standard .NET desktop app mechanisms.
    - Resources live under `Properties` and `Resources`, and the `.resx` files next to forms confirm the app follows the usual WinForms pattern of designer-managed UI resources.

11. **Likely runtime flow**
    - The expected sequence is: application starts → login/registration/verification screens → authenticated main menu → feature screens such as filters and user profile.
    - Navigation and interaction behavior is probably coordinated by the `Gestor*` helpers in `Core`, rather than being fully embedded inside the forms.

12. **How to diagram it**
    - Draw the app as a **desktop WinForms client** with:
      - a **presentation layer** containing login, menu, filters, and profile screens,
      - a **core services layer** for security, logging, email, files, filtering, and UI behavior,
      - a **planned persistence/domain layer** (`Datos`, `Logica`) currently mostly empty,
      - a **test project** validating key UI flows.

Main entry points: [`Lexora/Pantallas/Menu/MainForm.cs`](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/MainForm.cs) (Menu), [`Lexora/Pantallas/InicioSesion/InicioSesion.cs`](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/InicioSesion.cs) (Login), [`Lexora/Pantallas/InicioSesion/FormVerificacion.cs`](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/FormVerificacion.cs) (Verify), [`Lexora/Core/GestorDBAuth.cs`](https://github.com/alcadox/lexora/blob/main/Lexora/Core/GestorDBAuth.cs) (Auth DB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_program["Program<br/>startup<br/>[Program.cs]"]
  node_shellroot["Root form<br/>winform shell<br/>[MainForm.cs]"]
end

subgraph group_presentation["Presentation"]
  node_login["Login<br/>auth screen<br/>[InicioSesion.cs]"]
  node_register["Register<br/>auth screen<br/>[RegistrarCuenta.cs]"]
  node_verify["Verify<br/>auth screen"]
  node_menu["Menu<br/>main shell<br/>[MainForm.cs]"]
  node_filtersui["Filters UI<br/>feature screen<br/>[MainFiltros.cs]"]
  node_filtermodel["Filter model<br/>ui companion<br/>[ClaseFiltros.cs]"]
  node_profile["Profile<br/>user screen<br/>[PerfilUsuario.cs]"]
end

subgraph group_core["Core"]
  node_authdb["Auth DB<br/>auth service<br/>[GestorDBAuth.cs]"]
  node_security["Security<br/>[SeguridadUtil.cs]"]
  node_advancedsec["Advanced sec<br/>security util"]
  node_logs["Logs<br/>logging service<br/>[GestorLogs.cs]"]
  node_email["Email<br/>mail util<br/>[CorreoUtil.cs]"]
  node_files["Files<br/>file util<br/>[ArchivosUtil.cs]"]
  node_filtengine["Filter engine<br/>filter service<br/>[MotorFiltros.cs]"]
  node_uihelpers["UI helpers<br/>interaction helpers<br/>[UIBuilder.cs]"]
end

subgraph group_data["Planned layers"]
  node_dataplace["Datos<br/>planned layer<br/>[.gitkeep]"]
  node_logicplace["Logica<br/>planned layer<br/>[.gitkeep]"]
end

subgraph group_services["Services"]
  node_analyzer["AI analyzer<br/>service contract<br/>[IAnalizadorIA.cs]"]
end

subgraph group_tests["Tests"]
  node_apptests["Tests<br/>test project"]
  node_logintest["Login test<br/>ui test"]
  node_maintest["Main form test<br/>ui test<br/>[MainFormTest.cs]"]
end

node_program -->|"starts with"| node_login
node_program -.->|"alternative shell"| node_shellroot
node_login -->|"navigates to"| node_register
node_login -->|"navigates to"| node_verify
node_verify -->|"enters"| node_menu
node_register -->|"confirms"| node_verify
node_menu -->|"opens"| node_filtersui
node_menu -->|"opens"| node_profile
node_filtersui -->|"uses"| node_filtermodel
node_login -->|"authenticates via"| node_authdb
node_register -->|"creates via"| node_authdb
node_verify -->|"sends"| node_email
node_login -->|"protects with"| node_security
node_menu -->|"filters with"| node_filtengine
node_menu -->|"coordinates with"| node_uihelpers
node_authdb -.->|"logs through"| node_logs
node_authdb -.->|"reads/writes"| node_files
node_security -->|"extends"| node_advancedsec
node_apptests -->|"contains"| node_logintest
node_apptests -->|"contains"| node_maintest
node_logintest -->|"validates"| node_login
node_maintest -->|"validates"| node_menu
node_dataplace -.->|"paired layers"| node_logicplace
node_menu -.->|"may invoke"| node_analyzer

click node_program "https://github.com/alcadox/lexora/blob/main/Lexora/Program.cs"
click node_shellroot "https://github.com/alcadox/lexora/blob/main/Lexora/MainForm.cs"
click node_login "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/InicioSesion.cs"
click node_register "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/RegistrarCuenta.cs"
click node_verify "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/FormVerificacion.cs"
click node_menu "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/MainForm.cs"
click node_filtersui "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/Filtros/MainFiltros.cs"
click node_filtermodel "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/Filtros/ClaseFiltros.cs"
click node_profile "https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Usuario/PerfilUsuario.cs"
click node_authdb "https://github.com/alcadox/lexora/blob/main/Lexora/Core/GestorDBAuth.cs"
click node_security "https://github.com/alcadox/lexora/blob/main/Lexora/Core/SeguridadUtil.cs"
click node_advancedsec "https://github.com/alcadox/lexora/blob/main/Lexora/Core/SeguridadAvanzadaUtil.cs"
click node_logs "https://github.com/alcadox/lexora/blob/main/Lexora/Core/GestorLogs.cs"
click node_email "https://github.com/alcadox/lexora/blob/main/Lexora/Core/CorreoUtil.cs"
click node_files "https://github.com/alcadox/lexora/blob/main/Lexora/Core/ArchivosUtil.cs"
click node_filtengine "https://github.com/alcadox/lexora/blob/main/Lexora/Core/MotorFiltros.cs"
click node_uihelpers "https://github.com/alcadox/lexora/blob/main/Lexora/Core/UIBuilder.cs"
click node_analyzer "https://github.com/alcadox/lexora/blob/main/Lexora/Servicios/IAnalizadorIA.cs"
click node_dataplace "https://github.com/alcadox/lexora/blob/main/Lexora/Datos/.gitkeep"
click node_logicplace "https://github.com/alcadox/lexora/blob/main/Lexora/Logica/.gitkeep"
click node_apptests "https://github.com/alcadox/lexora/blob/main/Lexora.Tests/Lexora.Tests.csproj"
click node_logintest "https://github.com/alcadox/lexora/blob/main/Lexora.Tests/IniciarSesionTest.cs"
click node_maintest "https://github.com/alcadox/lexora/blob/main/Lexora.Tests/MainFormTest.cs"

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_program,node_shellroot toneBlue
class node_login,node_register,node_verify,node_menu,node_filtersui,node_filtermodel,node_profile toneAmber
class node_authdb,node_security,node_advancedsec,node_logs,node_email,node_files,node_filtengine,node_uihelpers toneMint
class node_dataplace,node_logicplace toneRose
class node_analyzer toneIndigo
class node_apptests,node_logintest,node_maintest toneTeal
```

## Components

### Application

WinForms desktop client and UI shell

- [Program](https://github.com/alcadox/lexora/blob/main/Lexora/Program.cs): startup · Application entry point that launches the desktop UI · `Lexora/Program.cs`
- [Root form](https://github.com/alcadox/lexora/blob/main/Lexora/MainForm.cs): winform shell · Top-level form at the app root · `Lexora/MainForm.cs`

### Presentation

Screens and forms for login and main workflows

- [Login](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/InicioSesion.cs): auth screen · Primary sign-in screen · `Lexora/Pantallas/InicioSesion/InicioSesion.cs`
- [Register](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/RegistrarCuenta.cs): auth screen · Account creation screen · `Lexora/Pantallas/InicioSesion/RegistrarCuenta.cs`
- [Verify](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/InicioSesion/FormVerificacion.cs): auth screen · Verification and confirmation screen · `Lexora/Pantallas/InicioSesion/FormVerificacion.cs`
- [Menu](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/MainForm.cs): main shell · Post-login main application surface · `Lexora/Pantallas/Menu/MainForm.cs`
- [Filters UI](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/Filtros/MainFiltros.cs): feature screen · Dedicated filters screen or panel · `Lexora/Pantallas/Menu/Filtros/MainFiltros.cs`
- [Filter model](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Menu/Filtros/ClaseFiltros.cs): ui companion · Supporting class for filter behavior · `Lexora/Pantallas/Menu/Filtros/ClaseFiltros.cs`
- [Profile](https://github.com/alcadox/lexora/blob/main/Lexora/Pantallas/Usuario/PerfilUsuario.cs): user screen · User profile area · `Lexora/Pantallas/Usuario/PerfilUsuario.cs`

### Core

Shared services and cross-cutting helpers

- [Auth DB](https://github.com/alcadox/lexora/blob/main/Lexora/Core/GestorDBAuth.cs): auth service · Authentication and database access helper · `Lexora/Core/GestorDBAuth.cs`
- [Security](https://github.com/alcadox/lexora/blob/main/Lexora/Core/SeguridadUtil.cs): security util · Shared security and protection utilities · `Lexora/Core/SeguridadUtil.cs`
- [Advanced sec](https://github.com/alcadox/lexora/blob/main/Lexora/Core/SeguridadAvanzadaUtil.cs): security util · Extended security helpers · `Lexora/Core/SeguridadAvanzadaUtil.cs`
- [Logs](https://github.com/alcadox/lexora/blob/main/Lexora/Core/GestorLogs.cs): logging service · Application logging helper · `Lexora/Core/GestorLogs.cs`
- [Email](https://github.com/alcadox/lexora/blob/main/Lexora/Core/CorreoUtil.cs): mail util · Email delivery helper · `Lexora/Core/CorreoUtil.cs`
- [Files](https://github.com/alcadox/lexora/blob/main/Lexora/Core/ArchivosUtil.cs): file util · File handling helper · `Lexora/Core/ArchivosUtil.cs`
- [Filter engine](https://github.com/alcadox/lexora/blob/main/Lexora/Core/MotorFiltros.cs): filter service · Reusable filtering logic · `Lexora/Core/MotorFiltros.cs`
- [UI helpers](https://github.com/alcadox/lexora/blob/main/Lexora/Core/UIBuilder.cs): interaction helpers · Drag-and-drop, context menu, disk menu, and UI building helpers · `Lexora/Core/UIBuilder.cs`

### Planned layers

Reserved persistence and domain folders currently empty

- [Datos](https://github.com/alcadox/lexora/blob/main/Lexora/Datos/.gitkeep): planned layer · Reserved persistence layer, currently empty · `Lexora/Datos/.gitkeep`
- [Logica](https://github.com/alcadox/lexora/blob/main/Lexora/Logica/.gitkeep): planned layer · Reserved domain logic layer, currently empty · `Lexora/Logica/.gitkeep`

### Services

External or pluggable service contracts

- [AI analyzer](https://github.com/alcadox/lexora/blob/main/Lexora/Servicios/IAnalizadorIA.cs): service contract · Interface for plug-in or external AI analysis · `Lexora/Servicios/IAnalizadorIA.cs`

### Tests

Separate test project covering key flows

- [Tests](https://github.com/alcadox/lexora/blob/main/Lexora.Tests/Lexora.Tests.csproj): test project · Unit and integration tests for core UI flows · `Lexora.Tests/Lexora.Tests.csproj`
- [Login test](https://github.com/alcadox/lexora/blob/main/Lexora.Tests/IniciarSesionTest.cs): ui test · Tests for the sign-in flow · `Lexora.Tests/IniciarSesionTest.cs`
- [Main form test](https://github.com/alcadox/lexora/blob/main/Lexora.Tests/MainFormTest.cs): ui test · Tests for the main shell · `Lexora.Tests/MainFormTest.cs`

## Connections

- Program → Login: starts with · Startup opens the authentication flow
- Program → Root form: alternative shell · Root form is another top-level entry screen
- Login → Register: navigates to · Login can open account creation
- Login → Verify: navigates to · Login and registration flow into verification
- Verify → Menu: enters · Verified users proceed into the main app
- Register → Verify: confirms · Registration completes through verification
- Menu → Filters UI: opens · Main menu exposes the filters feature
- Menu → Profile: opens · Main menu exposes the user profile area
- Filters UI → Filter model: uses · Filter screen delegates logic to its companion class
- Login → Auth DB: authenticates via · Sign-in likely validates credentials through the auth helper
- Register → Auth DB: creates via · Account creation likely persists through auth/database helper
- Verify → Email: sends · Verification flow depends on email support
- Login → Security: protects with · Authentication relies on security utilities
- Menu → Filter engine: filters with · Menu features depend on shared filtering logic
- Menu → UI helpers: coordinates with · Menu and interaction helpers manage UI behavior
- Auth DB → Logs: logs through · Shared infrastructure is expected to record auth activity
- Auth DB → Files: reads/writes · Auth workflows may use file helpers for supporting data
- Security → Advanced sec: extends · Advanced security helpers build on the base security layer
- Tests → Login test: contains · Test project covers the sign-in journey
- Tests → Main form test: contains · Test project covers the main shell
- Login test → Login: validates · Login tests exercise the authentication screen
- Main form test → Menu: validates · Main form tests exercise the app shell
- Datos → Logica: paired layers · Reserved persistence and domain layers are both present but empty
- Menu → AI analyzer: may invoke · The app is prepared for AI analysis integration
