Skip to content

algsoch/service

Repository files navigation

πŸ€– Vicky AI Systems - Professional AI Business Website

Live Demo Backend API License

A modern, AI-powered business website featuring an intelligent chatbot, contact forms, and Discord integration. Built with FREE Gemini AI and deployed on Render.

✨ Features

πŸ€– AI Chatbot

  • FREE Gemini 2.0 Flash API - No paid subscriptions!
  • Real-time conversation with intelligent responses
  • Conversation history tracking
  • Pre-conversation contact form
  • Discord notification on lead qualification

πŸ’¬ Smart Interactions

  • Code syntax highlighting in chat
  • Markdown rendering (headers, lists, links, code blocks)
  • Typing indicators
  • Message animations
  • Mobile-responsive design

πŸ“§ Contact System

  • Multi-step contact form
  • Email validation
  • Automatic Discord notifications
  • Lead status tracking (interested, deal_confirmed, contact_requested)

🎨 Modern UI

  • Glassmorphism effects
  • Gradient animations
  • Floating chat bubble with pulsing glow
  • Smooth transitions
  • Dark/light theme support

πŸš€ Live Deployment

πŸ“ Project Structure

vicky-ai-systems/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ backend.py              # FastAPI server
β”‚   β”œβ”€β”€ requirements.txt        # Python dependencies
β”‚   β”œβ”€β”€ .env                    # Environment variables (not in git)
β”‚   └── render.yaml            # Render deployment config
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html             # Main page
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── styles.css         # All styling
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”œβ”€β”€ script.js          # Main logic + contact forms
β”‚   β”‚   β”œβ”€β”€ gemini-chatbot.js  # AI chatbot functionality
β”‚   β”‚   └── config.js          # Frontend configuration
β”‚   └── images/                # Assets
β”œβ”€β”€ tests/
β”‚   └── test_api.sh            # API testing script
β”œβ”€β”€ render.yaml                # Main Render config
β”œβ”€β”€ .gitignore
└── README.md

πŸ› οΈ Tech Stack

Backend

  • FastAPI - Modern Python web framework
  • Uvicorn - ASGI server
  • Gemini AI - FREE Google AI API
  • Discord Webhooks - Real-time notifications
  • Python 3.10+

Frontend

  • Vanilla JavaScript - No framework dependencies
  • HTML5 + CSS3 - Modern web standards
  • Markdown Parser - Custom implementation with syntax highlighting
  • Responsive Design - Mobile-first approach

Deployment

  • Render - Both frontend (static) and backend (web service)
  • Docker - Containerized backend
  • GitHub - Version control and CI/CD

πŸ“¦ Installation

Prerequisites

  • Python 3.10+
  • Git
  • Gemini API Key (free from Google AI Studio)
  • Discord Webhook URL (optional)

Local Development

  1. Clone the repository:
git clone https://github.com/algsoch/service.git
cd service
  1. Backend Setup:
cd backend

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

# Install dependencies
pip install -r requirements.txt

# Create .env file
cp .env.example .env
# Edit .env and add your API keys
  1. Environment Variables (.env):
GEMINI_API_KEY=your_gemini_api_key_here
DISCORD_WEBHOOK=your_discord_webhook_url_here
  1. Run Backend:
uvicorn backend:app --reload --port 8000
  1. Run Frontend:
cd ../frontend
python -m http.server 5500
  1. Open in browser:

πŸ§ͺ Testing

Run the automated test suite:

# Test all endpoints
bash tests/test_api.sh

# Test specific endpoint
curl https://service-y5ld.onrender.com/health
curl -X POST https://service-y5ld.onrender.com/api/chat-gemini \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello!","conversation_history":[]}'

🚒 Deployment

Deploy to Render

Backend (Web Service):

  1. Go to Render Dashboard
  2. New Web Service β†’ Connect GitHub repo: algsoch/service
  3. Configure:
    • Root Directory: backend
    • Build Command: pip install -r requirements.txt
    • Start Command: uvicorn backend:app --host 0.0.0.0 --port $PORT
  4. Add Environment Variables:
    • GEMINI_API_KEY
    • DISCORD_WEBHOOK
  5. Deploy!

Frontend (Static Site):

  1. New Static Site β†’ Connect same GitHub repo

  2. Configure:

    • Root Directory: frontend
    • Build Command: (leave empty)
    • Publish Directory: .
  3. Deploy!

  4. Update frontend/js/config.js with your backend URL and redeploy.

πŸ“‘ API Endpoints

Health Check

GET /health
Response: {"status":"healthy","timestamp":"2025-11-19T..."}

Chat with AI

POST /api/chat-gemini
Body: {
  "message": "Hello!",
  "conversation_history": []
}
Response: {
  "response": "AI response here",
  "conversation_id": "conv_123...",
  "timestamp": "2025-11-19T..."
}

Send to Discord

POST /api/send-to-discord
Body: {
  "conversation_history": [{"role": "user", "content": "..."}],
  "user_email": "user@example.com",
  "user_phone": "+1234567890",
  "deal_status": "interested"
}
Response: {
  "success": true,
  "message": "Perfect! βœ… I've sent your conversation..."
}

API Documentation

πŸ”’ Security Features

  • βœ… API keys stored in backend environment variables only
  • βœ… Frontend NEVER accesses API keys directly
  • βœ… All AI requests proxied through backend
  • βœ… CORS configured to allow all origins
  • βœ… Input validation with Pydantic models
  • βœ… No sensitive data in Git repository

🎯 Key Features

For Developers

  • Clean, documented code
  • Type hints throughout
  • Error handling with fallbacks
  • Comprehensive logging
  • Easy to extend and customize

For Users

  • Fast response times (Gemini 2.0 Flash)
  • Natural conversation flow
  • Mobile-friendly interface
  • Accessible design
  • No installation required

πŸ“Š Performance

  • Backend Response Time: < 2 seconds
  • Frontend Load Time: < 1 second
  • Uptime: 99.9% (Render free tier)
  • Cost: $0/month (100% FREE!)

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

πŸ“ License

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

πŸ‘¨β€πŸ’» Author

Vicky Kumar

πŸ™ Acknowledgments

πŸ“ž Support

If you have any questions or need help, feel free to:


⭐ Star this repo if you find it helpful! ⭐

About

the list of service i have included

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors