# josevic504-bot/negocio architecture

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

- Interactive diagram: https://gitdiagram.com/josevic504-bot/negocio
- Repository: https://github.com/josevic504-bot/negocio

## Overview

This repository combines a business-management web app, a public store directory generator, and lightweight shared web capabilities. The main user-facing workflow is the installable Gestión de Negocio VM app; the sampled files show its offline shell and notification routing, but not its core business screens or server API implementation. Catrachas separately generates public, searchable store pages from directory and store data. The graph retains documented product areas visible in the app assets and tree while omitting unsupported internal call relationships.

Main entry points: [`catrachas/generar.mjs`](https://github.com/josevic504-bot/negocio/blob/main/catrachas/generar.mjs) (Directory generator), [`index.html`](https://github.com/josevic504-bot/negocio/blob/main/index.html) (Management app), [`sw.js`](https://github.com/josevic504-bot/negocio/blob/main/sw.js) (Offline shell), [`catrachas`](https://github.com/josevic504-bot/negocio/tree/main/catrachas) (Store pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Business app"]
  node_app_ui["Management app<br/>[index.html]"]
  node_business_modules["Business workflows"]
  node_panel["Admin panel<br/>[index.html]"]
  node_offline["Offline shell<br/>[sw.js]"]
end

subgraph group_public["Store directory"]
  node_directory_generator["Directory generator<br/>[generar.mjs]"]
  node_directory_pages["Store pages"]
  node_directory_data[("Directory data")]
end

subgraph group_platform["Shared web services"]
  node_visitor_counter["Visit counter<br/>[visitas.js]"]
end

node_business_user(("Business user"))
node_push_service["Push service"]
node_store_owner(("Store owner"))
node_store_api["Store API"]
node_analytics_api["Analytics API"]
node_web_visitor(("Web visitor"))

node_business_user -->|"uses"| node_app_ui
node_app_ui -.->|"registers worker"| node_offline
node_offline -->|"receives push"| node_push_service
node_offline -->|"opens panel"| node_panel
node_app_ui -.->|"provides workflows"| node_business_modules
node_store_owner -.->|"lists store"| node_directory_generator
node_directory_generator -->|"reads directory"| node_directory_data
node_directory_generator -->|"fetches store details"| node_store_api
node_directory_generator -->|"generates pages"| node_directory_pages
node_web_visitor -.->|"browses"| node_directory_pages
node_directory_pages -->|"loads script"| node_visitor_counter
node_visitor_counter -->|"sends visit"| node_analytics_api

click node_app_ui "https://github.com/josevic504-bot/negocio/blob/main/index.html"
click node_business_modules "https://github.com/josevic504-bot/negocio/tree/main/app"
click node_panel "https://github.com/josevic504-bot/negocio/blob/main/panel/index.html"
click node_offline "https://github.com/josevic504-bot/negocio/blob/main/sw.js"
click node_directory_generator "https://github.com/josevic504-bot/negocio/blob/main/catrachas/generar.mjs"
click node_directory_pages "https://github.com/josevic504-bot/negocio/tree/main/catrachas"
click node_directory_data "https://github.com/josevic504-bot/negocio/blob/main/catrachas/sql/directorio_tiendas.sql"
click node_visitor_counter "https://github.com/josevic504-bot/negocio/blob/main/visitas.js"

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_app_ui,node_business_modules,node_panel,node_offline,node_business_user toneBlue
class node_directory_generator,node_directory_pages,node_directory_data toneAmber
class node_visitor_counter,node_store_api,node_analytics_api toneMint
class node_push_service,node_store_owner,node_web_visitor toneIndigo
```

## Components

### Business app

- [Management app](https://github.com/josevic504-bot/negocio/blob/main/index.html): `index.html`
- [Business workflows](https://github.com/josevic504-bot/negocio/tree/main/app): `app`
- [Admin panel](https://github.com/josevic504-bot/negocio/blob/main/panel/index.html): `panel/index.html`
- [Offline shell](https://github.com/josevic504-bot/negocio/blob/main/sw.js): `sw.js`

### Store directory

- [Directory generator](https://github.com/josevic504-bot/negocio/blob/main/catrachas/generar.mjs): `catrachas/generar.mjs`
- [Store pages](https://github.com/josevic504-bot/negocio/tree/main/catrachas): `catrachas`
- [Directory data](https://github.com/josevic504-bot/negocio/blob/main/catrachas/sql/directorio_tiendas.sql): `catrachas/sql/directorio_tiendas.sql`

### Shared web services

- [Visit counter](https://github.com/josevic504-bot/negocio/blob/main/visitas.js): `visitas.js`

### Other components

- **Business user**
- **Push service**
- **Store owner**
- **Store API**
- **Analytics API**
- **Web visitor**

## Connections

- Business user → Management app: uses
- Management app → Offline shell: registers worker
- Offline shell → Push service: receives push (evidence: `sw.js`)
- Offline shell → Admin panel: opens panel (evidence: `sw.js`)
- Management app → Business workflows: provides workflows
- Store owner → Directory generator: lists store
- Directory generator → Directory data: reads directory (evidence: `catrachas/generar.mjs`)
- Directory generator → Store API: fetches store details (evidence: `catrachas/generar.mjs`)
- Directory generator → Store pages: generates pages (evidence: `catrachas/generar.mjs`)
- Web visitor → Store pages: browses
- Store pages → Visit counter: loads script (evidence: `catrachas/generar.mjs`)
- Visit counter → Analytics API: sends visit (evidence: `visitas.js`)
