# gonzaloarenasf/bap_framework architecture

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

- Interactive diagram: https://gitdiagram.com/gonzaloarenasf/bap_framework
- Repository: https://github.com/gonzaloarenasf/bap_framework

## Overview

BaP is a vanilla-JavaScript web application framework with a browser runtime, reusable custom elements, and optional Firebase, Google Drive, and Gemini integrations. The principal workflow starts at the application entry point, initializes components and localization, then delegates navigation to the router, which applies route and authorization rules. Pages demonstrate framework capabilities, including component demos and migration tooling. The graph preserves documented core modules even where their implementation was not sampled; dashed, uncited edges mark those unverified integrations.

Main entry points: [`src/_main/router.js`](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/router.js) (Router), [`src/index.js`](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/index.js) (App Entry), [`src/pages/components/index.js`](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/pages/components/index.js) (Component Gallery), [`src/_main/i18n.js`](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/i18n.js) (Localization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Core"]
  node_entry["App Entry<br/>[index.js]"]
  node_router["Router<br/>[router.js]"]
  node_routeconfig["Route Map<br/>[routerPaths.js]"]
  node_localization["Localization<br/>[i18n.js]"]
  node_dictionary["Spanish Dictionary<br/>[es-ES.js]"]
  node_constants["Runtime Configuration<br/>[constants.js]"]
  node_utilities["Shared Utilities<br/>[util.js]"]
end

subgraph group_pages["Application Pages"]
  node_components["Component Gallery<br/>[index.js]"]
  node_migrator["Project Migrator<br/>[index.js]"]
  node_coredocs["Core Module Pages"]
  node_otherpages["Framework Pages"]
end

subgraph group_ui["Web Components"]
  node_registration["Component Registration"]
  node_componentset["Custom Elements"]
  node_dialog["Dialog Element<br/>[bap-dialog.js]"]
  node_notification["Notification Element"]
end

subgraph group_services["Services and Integrations"]
  node_authentication["Authentication<br/>[auth.js]"]
  node_firebase["Firebase Gateway<br/>[firebaseInit.js]"]
  node_analytics["Analytics<br/>[analytics.js]"]
  node_storage["Storage<br/>[storage.js]"]
  node_ai["Gemini AI<br/>[ai.js]"]
  node_drive["Google Drive<br/>[googleDrive.js]"]
  node_markdown["Markdown Parser<br/>[markdown.js]"]
end

node_browser(("Browser User"))
node_database[("Realtime Database")]

node_browser -->|"opens app"| node_entry
node_entry -->|"starts session"| node_router
node_entry -->|"uses routes"| node_routeconfig
node_entry -->|"registers elements"| node_registration
node_entry -->|"applies translations"| node_localization
node_entry -->|"logs entry"| node_analytics
node_router -->|"uses routes"| node_routeconfig
node_router -->|"checks access"| node_authentication
node_router -->|"gets messages"| node_localization
node_router -->|"shows notices"| node_utilities
node_localization -->|"loads language"| node_dictionary
node_registration -->|"registers elements"| node_componentset
node_registration -->|"uses helpers"| node_utilities
node_components -->|"starts session"| node_router
node_components -->|"registers elements"| node_registration
node_components -->|"creates demo"| node_dialog
node_components -->|"shows demo"| node_notification
node_components -->|"logs visit"| node_analytics
node_utilities -->|"creates notice"| node_notification
node_dialog -->|"sanitizes content"| node_localization
node_authentication -->|"uses services"| node_firebase
node_authentication -->|"uses persistence"| node_storage
node_analytics -->|"logs events"| node_firebase
node_storage -->|"reads and writes"| node_database
node_firebase -.->|"initializes service"| node_database
node_ai -.->|"calls Gemini API"| node_browser
node_drive -.->|"calls Drive API"| node_browser
node_migrator -->|"uses parser"| node_markdown
node_migrator -->|"uses translations"| node_localization
node_migrator -->|"uses telemetry"| node_analytics
node_coredocs -.->|"documents capability"| node_ai
node_coredocs -.->|"documents capability"| node_drive
node_coredocs -.->|"documents capability"| node_storage
node_coredocs -.->|"documents capability"| node_authentication
node_otherpages -.->|"uses navigation"| node_router

click node_entry "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/index.js"
click node_router "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/router.js"
click node_routeconfig "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/routerPaths.js"
click node_localization "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/i18n.js"
click node_dictionary "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/i18n/es-ES.js"
click node_constants "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/constants.js"
click node_utilities "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/util.js"
click node_registration "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_components/customComponentsRegistration.js"
click node_components "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/pages/components/index.js"
click node_componentset "https://github.com/gonzaloarenasf/bap_framework/tree/main/src/_components"
click node_dialog "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_components/bap-dialog/bap-dialog.js"
click node_notification "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_components/bap-notification/bap-notification.js"
click node_authentication "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/auth.js"
click node_firebase "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/firebaseInit.js"
click node_analytics "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/analytics.js"
click node_storage "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/storage.js"
click node_ai "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/ai.js"
click node_drive "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/googleDrive.js"
click node_markdown "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/markdown.js"
click node_migrator "https://github.com/gonzaloarenasf/bap_framework/blob/main/src/pages/migrator/index.js"
click node_coredocs "https://github.com/gonzaloarenasf/bap_framework/tree/main/src/pages/core"
click node_otherpages "https://github.com/gonzaloarenasf/bap_framework/tree/main/src/pages"

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_entry,node_router,node_routeconfig,node_localization,node_dictionary,node_constants,node_utilities,node_browser toneBlue
class node_components,node_migrator,node_coredocs,node_otherpages,node_database toneAmber
class node_registration,node_componentset,node_dialog,node_notification toneMint
class node_authentication,node_firebase,node_analytics,node_storage,node_ai,node_drive,node_markdown toneRose
```

## Components

### Runtime Core

- [App Entry](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/index.js): `src/index.js`
- [Router](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/router.js): `src/_main/router.js`
- [Route Map](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/routerPaths.js): `src/_main/routerPaths.js`
- [Localization](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/i18n.js): `src/_main/i18n.js`
- [Spanish Dictionary](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/i18n/es-ES.js): `src/_main/i18n/es-ES.js`
- [Runtime Configuration](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/constants.js): `src/_main/constants.js`
- [Shared Utilities](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/util.js): `src/_main/util.js`

### Application Pages

- [Component Gallery](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/pages/components/index.js): `src/pages/components/index.js`
- [Project Migrator](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/pages/migrator/index.js): `src/pages/migrator/index.js`
- [Core Module Pages](https://github.com/gonzaloarenasf/bap_framework/tree/main/src/pages/core): `src/pages/core`
- [Framework Pages](https://github.com/gonzaloarenasf/bap_framework/tree/main/src/pages): `src/pages`

### Web Components

- [Component Registration](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_components/customComponentsRegistration.js): `src/_components/customComponentsRegistration.js`
- [Custom Elements](https://github.com/gonzaloarenasf/bap_framework/tree/main/src/_components): `src/_components`
- [Dialog Element](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_components/bap-dialog/bap-dialog.js): `src/_components/bap-dialog/bap-dialog.js`
- [Notification Element](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_components/bap-notification/bap-notification.js): `src/_components/bap-notification/bap-notification.js`

### Services and Integrations

- [Authentication](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/auth.js): `src/_main/auth.js`
- [Firebase Gateway](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/firebaseInit.js): `src/_main/firebaseInit.js`
- [Analytics](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/analytics.js): `src/_main/analytics.js`
- [Storage](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/storage.js): `src/_main/storage.js`
- [Gemini AI](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/ai.js): `src/_main/ai.js`
- [Google Drive](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/googleDrive.js): `src/_main/googleDrive.js`
- [Markdown Parser](https://github.com/gonzaloarenasf/bap_framework/blob/main/src/_main/markdown.js): `src/_main/markdown.js`

### Other components

- **Browser User**
- **Realtime Database**

## Connections

- Browser User → App Entry: opens app (evidence: `src/index.js`)
- App Entry → Router: starts session (evidence: `src/index.js`)
- App Entry → Route Map: uses routes (evidence: `src/index.js`)
- App Entry → Component Registration: registers elements (evidence: `src/index.js`)
- App Entry → Localization: applies translations (evidence: `src/index.js`)
- App Entry → Analytics: logs entry (evidence: `src/index.js`)
- Router → Route Map: uses routes (evidence: `src/_main/router.js`)
- Router → Authentication: checks access (evidence: `src/_main/router.js`)
- Router → Localization: gets messages (evidence: `src/_main/router.js`)
- Router → Shared Utilities: shows notices (evidence: `src/_main/router.js`)
- Localization → Spanish Dictionary: loads language (evidence: `src/_main/i18n.js`)
- Component Registration → Custom Elements: registers elements (evidence: `src/_components/customComponentsRegistration.js`)
- Component Registration → Shared Utilities: uses helpers (evidence: `src/_components/customComponentsRegistration.js`)
- Component Gallery → Router: starts session (evidence: `src/pages/components/index.js`)
- Component Gallery → Component Registration: registers elements (evidence: `src/pages/components/index.js`)
- Component Gallery → Dialog Element: creates demo (evidence: `src/pages/components/index.js`)
- Component Gallery → Notification Element: shows demo (evidence: `src/pages/components/index.js`)
- Component Gallery → Analytics: logs visit (evidence: `src/pages/components/index.js`)
- Shared Utilities → Notification Element: creates notice (evidence: `src/_main/util.js`)
- Dialog Element → Localization: sanitizes content (evidence: `src/_components/bap-dialog/bap-dialog.js`)
- Authentication → Firebase Gateway: uses services (evidence: `src/_main/auth.js`)
- Authentication → Storage: uses persistence (evidence: `src/_main/auth.js`)
- Analytics → Firebase Gateway: logs events (evidence: `src/_main/analytics.js`)
- Storage → Realtime Database: reads and writes (evidence: `src/_main/storage.js`)
- Firebase Gateway → Realtime Database: initializes service
- Gemini AI → Browser User: calls Gemini API
- Google Drive → Browser User: calls Drive API
- Project Migrator → Markdown Parser: uses parser (evidence: `src/pages/migrator/index.js`)
- Project Migrator → Localization: uses translations (evidence: `src/pages/migrator/index.js`)
- Project Migrator → Analytics: uses telemetry (evidence: `src/pages/migrator/index.js`)
- Core Module Pages → Gemini AI: documents capability (evidence: `src/pages/core/ai/index.js`)
- Core Module Pages → Google Drive: documents capability
- Core Module Pages → Storage: documents capability
- Core Module Pages → Authentication: documents capability
- Framework Pages → Router: uses navigation (evidence: `src/pages/components/index.js`)
