Skip to content

Charithkakarla/agentathon

Repository files navigation

πŸš€ ProcureAI - Tender Management System

AI-powered tender scraping, analysis, and bid management system for government procurement.

Features

  • πŸ€– Automated Tender Scraping - Scrapes Telangana eProcurement portal
  • πŸ’¬ AI Chat Assistant - RAG-based Q&A about tenders using Gemini
  • πŸ“Š Bid Evaluation - Automated compliance and risk scoring
  • πŸ” Smart Search - Vector-based tender search
  • πŸ“ˆ Analytics Dashboard - Tender statistics and insights

Tech Stack

Backend:

  • FastAPI (Python)
  • PostgreSQL
  • Qdrant (Vector DB)
  • LangGraph + Gemini AI
  • Selenium (Web Scraping)

Frontend:

  • React + Vite
  • TailwindCSS
  • Recharts

πŸš€ Quick Deploy (Recommended)

Option 1: Automated Railway Deploy (Fastest!)

# Run the automated deployment script
.\deploy-railway.ps1

That's it! The script will:

  • Install Railway CLI
  • Setup project and database
  • Configure environment
  • Deploy your app
  • Initialize database

Option 2: Manual Railway Deploy

# Install Railway CLI
npm install -g @railway/cli

# Login and deploy
railway login
railway init
railway add --plugin postgresql
railway up

# Set environment variables
railway variables set GEMINI_API_KEY="your_key"
railway variables set SECRET_KEY="$(python -c 'import secrets; print(secrets.token_hex(32))')"

# Initialize database
railway run python backend/create_database.py

Option 3: Deploy to Render.com (Most Free)

See DEPLOY_RENDER.md for step-by-step instructions.

πŸ“š Documentation

πŸ› οΈ Local Development

Prerequisites

  • Python 3.9+
  • Node.js 16+
  • PostgreSQL 14+
  • Docker (for Qdrant)

Quick Start

1. Backend:

cd backend
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt

# Copy and configure .env
copy .env.example .env
notepad .env  # Add your GEMINI_API_KEY

# Start Qdrant
docker run -d -p 6333:6333 qdrant/qdrant

# Initialize database
python create_database.py
python seed_db.py

# Start server
.\start.ps1

2. Frontend:

cd frontend
npm install
.\start.ps1

Access:

πŸ”‘ API Keys

Gemini API Key (Required)

  1. Go to https://makersuite.google.com/app/apikey
  2. Sign in with Google
  3. Create API key
  4. Add to .env file or deployment environment

🐳 Docker Deployment

# Create .env file with your keys
echo "GEMINI_API_KEY=your_key" > .env

# Start all services
docker-compose up -d

# Initialize database
docker-compose exec backend python create_database.py

Access at http://localhost:5173

πŸ“¦ Project Structure

agentathon/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ agents/          # AI agents (LangGraph)
β”‚   β”‚   β”œβ”€β”€ routes/          # API endpoints
β”‚   β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   β”‚   β”œβ”€β”€ models.py        # Database models
β”‚   β”‚   └── main.py          # FastAPI app
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── Dockerfile
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/           # React pages
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   └── services/        # API client
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”œβ”€β”€ docker-compose.yml
└── deployment guides...

πŸ§ͺ Testing

# Backend tests
cd backend
python test_system.py
python test_api.py

# Frontend
cd frontend
npm test

πŸš€ Deployment Scripts

Pre-deployment Check

.\check-deployment.ps1

Verifies your project is ready to deploy.

Automated Deploy

# Railway (recommended)
.\deploy-railway.ps1

# Or Linux/Mac
chmod +x deploy-railway.sh
./deploy-railway.sh

πŸ“Š Features Overview

1. Tender Scraping

  • Automated scraping from Telangana portal
  • Scheduled updates every 6 hours
  • Manual trigger available

2. AI Chat

  • Ask questions about tenders
  • RAG-based responses using Gemini
  • Context-aware answers

3. Bid Management

  • Submit and track bids
  • Automated compliance checking
  • Risk assessment scoring

4. Dashboard

  • Real-time statistics
  • Tender analytics
  • Activity logs

πŸ”’ Security

  • Environment variables for secrets
  • CORS protection
  • Input validation
  • SQL injection prevention
  • Rate limiting (recommended for production)

πŸ“ˆ Scaling

For production use:

  • Enable database connection pooling
  • Add Redis for caching
  • Use CDN for static assets
  • Setup monitoring (Sentry, Datadog)
  • Configure auto-scaling

See DEPLOYMENT_GUIDE.md for details.

πŸ› Troubleshooting

Backend won't start:

  • Check .env file exists with GEMINI_API_KEY
  • Verify PostgreSQL is running
  • Check port 8000 is available

Frontend can't reach backend:

  • Verify backend is running
  • Check CORS settings
  • Update API_URL in frontend

Database errors:

  • Run python create_database.py
  • Check DATABASE_URL format
  • Verify PostgreSQL credentials

See troubleshooting guides in deployment docs.

πŸ“ Environment Variables

Backend (.env):

DATABASE_URL=postgresql://user:password@localhost:5432/procureai
GEMINI_API_KEY=your_gemini_api_key
SECRET_KEY=your-secret-key
DEBUG=True
CORS_ORIGINS=http://localhost:5173
QDRANT_HOST=localhost
QDRANT_PORT=6333

Frontend (.env):

VITE_API_URL=http://localhost:8000

🀝 Contributing

  1. Fork the repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Create Pull Request

πŸ“„ License

This project is for educational/demo purposes.

πŸ†˜ Support

  • Check documentation in /docs
  • Review deployment guides
  • Check API docs at /api/docs
  • Create an issue for bugs

🎯 Quick Links


Made with ❀️ for Agentathon 2024

Ready to deploy? Start with DEPLOY_NOW.md

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors