# andrezzac/otica-renew-chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/andrezzac/otica-renew-chatbot
- Repository: https://github.com/andrezzac/otica-renew-chatbot

## Overview

Ótica Renew is a Django institutional site with a browser-based, menu-driven chatbot for visitor pre-attendance. Visitors browse the home, about, products and contact pages, or explore chatbot categories and nested answers served from Django’s SQLite-backed models; visitors seeking a quote are directed to WhatsApp, not an online checkout. The documented chatbot topics include lens types, treatments, materials, field of vision, eye exams and company information. Those content areas are grouped rather than inferred as separate runtime modules; some are documented in the README but not individually verified in sampled source.

Main entry points: [`static/js/chatbot.js`](https://github.com/andrezzac/otica-renew-chatbot/blob/main/static/js/chatbot.js) (Chat interface), [`chatbot/urls.py`](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/urls.py) (Site and API routes), [`templates`](https://github.com/andrezzac/otica-renew-chatbot/tree/main/templates) (Institutional pages), [`chatbot/views.py`](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/views.py) (Chat API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Institutional site"]
  node_project_routes["Project routes<br/>[urls.py]"]
  node_app_routes["Site and API routes<br/>[urls.py]"]
  node_page_views["Page views<br/>[views.py]"]
  node_site_pages["Institutional pages"]
  node_site_styles["Site styling<br/>[style.css]"]
end

subgraph group_chat["Chat experience"]
  node_chat_ui["Chat interface<br/>[chatbot.js]"]
  node_chat_api["Chat API<br/>[views.py]"]
end

subgraph group_data["Chat content and storage"]
  node_content_setup["Content registration<br/>[cadastrar_dados.py]"]
  node_chat_models[("Chat content store<br/>[models.py]")]
end

node_visitor(("Visitor"))
node_whatsapp["WhatsApp"]

node_visitor -->|"requests pages"| node_project_routes
node_project_routes -->|"includes routes"| node_app_routes
node_app_routes -->|"dispatches pages"| node_page_views
node_page_views -->|"renders"| node_site_pages
node_visitor -->|"uses chat"| node_chat_ui
node_chat_ui -->|"fetches categories"| node_chat_api
node_app_routes -->|"dispatches API"| node_chat_api
node_chat_api -->|"queries"| node_chat_models
node_content_setup -->|"creates or updates"| node_chat_models
node_chat_ui -->|"opens contact"| node_whatsapp
node_site_pages -.->|"uses styling"| node_site_styles
node_site_pages -.->|"integrates chatbot"| node_chat_ui

click node_project_routes "https://github.com/andrezzac/otica-renew-chatbot/blob/main/config/urls.py"
click node_app_routes "https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/urls.py"
click node_page_views "https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/views.py"
click node_site_pages "https://github.com/andrezzac/otica-renew-chatbot/tree/main/templates"
click node_site_styles "https://github.com/andrezzac/otica-renew-chatbot/blob/main/static/css/style.css"
click node_chat_ui "https://github.com/andrezzac/otica-renew-chatbot/blob/main/static/js/chatbot.js"
click node_chat_api "https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/views.py"
click node_content_setup "https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/management/commands/cadastrar_dados.py"
click node_chat_models "https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/models.py"

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_project_routes,node_app_routes,node_page_views,node_site_pages,node_site_styles toneBlue
class node_chat_ui,node_chat_api toneAmber
class node_content_setup,node_chat_models toneMint
class node_visitor,node_whatsapp toneIndigo
```

## Components

### Institutional site

- [Project routes](https://github.com/andrezzac/otica-renew-chatbot/blob/main/config/urls.py): `config/urls.py`
- [Site and API routes](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/urls.py): `chatbot/urls.py`
- [Page views](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/views.py): `chatbot/views.py`
- [Institutional pages](https://github.com/andrezzac/otica-renew-chatbot/tree/main/templates): `templates`
- [Site styling](https://github.com/andrezzac/otica-renew-chatbot/blob/main/static/css/style.css): `static/css/style.css`

### Chat experience

- [Chat interface](https://github.com/andrezzac/otica-renew-chatbot/blob/main/static/js/chatbot.js): `static/js/chatbot.js`
- [Chat API](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/views.py): `chatbot/views.py`

### Chat content and storage

- [Content registration](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/management/commands/cadastrar_dados.py): `chatbot/management/commands/cadastrar_dados.py`
- [Chat content store](https://github.com/andrezzac/otica-renew-chatbot/blob/main/chatbot/models.py): `chatbot/models.py`

### Other components

- **Visitor**
- **WhatsApp**

## Connections

- Visitor → Project routes: requests pages (evidence: `README.md`)
- Project routes → Site and API routes: includes routes (evidence: `config/urls.py`)
- Site and API routes → Page views: dispatches pages (evidence: `chatbot/urls.py`)
- Page views → Institutional pages: renders (evidence: `chatbot/views.py`)
- Visitor → Chat interface: uses chat (evidence: `README.md`)
- Chat interface → Chat API: fetches categories (evidence: `static/js/chatbot.js`)
- Site and API routes → Chat API: dispatches API (evidence: `chatbot/urls.py`)
- Chat API → Chat content store: queries (evidence: `chatbot/views.py`)
- Content registration → Chat content store: creates or updates (evidence: `chatbot/management/commands/cadastrar_dados.py`)
- Chat interface → WhatsApp: opens contact (evidence: `static/js/chatbot.js`)
- Institutional pages → Site styling: uses styling (evidence: `README.md`)
- Institutional pages → Chat interface: integrates chatbot (evidence: `README.md`)
