How vishalla/6th-sem-project works
Purpose and Entrypoints
This is a full-stack analytics/chatbot system: a Python backend exposes authentication, user, and chatbot APIs; a Vue frontend provides chat, graph, metrics, transaction, summary, and file-upload views. Backend startup is centered on backend/main.py (with backend/start.sh); frontend bootstraps from frontend/src/main.js into frontend/src/App.vue.
API and Application Boundary
HTTP routes are organized by domain and delegated into services rather than directly coupling UI to chatbot or persistence logic:
• Route aggregation and API surface: backend/api/routes.py, backend/api/chatbot_route.py
• Authentication/user endpoints: backend/api/auth.py, backend/api/user.py
• Service orchestration: backend/service/chatbot_service.py, backend/service/user_service.py
The frontend calls this boundary through frontend/src/services/api.js; router-selected screens live in frontend/src/router/index.js.
Identity, Security, and Persistence
Authentication concerns are separated into API handlers, dependency injection, and security primitives:
• backend/auth/auth.py
• backend/auth/deps.py
• backend/core/security.py
Database infrastructure is centralized in backend/database/session.py, with ORM/base definitions in backend/database/base.py and persisted models in backend/database/model.py. API/schema contracts are represented under backend/schema/user.py and backend/schema/chatbout.py.
Chatbot Query-to-Answer Pipeline
The chatbot is a staged natural-language processing pipeline, coordinated by backend/chatbot/main_chatbot.py. It analyzes and normalizes a question, derives domain intent/keywords, retrieves or executes relevant data, then constructs an answer or fallback:
• Query analysis: backend/chatbot/query_analysis.py, backend/chatbot/enhanced_query_analyzer.py
• Text/domain processing: backend/chatbot/text_processor.py, backend/chatbot/domain_vocabulary.py
• Retrieval/execution and response: backend/chatbot/vector_retriever.py, backend/chatbot/data_executor.py, backend/chatbot/answer_construction.py
• Conversation state and degraded handling: backend/chatbot/conversation_memory_manager.py, backend/chatbot/fallback.py
Ingestion and Vector Retrieval
Uploaded or downloaded source material enters a service-layer pipeline, likely producing embeddings/vector indexes used by chatbot retrieval:
• Ingestion/pipeline coordination: backend/service/ingestion.py, backend/service/run_pipeline.py
• Vector database creation and similarity calculation: backend/service/embeddings/create_vector_db.py, backend/service/embeddings/fiass_calculate.py
• File/download-facing contracts and service: backend/schema/files.py, backend/service/download.py
This is the key boundary between raw external data and queryable semantic context.
Graph Analytics
A distinct graph subsystem builds and validates graph structures, then runs algorithms through an execution engine:
• backend/graphs/build_graph.py
• backend/graphs/validation.py
• backend/graphs/engine.py
Its algorithm intent is documented in backend/graphs/graph_algo.md. The frontend renders graph-oriented results via frontend/src/components/GraphView.vue and frontend/src/views/GraphView.vue.
Frontend State and Presentation
The Vue/Vite client is organized around route-level analytical views and shared state:
• Authentication/session state: frontend/src/stores/auth.js, frontend/src/views/AuthView.vue
• Result state: frontend/src/stores/results.js
• Chat interaction: frontend/src/views/ChatView.vue, frontend/src/components/ChatSidebar.vue
• Data intake and analytical displays: frontend/src/components/FileUpload.vue, frontend/src/views/MetricsView.vue, frontend/src/views/SummaryView.vue
Material runtimes are Python backend dependencies (backend/requirements.txt) and a Node/Vue/Vite frontend (frontend/package.json, frontend/vite.config.js). No specific third-party database, model provider, or hosted vector service is identifiable from the supplied tree.
Main entry points: chatbot_service.py Application services · ChatView.vue Chat and analytics views · routes.py Route layer · auth.py Auth and user API
Components 18
Vue Client
- Vue bootstrap
frontend/src/main.js - App and router · Selects route-level application screens.
frontend/src/App.vue - API client
frontend/src/services/api.js - Session and results state
frontend/src/stores/auth.js - Chat and analytics views · Includes chat, metrics, summary, graph, and file-upload interfaces.
frontend/src/views/ChatView.vue
Backend API
- Route layer · Aggregates domain HTTP endpoints.
backend/api/routes.py - Auth and user API
backend/api/auth.py - Chatbot API
backend/api/chatbot_route.py - Identity and security · Provides authentication dependencies and security primitives.
backend/auth/deps.py - Application services · Coordinates chatbot and user use cases.
backend/service/chatbot_service.py - ORM persistence · Central session, base, and persisted models.
backend/database/session.py
Chatbot Pipeline
- Chatbot coordinator · Coordinates query-to-answer processing.
backend/chatbot/main_chatbot.py - Query understanding · Analyzes, normalizes, and derives domain intent.
backend/chatbot/query_analysis.py - Semantic retrieval
backend/chatbot/vector_retriever.py - Answer and fallback · Builds responses and handles degraded cases.
backend/chatbot/answer_construction.py
Data & Analytics
- Ingestion pipeline · Coordinates uploaded or downloaded source processing.
backend/service/ingestion.py - Vector index creation · Creates vector data used for semantic retrieval.
backend/service/embeddings/create_vector_db.py - Graph analytics engine · Builds, validates, and executes graph algorithms.
backend/graphs/engine.py
Connections 21
- Vue bootstrap → App and router: mounts
- App and router → Chat and analytics views: selects
- Chat and analytics views → Session and results state: reads and updates
- Chat and analytics views → API client: requests data
- API client → Route layer: HTTP
- Route layer → Auth and user API: auth/user routes
- Route layer → Chatbot API: chat routes
- Auth and user API → Identity and security: authenticates
- Auth and user API → Application services: delegates
- Chatbot API → Application services: delegates
- Application services → ORM persistence: persists users and data
- Application services → Chatbot coordinator: runs queries
- Chatbot coordinator → Query understanding: analyzes question
- Query understanding → Semantic retrieval: supplies intent
- Semantic retrieval → Answer and fallback: returns context
- Answer and fallback → Chatbot coordinator: produces answer
- Ingestion pipeline → Vector index creation: creates embeddings
- Vector index creation → Semantic retrieval: queryable context
- Ingestion pipeline → ORM persistence: stores processed data
- Application services → Graph analytics engine: runs graph analysis
- Graph analytics engine → Chat and analytics views: graph results