Skip to content

umutbarancicek/ai-agent-fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Agent - Full Stack Application

Python FastAPI React TypeScript Docker License

πŸ‡ΉπŸ‡· TΓΌrkΓ§e: DetaylΔ± proje aΓ§Δ±klamasΔ± iΓ§in backend/PROJE_OZETI.md dosyasΔ±na bakΔ±nΔ±z.

Full-stack AI-powered platform for real-time audio processing, video conferencing, CRM integrations, and intelligent conversation analysis.

πŸš€ Features

Backend (FastAPI + Python)

  • Real-time Audio Processing: WebSocket-based streaming with OpenAI Realtime API
  • LiveKit Integration: Self-hosted WebRTC video conferencing
  • Speaker Diarization: Automatic speaker identification and segmentation
  • CRM Integrations: HubSpot, Salesforce, Pipedrive connectors
  • Intelligent Caching: Redis-based query optimization
  • Vector Search: PostgreSQL + pgvector for semantic search
  • MCP Service: Natural language to SQL conversion
  • Monitoring: Prometheus + Grafana dashboards

Frontend (React + TypeScript)

  • Modern UI: Metronic UI theme with Bootstrap
  • LiveKit Components: Real-time video/audio conferencing
  • Meeting Management: Create, join, and manage meetings
  • Real-time Transcripts: Live transcription display
  • CRM Dashboard: Integrated CRM data visualization
  • Responsive Design: Mobile-friendly interface

πŸ“ Project Structure

ai-agent-fullstack/
β”œβ”€β”€ backend/                 # FastAPI backend
β”‚   β”œβ”€β”€ api/                # REST API endpoints
β”‚   β”œβ”€β”€ services/           # Business logic
β”‚   β”œβ”€β”€ models/             # SQLAlchemy models
β”‚   β”œβ”€β”€ schemas/            # Pydantic schemas
β”‚   β”œβ”€β”€ crm/                # CRM integrations
β”‚   β”œβ”€β”€ docker-compose.yml  # Backend services
β”‚   β”œβ”€β”€ requirements.txt    # Python dependencies
β”‚   └── README.md           # Backend documentation
β”‚
β”œβ”€β”€ frontend/               # React frontend
β”‚   β”œβ”€β”€ src/               # Source code
β”‚   β”‚   β”œβ”€β”€ app/          # Main app components
β”‚   β”‚   β”œβ”€β”€ _metronic/    # Metronic UI theme
β”‚   β”‚   └── pages/        # Page components
β”‚   β”œβ”€β”€ public/            # Static files
β”‚   β”œβ”€β”€ package.json       # Node dependencies
β”‚   └── README.md          # Frontend documentation
β”‚
β”œβ”€β”€ docs/                   # Shared documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md    # System architecture
β”‚   β”œβ”€β”€ DEPLOYMENT.md      # Deployment guide
β”‚   └── DEVELOPMENT.md     # Development guide
β”‚
β”œβ”€β”€ docker-compose.yml      # Full-stack orchestration
β”œβ”€β”€ .gitignore             # Git ignore rules
└── README.md              # This file

πŸ› οΈ Quick Start

Prerequisites

  • Docker & Docker Compose (recommended)
  • Python 3.11+ (for local backend development)
  • Node.js 18+ (for local frontend development)
  • Git

Option 1: Docker Compose (Full Stack)

# Clone repository
git clone https://github.com/YOUR_USERNAME/ai-agent-fullstack.git
cd ai-agent-fullstack

# Setup environment variables
cp backend/.env.example backend/.env.docker
# Edit backend/.env.docker and backend/.env.secrets with your keys

# Start all services
docker-compose up -d

# Run migrations
docker exec backend alembic upgrade head

# Access services
# Frontend: http://localhost:3000
# Backend API: http://localhost:8001
# API Docs: http://localhost:8001/docs
# Grafana: http://localhost:3000

Option 2: Local Development

Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Setup environment
cp .env.example .env.local
# Edit .env.local with your configuration

# Start services (PostgreSQL, Redis, etc.)
docker-compose up -d postgresql redis minio nats livekit

# Run migrations
alembic upgrade head

# Start backend
uvicorn main:app --reload --port 8001

Frontend Setup

cd frontend

# Install dependencies
npm install

# Setup environment
cp .env.example .env.local
# Edit .env.local with backend URL

# Start development server
npm run dev

πŸ”§ Configuration

Backend Environment Variables

Create backend/.env.docker and backend/.env.secrets:

# Required
OPENAI_API_KEY=sk-your-openai-key
DATABASE_URI=postgresql+psycopg://postgres:password@postgresql:5432/ai_agent
REDIS_HOST=redis
REDIS_PORT=6379

# LiveKit
LIVEKIT_API_KEY=your-livekit-key
LIVEKIT_API_SECRET=your-livekit-secret
LIVEKIT_URL=ws://livekit:7880

# Optional CRM
HUBSPOT_CLIENT_ID=
HUBSPOT_CLIENT_SECRET=

Frontend Environment Variables

Create frontend/.env.local:

VITE_API_URL=http://localhost:8001
VITE_LIVEKIT_URL=ws://localhost:7880

πŸ“š Documentation

General

Backend

Frontend

πŸ§ͺ Testing

Backend Tests

cd backend
pytest
pytest --cov=services --cov-report=html

Frontend Tests

cd frontend
npm run test
npm run lint

🚒 Deployment

Docker Production

# Build images
docker-compose build

# Start production stack
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

# Check status
docker-compose ps

See docs/DEPLOYMENT.md for detailed production deployment instructions.

πŸ“Š Services & Ports

Service Port Description
Frontend 3000 React development server
Backend API 8001 FastAPI backend
PostgreSQL 5432 Database
Redis 6379 Cache & pub/sub
LiveKit 7880-7882 WebRTC server
MinIO 9000, 9001 Object storage
Grafana 3000 Monitoring dashboards
Prometheus 9090 Metrics collection

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Backend: FastAPI, PostgreSQL, Redis, LiveKit, OpenAI
  • Frontend: React, Vite, Metronic UI, Bootstrap
  • Infrastructure: Docker, Prometheus, Grafana

Made with ❀️ by Umut Baran Γ‡iΓ§ek

About

Full-stack AI Orchestration Platform for managing autonomous agents with LangChain and TypeScript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors