How vigneshrajnadar/ai-tender-government-contract-intelligence-platform works
Purpose and entry points
A full-stack Indian government-procurement intelligence platform: discover tenders, evaluate company fit and risk, generate proposals, and provide ML/RAG-backed market intelligence. Backend API starts at backend/main.py; React SPA starts at frontend/src/main.jsx and routes from frontend/src/App.jsx. run.sh is the likely local orchestration entry point.
Client application
The Vite/React frontend is a multi-page operational console. Pages call the backend through a centralized API client and retain company-profile state globally.
• frontend/src/api/client.js
• frontend/src/context/CompanyContext.jsx
• frontend/src/pages/TenderBrowser.jsx
• frontend/src/pages/MultiAgent.jsx
• frontend/src/pages/ProposalGenerator.jsx
API composition and persistence boundary
FastAPI composes domain routers under /api, separating tender CRUD/discovery, company data, analytics, AI workflows, and advanced intelligence. SQLAlchemy models form the persistence boundary over SQLite; tenders, companies, bid history, alerts, and notifications are shared state for downstream analysis.
• backend/main.py
• backend/routers/tenders.py
• backend/routers/ai_analysis.py
• backend/routers/advanced_ai.py
• backend/models/models.py
• backend/core/database.py
Tender ingestion and alert source flow
Scraping services fetch and normalize public procurement data from GeM, CPPP, NIC/state sources, then persist discovered tenders for browser, analytics, recommendations, and AI analysis. Scheduled refresh is configured at the backend application layer; manual scrape exposure is routed through tender APIs.
• backend/services/scraper_service.py
• backend/routers/tenders.py
• backend/main.py
• backend/run_scraper.py
RAG and LLM analysis layer
AI routers use a shared LLM service and vector retrieval service. Retrieval chunks source tender text and curated procurement knowledge, builds/searches FAISS embeddings, then supplies relevant context to OpenRouter-hosted LLMs. Knowledge is repo-managed rather than a remote document store.
• backend/services/vector_service.py
• backend/services/llm_service.py
• backend/data/govt_rules/gfr_2017.txt
• backend/data/risk_cases/scope_creep_cases.txt
• backend/data/proposal_templates.json
Multi-agent decision workflow
The orchestrator executes specialized tender-reader, eligibility, risk, competitor, proposal, and financial analyses in parallel, then produces a unified tender assessment. This is an orchestration boundary above common LLM/RAG services and below the agents API.
• backend/agents/orchestrator.py
• backend/routers/agents.py
• backend/routers/ai_analysis.py
Predictive ML and intelligence services
Persisted scikit-learn artifacts support bid optimization, competitor/department analysis, fraud/risk classification, market forecasting, and win prediction. Router endpoints invoke service layers rather than training scripts; training remains offline/rebuild-oriented.
• backend/services/ml_service.py
• backend/services/advanced_ml_service.py
• backend/routers/ml_pipeline.py
• backend/ml/model_manager.py
• backend/ml/models/win_predictor.pkl
Runtime and external dependencies
Runtime is Python/FastAPI with SQLAlchemy/SQLite, APScheduler, BeautifulSoup/httpx, FAISS, Sentence Transformers, and scikit-learn; frontend is React 18/Vite. External integration boundaries are OpenRouter LLM APIs and scraped government procurement portals. Local database artifacts exist at backend/tender_platform.db and repository root tender_platform.db.
Main entry points: main.py FastAPI application · scraper_service.py Procurement scraper · TenderBrowser.jsx Tender, agent & proposal pages · orchestrator.py Multi-agent orchestrator
Components 21
React Console
- React SPA · Operational console for tender, agent, and proposal workflows.
frontend/src/main.jsx - Application routes
frontend/src/App.jsx - API client
frontend/src/api/client.js - Company profile state
frontend/src/context/CompanyContext.jsx - Tender, agent & proposal pages
frontend/src/pages/TenderBrowser.jsx
FastAPI Backend
- FastAPI application · Mounts API routers and configures scheduled refresh.
backend/main.py - Tender APIs · Tender CRUD, discovery, and manual scraping boundary.
backend/routers/tenders.py - AI intelligence APIs
backend/routers/advanced_ai.py - Agents API
backend/routers/agents.py - Domain models
backend/models/models.py - ML pipeline APIs · Serves prediction and advanced intelligence workflows.
backend/routers/ml_pipeline.py
AI & Intelligence
- Multi-agent orchestrator · Combines specialist tender assessments into a unified result.
backend/agents/orchestrator.py - Vector retrieval · Chunks and retrieves tender and procurement knowledge context.
backend/services/vector_service.py - LLM service
backend/services/llm_service.py - OpenRouter LLM APIs
- ML intelligence services · Bid, competitor, fraud, forecasting, and win analysis.
backend/services/advanced_ml_service.py - Win predictor artifact
backend/ml/models/win_predictor.pkl
Data Sources & Storage
- Tender platform database · Shared tenders, companies, bid history, alerts, and notifications.
backend/tender_platform.db - Procurement scraper · Fetches and normalizes public procurement tenders.
backend/services/scraper_service.py - Government procurement portals · GeM, CPPP, NIC, and state procurement sources.
- Procurement knowledge · Rules, risk cases, and proposal templates.
backend/data/govt_rules/gfr_2017.txt
Connections 23
- React SPA → Application routes: boots
- Application routes → Tender, agent & proposal pages: renders
- Tender, agent & proposal pages → Company profile state: uses
- Tender, agent & proposal pages → API client: calls through
- API client → FastAPI application: /api
- FastAPI application → Tender APIs: mounts
- FastAPI application → AI intelligence APIs: mounts
- FastAPI application → Agents API: mounts
- FastAPI application → ML pipeline APIs: mounts
- FastAPI application → Procurement scraper: scheduled refresh
- Tender APIs → Procurement scraper: manual scrape
- Procurement scraper → Government procurement portals: fetches
- Procurement scraper → Domain models: persists tenders
- Domain models → Tender platform database: maps state
- AI intelligence APIs → Vector retrieval: retrieves context
- Agents API → Multi-agent orchestrator: runs assessment
- Multi-agent orchestrator → Vector retrieval: uses context
- Multi-agent orchestrator → LLM service: delegates analysis
- Vector retrieval → Procurement knowledge: indexes/searches
- LLM service → OpenRouter LLM APIs: generates via
- ML pipeline APIs → ML intelligence services: invokes
- ML intelligence services → Win predictor artifact: loads
- ML intelligence services → Tender platform database: analyzes persisted data