# shireeshavelugoti-web/ai-powered-sales-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/shireeshavelugoti-web/ai-powered-sales-intelligence
- Repository: https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence

## Overview

SalesGenie AI is a lead-intelligence and sales-assistance application. Users authenticate, work with leads and company analysis, generate outreach, score conversion potential, and review conversation intelligence including summaries, action items, and CRM sync. The frontend’s sampled workflow centers on the protected Conversations page; backend routing and several domain stages are supported by the source index, while their detailed implementations were not sampled. Frontend-to-backend links are dashed because the excerpts do not show the HTTP endpoint-to-router wiring.

Main entry points: [`app/models.py`](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/models.py) (Sales data models), [`app/main.py`](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/main.py) (FastAPI application), [`app/database.py`](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/database.py) (Database sessions), [`app/routers/auth.py`](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/auth.py) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_browser["Web bootstrap<br/>[main.tsx]"]
  node_app["App routes<br/>[App.tsx]"]
  node_authui["Auth context<br/>[AuthContext.tsx]"]
  node_apiclient["API client<br/>[client.ts]"]
  node_conversationui["Conversation workspace"]
  node_conversationapi["Conversation API<br/>[conversations.ts]"]
  node_leadsapi["Leads API<br/>[leads.ts]"]
end

subgraph group_backend["API workflows"]
  node_backendapp["FastAPI application<br/>[main.py]"]
  node_authroutes["Authentication routes<br/>[auth.py]"]
  node_leadroutes["Lead routes<br/>[leads.py]"]
  node_analysisroutes["Analysis routes<br/>[analysis.py]"]
  node_outreachroutes["Outreach routes<br/>[outreach.py]"]
  node_scoringroutes["Scoring routes<br/>[scoring.py]"]
end

subgraph group_domain["Sales intelligence"]
  node_ai["Company analysis AI<br/>[ai_service.py]"]
  node_outreachai["Outreach generation<br/>[ai_service.py]"]
  node_scoring["Lead scoring<br/>[scoring_service.py]"]
  node_modelartifact["Conversion model"]
end

subgraph group_persistence["Data and identity"]
  node_authdep["User authentication<br/>[auth.py]"]
  node_security["Token security<br/>[security.py]"]
  node_database[("Database sessions<br/>[database.py]")]
  node_models["Sales data models<br/>[models.py]"]
end

node_user(("Sales user"))
node_crm(("CRM platform"))

node_user -->|"uses"| node_app
node_browser -->|"renders"| node_app
node_browser -->|"provides auth"| node_authui
node_app -->|"checks session"| node_authui
node_app -->|"routes to"| node_conversationui
node_authui -->|"requests auth"| node_apiclient
node_conversationui -->|"requests conversations"| node_conversationapi
node_conversationui -->|"loads leads"| node_leadsapi
node_conversationapi -->|"sends requests"| node_apiclient
node_leadsapi -->|"sends requests"| node_apiclient
node_apiclient -.->|"calls API"| node_backendapp
node_backendapp -->|"registers routes"| node_authroutes
node_backendapp -->|"registers routes"| node_leadroutes
node_backendapp -->|"registers routes"| node_analysisroutes
node_backendapp -->|"registers routes"| node_outreachroutes
node_backendapp -->|"registers routes"| node_scoringroutes
node_authroutes -->|"checks identity"| node_authdep
node_authroutes -->|"issues tokens"| node_security
node_authdep -->|"validates token"| node_security
node_authdep -->|"gets session"| node_database
node_authdep -->|"loads user"| node_models
node_authroutes -->|"gets session"| node_database
node_authroutes -->|"creates user"| node_models
node_leadroutes -->|"uses session"| node_database
node_leadroutes -->|"reads and writes"| node_models
node_analysisroutes -->|"uses session"| node_database
node_analysisroutes -->|"reads and writes"| node_models
node_analysisroutes -->|"requests analysis"| node_ai
node_outreachroutes -->|"uses session"| node_database
node_outreachroutes -->|"reads and writes"| node_models
node_outreachroutes -->|"generates outreach"| node_outreachai
node_scoringroutes -->|"uses session"| node_database
node_scoringroutes -->|"reads and writes"| node_models
node_scoringroutes -->|"calculates score"| node_scoring
node_models -->|"uses base"| node_database
node_scoring -->|"loads model"| node_modelartifact
node_conversationui -.->|"syncs changes"| node_crm

