# gowshikaselvi07-byte/crochet-business-chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/gowshikaselvi07-byte/crochet-business-chatbot
- Repository: https://github.com/gowshikaselvi07-byte/crochet-business-chatbot

## Overview

This is a small Flask chatbot for a crochet business. A customer can open the chat page or submit a message to the chat endpoint; the endpoint applies business-specific instructions, includes recent conversation history, and requests a reply from Groq. The README describes the same customer-facing capabilities, though it calls the interface Streamlit; the sampled runtime is Flask. The HTML template and serverless adapter are present, but template behavior beyond rendering and deployment wiring beyond the adapter import are not established here.

Main entry points: [`app.py`](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py) (Chat endpoint), [`api/index.py`](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/api/index.py) (Serverless adapter), [`templates/index.html`](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/templates/index.html) (Chat page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_chat_page["Chat page<br/>[index.html]"]
  node_page_route["Page route<br/>[app.py]"]
  node_serverless_adapter["Serverless adapter<br/>[index.py]"]
end

subgraph group_assistant["Assistant runtime"]
  node_chat_endpoint["Chat endpoint<br/>[app.py]"]
  node_business_policy["Business policy<br/>[app.py]"]
  node_conversation_history["History handling<br/>[app.py]"]
end

subgraph group_integration["API integration"]
  node_groq_client["Groq client<br/>[app.py]"]
  node_groq_service{{"Groq API"}}
end

node_customer(("Customer"))

node_customer -->|"opens page"| node_page_route
node_page_route -->|"renders"| node_chat_page
node_customer -->|"posts message"| node_chat_endpoint
node_chat_endpoint -->|"sets instructions"| node_business_policy
node_chat_endpoint -->|"filters history"| node_conversation_history
node_chat_endpoint -->|"creates and calls"| node_groq_client
node_groq_client -->|"requests completion"| node_groq_service
node_serverless_adapter -->|"imports app"| node_page_route

click node_chat_page "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/templates/index.html"
click node_page_route "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py"
click node_chat_endpoint "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py"
click node_business_policy "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py"
click node_conversation_history "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py"
click node_groq_client "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py"
click node_serverless_adapter "https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/api/index.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_chat_page,node_page_route,node_serverless_adapter toneBlue
class node_chat_endpoint,node_business_policy,node_conversation_history toneAmber
class node_groq_client,node_groq_service toneMint
class node_customer toneIndigo
```

## Components

### Web interface

- [Chat page](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/templates/index.html): `templates/index.html`
- [Page route](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py): `app.py`
- [Serverless adapter](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/api/index.py): `api/index.py`

### Assistant runtime

- [Chat endpoint](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py): `app.py`
- [Business policy](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py): `app.py`
- [History handling](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py): `app.py`

### API integration

- [Groq client](https://github.com/gowshikaselvi07-byte/crochet-business-chatbot/blob/main/app.py): `app.py`
- **Groq API**

### Other components

- **Customer**

## Connections

- Customer → Page route: opens page (evidence: `app.py`)
- Page route → Chat page: renders (evidence: `app.py`)
- Customer → Chat endpoint: posts message (evidence: `app.py`)
- Chat endpoint → Business policy: sets instructions (evidence: `app.py`)
- Chat endpoint → History handling: filters history (evidence: `app.py`)
- Chat endpoint → Groq client: creates and calls (evidence: `app.py`)
- Groq client → Groq API: requests completion (evidence: `app.py`)
- Serverless adapter → Page route: imports app (evidence: `api/index.py`)
