How mohamedshafars19/bharatspec-ai works
BharatSpec AI is a procurement-specification assistant. Procurement staff submit a requirement or tender document; the application parses it, asks for clarifications, audits readiness, finds relevant Indian Standards, reviews relationships and versions, and can produce an improved specification and report. The graph preserves project workspaces, standards exploration, and authentication as supporting capabilities. Backend service-call details are based on indexed imports and excerpts; unsampled route behavior is represented only where the README documents it.
Main entry points: main.py FastAPI application · recommendation_service.py Standards recommendation · api.ts API client · analyze.py Analysis endpoint
Components 27
User Workspace
- Web application
frontend/src/App.tsx - Authentication
frontend/src/context/AuthContext.tsx - Analysis workspace
frontend/src/pages/Analyze.tsx - Project workspace
frontend/src/pages/ProjectDetail.tsx - Standards browser
frontend/src/pages/Standards.tsx - Report export
frontend/src/components/ExportReportModal.tsx - Relationship visualization
frontend/src/components/StandardRelationshipGraph.tsx
Requirement Analysis
- Document intake
backend/app/api/routes/documents.py - Analysis endpoint
backend/app/api/routes/analyze.py - Requirement parsing
backend/app/services/requirement_service.py - Clarifying questions
backend/app/services/clarification_service.py - Specification audit
backend/app/services/gap_detection_service.py - Specification endpoints
backend/app/api/routes/specification.py - Specification drafting
backend/app/services/spec_improvement_service.py
Standards Intelligence
- Standards recommendation
backend/app/services/recommendation_service.py - Vector retrieval
backend/app/services/vector_search_service.py - Text embeddings
backend/app/services/embedding_service.py - Standards catalog
backend/app/services/standards_service.py - Relationship graph
backend/app/services/relationship_graph_service.py - Standards endpoints
backend/app/api/routes/standards.py
Workspace Data
- SQLite workspace store
backend/app/database/db.py
Application Platform
- API client
frontend/src/services/api.ts - Gemini service
backend/app/services/gemini_service.py - API domain schemas
backend/app/models/schemas.py - Runtime configuration
backend/app/core/config.py - FastAPI application
backend/app/main.py
Other components
- Procurement staff
Connections 42
- Procurement staff → Web application: uses
README.md - Web application → Analysis workspace: routes to
frontend/src/App.tsx - Web application → Authentication: provides context
frontend/src/App.tsx - Procurement staff → Analysis workspace: submits requirement
README.md - Analysis workspace → API client: requests analysis
frontend/src/pages/Analyze.tsx - API client → Analysis endpoint: calls endpoint
frontend/src/services/api.ts - FastAPI application → Analysis endpoint: mounts
backend/app/main.py - Analysis workspace → Document intake: uploads tender
README.md - FastAPI application → Document intake: mounts
backend/app/main.py - Analysis endpoint → Requirement parsing: parses requirement
backend/app/api/routes/analyze.py - Analysis endpoint → Clarifying questions: gets questions
backend/app/api/routes/analyze.py - Analysis endpoint → SQLite workspace store: reads and saves
backend/app/api/routes/analyze.py - Requirement parsing → Gemini service: uses when configured
backend/app/services/requirement_service.py - Analysis endpoint → Standards recommendation: gets standards
backend/app/api/routes/analyze.py - Standards recommendation → Vector retrieval: retrieves matches
backend/app/services/recommendation_service.py - Standards recommendation → Standards catalog: enriches results
backend/app/services/recommendation_service.py - Standards recommendation → Specification audit: audits requirement
backend/app/services/recommendation_service.py - Standards recommendation → Clarifying questions: checks ambiguity
backend/app/services/recommendation_service.py - Standards recommendation → Relationship graph: adds relationships
backend/app/services/recommendation_service.py - Standards recommendation → Specification drafting: drafts specification
backend/app/services/recommendation_service.py - Vector retrieval → Text embeddings: encodes text
backend/app/services/vector_search_service.py - Vector retrieval → Standards catalog: indexes catalog
backend/app/services/vector_search_service.py - Procurement staff → Standards browser: explores standards
README.md - Standards browser → API client: requests standards
frontend/src/pages/Standards.tsx - API client → Standards endpoints: calls endpoint
frontend/src/services/api.ts - FastAPI application → Standards endpoints: mounts
backend/app/main.py - Standards endpoints → Standards catalog: searches catalog
backend/app/api/routes/standards.py - Standards endpoints → Relationship graph: gets graph
backend/app/api/routes/standards.py - Relationship visualization → API client: loads graph
frontend/src/pages/StandardDetail.tsx - Procurement staff → Specification endpoints: requests audit or draft
README.md - FastAPI application → Specification endpoints: mounts
backend/app/main.py - Specification endpoints → Specification audit: audits specification
backend/app/api/routes/specification.py - Specification endpoints → Specification drafting: improves specification
backend/app/api/routes/specification.py - Procurement staff → Report export: exports report
README.md - Project workspace → API client: loads project
frontend/src/pages/ProjectDetail.tsx - Procurement staff → Project workspace: organizes work
README.md - Authentication → API client: authenticates
frontend/src/context/AuthContext.tsx - SQLite workspace store → Runtime configuration: gets database setting
backend/app/database/db.py - FastAPI application → SQLite workspace store: initializes
backend/app/main.py - FastAPI application → Standards catalog: loads catalog
backend/app/main.py - FastAPI application → Vector retrieval: loads index
backend/app/main.py - Gemini service → Runtime configuration: reads model settings
backend/app/services/gemini_service.py