click node_browser "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/main.tsx"
click node_app "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/auth/AuthContext.tsx"
click node_apiclient "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/api/client.ts"
click node_conversationui "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/pages/ConversationsPage.tsx"
click node_conversationapi "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/api/conversations.ts"
click node_leadsapi "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/api/leads.ts"
click node_backendapp "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/main.py"
click node_authroutes "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/auth.py"
click node_leadroutes "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/leads.py"
click node_analysisroutes "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/analysis.py"
click node_outreachroutes "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/outreach.py"
click node_scoringroutes "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/scoring.py"
click node_authdep "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/auth.py"
click node_security "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/security.py"
click node_database "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/database.py"
click node_models "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/models.py"
click node_ai "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/ai_service.py"
click node_outreachai "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/services/ai_service.py"
click node_scoring "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/services/scoring_service.py"
click node_modelartifact "https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/ml/conversion_model.joblib"

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_browser,node_app,node_authui,node_apiclient,node_conversationui,node_conversationapi,node_leadsapi,node_user toneBlue
class node_backendapp,node_authroutes,node_leadroutes,node_analysisroutes,node_outreachroutes,node_scoringroutes toneAmber
class node_ai,node_outreachai,node_scoring,node_modelartifact toneMint
class node_authdep,node_security,node_database,node_models toneRose
class node_crm toneIndigo
```

## Components

### Web application

- [Web bootstrap](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [App routes](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth context](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/auth/AuthContext.tsx): `frontend/src/auth/AuthContext.tsx`
- [API client](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Conversation workspace](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/pages/ConversationsPage.tsx): `frontend/src/pages/ConversationsPage.tsx`
- [Conversation API](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/api/conversations.ts): `frontend/src/api/conversations.ts`
- [Leads API](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/frontend/src/api/leads.ts): `frontend/src/api/leads.ts`

### API workflows

- [FastAPI application](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/main.py): `app/main.py`
- [Authentication routes](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/auth.py): `app/routers/auth.py`
- [Lead routes](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/leads.py): `app/routers/leads.py`
- [Analysis routes](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/analysis.py): `app/routers/analysis.py`
- [Outreach routes](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/outreach.py): `app/routers/outreach.py`
- [Scoring routes](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/routers/scoring.py): `app/routers/scoring.py`

### Sales intelligence

- [Company analysis AI](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/ai_service.py): `app/ai_service.py`
- [Outreach generation](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/services/ai_service.py): `app/services/ai_service.py`
- [Lead scoring](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/services/scoring_service.py): `app/services/scoring_service.py`
- [Conversion model](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/ml/conversion_model.joblib): `app/ml/conversion_model.joblib`

### Data and identity

- [User authentication](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/auth.py): `app/auth.py`
- [Token security](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/security.py): `app/security.py`
- [Database sessions](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/database.py): `app/database.py`
- [Sales data models](https://github.com/shireeshavelugoti-web/ai-powered-sales-intelligence/blob/main/app/models.py): `app/models.py`

### Other components

- **Sales user**
- **CRM platform**

## Connections

- Sales user → App routes: uses (evidence: `frontend/src/App.tsx`)
- Web bootstrap → App routes: renders (evidence: `frontend/src/main.tsx`)
- Web bootstrap → Auth context: provides auth (evidence: `frontend/src/main.tsx`)
- App routes → Auth context: checks session (evidence: `frontend/src/App.tsx`)
- App routes → Conversation workspace: routes to (evidence: `frontend/src/App.tsx`)
- Auth context → API client: requests auth (evidence: `frontend/src/auth/AuthContext.tsx`)
- Conversation workspace → Conversation API: requests conversations (evidence: `frontend/src/pages/ConversationsPage.tsx`)
- Conversation workspace → Leads API: loads leads (evidence: `frontend/src/pages/ConversationsPage.tsx`)
- Conversation API → API client: sends requests (evidence: `frontend/src/api/conversations.ts`)
- Leads API → API client: sends requests (evidence: `frontend/src/api/leads.ts`)
- API client → FastAPI application: calls API
- FastAPI application → Authentication routes: registers routes (evidence: `app/main.py`)
- FastAPI application → Lead routes: registers routes (evidence: `app/main.py`)
- FastAPI application → Analysis routes: registers routes (evidence: `app/main.py`)
- FastAPI application → Outreach routes: registers routes (evidence: `app/main.py`)
- FastAPI application → Scoring routes: registers routes (evidence: `app/main.py`)
- Authentication routes → User authentication: checks identity (evidence: `app/routers/auth.py`)
- Authentication routes → Token security: issues tokens (evidence: `app/routers/auth.py`)
- User authentication → Token security: validates token (evidence: `app/auth.py`)
- User authentication → Database sessions: gets session (evidence: `app/auth.py`)
- User authentication → Sales data models: loads user (evidence: `app/auth.py`)
- Authentication routes → Database sessions: gets session (evidence: `app/routers/auth.py`)
- Authentication routes → Sales data models: creates user (evidence: `app/routers/auth.py`)
- Lead routes → Database sessions: uses session (evidence: `app/routers/leads.py`)
- Lead routes → Sales data models: reads and writes (evidence: `app/routers/leads.py`)
- Analysis routes → Database sessions: uses session (evidence: `app/routers/analysis.py`)
- Analysis routes → Sales data models: reads and writes (evidence: `app/routers/analysis.py`)
- Analysis routes → Company analysis AI: requests analysis (evidence: `app/routers/analysis.py`)
- Outreach routes → Database sessions: uses session (evidence: `app/routers/outreach.py`)
- Outreach routes → Sales data models: reads and writes (evidence: `app/routers/outreach.py`)
- Outreach routes → Outreach generation: generates outreach (evidence: `app/routers/outreach.py`)
- Scoring routes → Database sessions: uses session (evidence: `app/routers/scoring.py`)
- Scoring routes → Sales data models: reads and writes (evidence: `app/routers/scoring.py`)
- Scoring routes → Lead scoring: calculates score (evidence: `app/routers/scoring.py`)
- Sales data models → Database sessions: uses base (evidence: `app/models.py`)
- Lead scoring → Conversion model: loads model (evidence: `app/services/scoring_service.py`)
- Conversation workspace → CRM platform: syncs changes
