# beingrahull/genovation-task-rahul- architecture

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

- Interactive diagram: https://gitdiagram.com/beingrahull/genovation-task-rahul-
- Repository: https://github.com/beingrahull/genovation-task-rahul-

## Overview

This FastAPI backend supports account access, customer ticket intake and listing, and an agent workflow that retrieves similar tickets and drafts a reply for human review. Ticket creation stores the ticket and indexes its description; selection loads a ticket, repairs missing vectors, searches for matches, and calls a hosted LLM. The graph follows documented routes and excerpted calls. The agent-feed capability is documented as disabled, so it is noted but not represented as active runtime flow.

Main entry points: [`app/main.py`](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/main.py) (FastAPI app), [`app/database.py`](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/database.py) (MongoDB collections), [`app/routers/submitTicket.py`](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/submitTicket.py) (Ticket intake), [`app/services/llmresponse.py`](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/services/llmresponse.py) (Similarity and drafting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API workflows"]
  node_app["FastAPI app<br/>[main.py]"]
  node_ticketselection["Ticket selection<br/>[Tickettoagent.py]"]
  node_models["Request schemas<br/>[user.py]"]
end

subgraph group_identity["Identity and access"]
  node_signup["Signup and signin<br/>[user_routes.py]"]
  node_logout["Logout<br/>[logout_route.py]"]
  node_security["Password and JWT<br/>[security.py]"]
end

subgraph group_ticketdata["Ticket data"]
  node_ticketintake["Ticket intake<br/>[submitTicket.py]"]
  node_ticketlisting["Ticket listing<br/>[submitTicket.py]"]
  node_mongo[("MongoDB collections<br/>[database.py]")]
end

subgraph group_intelligence["Semantic support"]
  node_vectorindex[("Chroma vector index")]
  node_indexing["Ticket embedding<br/>[embedding.py]"]
  node_retrievaldraft["Similarity and drafting<br/>[llmresponse.py]"]
  node_deepinfra["DeepInfra embeddings"]
  node_together["Together AI LLM"]
end

node_customer(("Customer"))
node_agent(("Support agent"))

node_customer -->|"uses API"| node_app
node_agent -->|"uses API"| node_app
node_app -->|"mounts"| node_signup
node_app -->|"mounts"| node_logout
node_app -->|"mounts"| node_ticketintake
node_app -->|"mounts"| node_ticketlisting
node_app -->|"mounts"| node_ticketselection
node_signup -->|"validates with"| node_models
node_signup -->|"reads and writes"| node_mongo
node_signup -->|"hashes and signs"| node_security
node_logout -->|"blacklists token"| node_mongo
node_ticketintake -->|"validates with"| node_models
node_ticketintake -->|"checks and stores"| node_mongo
node_ticketintake -->|"indexes ticket"| node_indexing
node_ticketintake -->|"verifies token"| node_security
node_ticketlisting -->|"reads tickets"| node_mongo
node_ticketselection -->|"requests draft"| node_retrievaldraft
node_ticketselection -.->|"imports tickets"| node_mongo
node_ticketselection -->|"creates ticket token"| node_security
node_indexing -->|"requests embeddings"| node_deepinfra
node_indexing -->|"upserts vectors"| node_vectorindex
node_retrievaldraft -->|"loads tickets"| node_mongo
node_retrievaldraft -->|"syncs and queries"| node_vectorindex
node_retrievaldraft -->|"embeds missing tickets"| node_deepinfra
node_retrievaldraft -->|"requests reply draft"| node_together

click node_app "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/main.py"
click node_signup "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/user_routes.py"
click node_logout "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/logout_route.py"
click node_security "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/utils/security.py"
click node_ticketintake "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/submitTicket.py"
click node_ticketlisting "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/submitTicket.py"
click node_ticketselection "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/Tickettoagent.py"
click node_models "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/schemas/user.py"
click node_mongo "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/database.py"
click node_indexing "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/services/embedding.py"
click node_retrievaldraft "https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/services/llmresponse.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_app,node_ticketselection,node_models toneBlue
class node_signup,node_logout,node_security toneAmber
class node_ticketintake,node_ticketlisting,node_mongo toneMint
class node_vectorindex,node_indexing,node_retrievaldraft,node_deepinfra,node_together toneRose
class node_customer,node_agent toneIndigo
```

## Components

### API workflows

- [FastAPI app](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/main.py): `app/main.py`
- [Ticket selection](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/Tickettoagent.py): `app/routers/Tickettoagent.py`
- [Request schemas](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/schemas/user.py): `app/schemas/user.py`

### Identity and access

- [Signup and signin](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/user_routes.py): `app/routers/user_routes.py`
- [Logout](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/logout_route.py): `app/routers/logout_route.py`
- [Password and JWT](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/utils/security.py): `app/utils/security.py`

### Ticket data

- [Ticket intake](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/submitTicket.py): `app/routers/submitTicket.py`
- [Ticket listing](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/routers/submitTicket.py): `app/routers/submitTicket.py`
- [MongoDB collections](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/database.py): `app/database.py`

### Semantic support

- **Chroma vector index**
- [Ticket embedding](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/services/embedding.py): `app/services/embedding.py`
- [Similarity and drafting](https://github.com/beingrahull/genovation-task-rahul-/blob/main/app/services/llmresponse.py): `app/services/llmresponse.py`
- **DeepInfra embeddings**
- **Together AI LLM**

### Other components

- **Customer**
- **Support agent**

## Connections

- Customer → FastAPI app: uses API (evidence: `README.md`)
- Support agent → FastAPI app: uses API (evidence: `README.md`)
- FastAPI app → Signup and signin: mounts (evidence: `app/main.py`)
- FastAPI app → Logout: mounts (evidence: `app/main.py`)
- FastAPI app → Ticket intake: mounts (evidence: `app/main.py`)
- FastAPI app → Ticket listing: mounts (evidence: `app/main.py`)
- FastAPI app → Ticket selection: mounts (evidence: `app/main.py`)
- Signup and signin → Request schemas: validates with (evidence: `app/routers/user_routes.py`)
- Signup and signin → MongoDB collections: reads and writes (evidence: `app/routers/user_routes.py`)
- Signup and signin → Password and JWT: hashes and signs (evidence: `app/routers/user_routes.py`)
- Logout → MongoDB collections: blacklists token (evidence: `app/routers/logout_route.py`)
- Ticket intake → Request schemas: validates with (evidence: `app/routers/submitTicket.py`)
- Ticket intake → MongoDB collections: checks and stores (evidence: `app/routers/submitTicket.py`)
- Ticket intake → Ticket embedding: indexes ticket (evidence: `app/routers/submitTicket.py`)
- Ticket intake → Password and JWT: verifies token (evidence: `app/routers/submitTicket.py`)
- Ticket listing → MongoDB collections: reads tickets (evidence: `app/routers/submitTicket.py`)
- Ticket selection → Similarity and drafting: requests draft (evidence: `app/routers/Tickettoagent.py`)
- Ticket selection → MongoDB collections: imports tickets (evidence: `app/routers/Tickettoagent.py`)
- Ticket selection → Password and JWT: creates ticket token (evidence: `app/routers/Tickettoagent.py`)
- Ticket embedding → DeepInfra embeddings: requests embeddings (evidence: `app/services/embedding.py`)
- Ticket embedding → Chroma vector index: upserts vectors (evidence: `app/services/embedding.py`)
- Similarity and drafting → MongoDB collections: loads tickets (evidence: `app/services/llmresponse.py`)
- Similarity and drafting → Chroma vector index: syncs and queries (evidence: `app/services/llmresponse.py`)
- Similarity and drafting → DeepInfra embeddings: embeds missing tickets (evidence: `app/services/llmresponse.py`)
- Similarity and drafting → Together AI LLM: requests reply draft (evidence: `app/services/llmresponse.py`)
