Skip to content

kaushal1717/Sales-Agent-Client

Repository files navigation

Sales Agent Frontend

A modern React + TypeScript frontend for the Agentic Sales System, built with Vite, Tailwind CSS, and shadcn/ui components.

πŸš€ Features

  • Dashboard - Monitor agent status and system health
  • Lead Search - Search for business leads by location and type
  • SDR Workflow - Execute complete sales development workflows
  • Email Management - Send professional outreach emails
  • Agent Status - View real-time status of all AI agents

πŸ› οΈ Tech Stack

  • React 18 with TypeScript
  • Vite for fast development and building
  • Tailwind CSS for styling
  • shadcn/ui components
  • React Router for navigation
  • Axios for API calls
  • Lucide React for icons

πŸ“‹ Prerequisites

  • Node.js 20.19.0+ or 22.12.0+
  • npm or yarn
  • Backend API running on http://localhost:8000

πŸ”§ Installation

  1. Install dependencies:
npm install
  1. Create .env file from example:
cp .env.example .env
  1. Update .env with your backend API URL (default: http://localhost:8000)

πŸƒ Running the App

Development Mode

npm run dev

The app will be available at http://localhost:5173

Build for Production

npm run build

Preview Production Build

npm run preview

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ ui/             # Reusable UI components (Button, Card, etc.)
β”‚   β”œβ”€β”€ layout/         # Layout components (Navbar, Layout)
β”‚   └── features/       # Feature-specific components
β”œβ”€β”€ pages/              # Page components
β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”œβ”€β”€ LeadSearch.tsx
β”‚   β”œβ”€β”€ SDRWorkflow.tsx
β”‚   β”œβ”€β”€ EmailManagement.tsx
β”‚   └── AgentStatus.tsx
β”œβ”€β”€ services/           # API service layer
β”‚   └── api.ts
β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── index.ts
β”œβ”€β”€ hooks/              # Custom React hooks
β”œβ”€β”€ utils/              # Utility functions
β”œβ”€β”€ lib/                # Library configurations
β”‚   └── utils.ts
β”œβ”€β”€ App.tsx             # Main app component with routing
└── main.tsx            # App entry point

🎨 Pages

Dashboard (/)

  • Overview of all agents and their status
  • System configuration status
  • Quick action links

Lead Search (/leads)

  • Search for business leads by location
  • Filter by business type, radius, and limit
  • View detailed lead information with contact details

SDR Workflow (/workflow)

  • Execute complete sales workflow
  • Steps: Research β†’ Proposal β†’ Call β†’ Email
  • View results for each workflow stage

Email Management (/email)

  • Send emails to leads
  • Email templates for quick start
  • Support for HTML emails

Agent Status (/status)

  • Monitor all AI agents
  • View environment configuration
  • System information and health checks

πŸ”Œ API Integration

The frontend connects to the backend API through the apiService in src/services/api.ts.

Available endpoints:

  • GET /health - Health check
  • POST /api/v1/leads/search - Search leads
  • POST /api/v1/email/send - Send email
  • POST /api/v1/workflow/execute - Execute SDR workflow
  • GET /api/v1/agents/status - Get agent status

🎨 Customization

Tailwind Configuration

Customize colors, spacing, and other design tokens in tailwind.config.js.

API URL

Set your backend API URL in .env:

VITE_API_URL=http://localhost:8000

🧩 Components

The project uses custom UI components inspired by shadcn/ui:

  • Button - Various button styles and sizes
  • Card - Card container with header, content, footer
  • Input - Form input fields
  • Badge - Status badges
  • Layout - Main layout wrapper
  • Navbar - Navigation bar

πŸ“ Environment Variables

  • VITE_API_URL - Backend API base URL (default: http://localhost:8000)

🚦 Development

Adding a New Page

  1. Create page component in src/pages/YourPage.tsx
  2. Add route in src/App.tsx
  3. Add navigation link in src/components/layout/Navbar.tsx

Adding API Endpoints

  1. Add types in src/types/index.ts
  2. Add service method in src/services/api.ts
  3. Use in your page component

πŸ› Troubleshooting

API Connection Issues

  • Ensure backend server is running on http://localhost:8000
  • Check CORS settings in backend
  • Verify .env file has correct VITE_API_URL

Build Issues

  • Clear node_modules and reinstall: rm -rf node_modules && npm install
  • Update Node.js to version 20.19.0 or higher

πŸ“„ License

MIT License

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •