How ranjeetj06/insighthub works
1. This repository is a small microservice-based system, not a single monolith. It contains three Spring Boot services under separate folders — uploadClean, analysisInsights, and report — plus a React frontend in insighthub. The services are connected primarily through RabbitMQ events, with MongoDB used for persisted analysis data and local file generation used for report outputs.
2. The user-facing entry point is the React app. Its components (UploadSection, ResultSection, MainFrame, etc.) suggest a simple flow: upload a dataset, trigger backend processing, and display results. api.js is the frontend integration point to the backend services.
3. uploadClean is the ingestion and cleaning boundary. It provides REST controllers for file upload and cleaning operations, stores or writes file content via FileStorageService / FileWriteUtil, applies CSV/Excel handling utilities, and publishes a CleanedDataEvent. This service is the first backend hop after the UI.
4. RabbitMQ is the central integration bus. Each backend service has its own RabbitMQConfig, and both uploadClean and analysisInsights include event model classes with the same CleanedDataEvent naming, indicating a producer/consumer handoff. This decouples file ingestion from downstream analysis and report creation.
5. analysisInsights is the analytics service. It consumes cleaned data through InsightEventListener, performs insight generation in InsightServiceImpl, and stores or retrieves analysis artifacts through InsightResultRepository. The model set includes summaries and correlations (NumericSummary, CorrelationPair, TemporalCoverage, ValueCount, InsightResult), so this service is responsible for converting cleaned data into structured findings.
6. report is the presentation/export service. It listens for events via ReportEventListener and provides a ReportDownloadController for retrieving generated outputs. Its utility classes (GraphGenerator, CSVUtils) and dependencies named in the README indicate this service turns analysis data into PDF/Excel reports with charts.
7. Each microservice follows the same internal layering pattern: controllers, service interfaces, service implementations, listeners, models, exceptions, and utility classes. That makes the diagram easy to draw as three parallel vertical stacks with a similar shape, but different domain responsibilities.
8. Persistence is service-scoped rather than shared. The only explicit repository in the tree is InsightResultRepository in analysisInsights, which aligns with the README’s MongoDB usage for analysis storage. The other services appear more transient or file-oriented, with uploadClean handling uploaded/cleaned files and report generating downloadable artifacts.
9. Error handling is standardized across services. Each backend module has GlobalException, ResourceNotFoundException, ProcessFailureException, and ErrorResponse, suggesting a consistent API error contract and a service-local exception boundary rather than cross-service exception propagation.
10. Infrastructure is intentionally split between local development and Kubernetes deployment. docker-compose.yml and the README show RabbitMQ and MongoDB as local dependencies, while the k8s directory contains manifests for namespaces, RBAC, persistent volumes, MongoDB, RabbitMQ, and each service deployment. That means the architecture includes both containerized runtime dependencies and orchestration manifests.
11. The likely end-to-end data flow is: user uploads CSV/Excel in the React app → uploadClean cleans and emits a message → analysisInsights consumes the cleaned dataset and computes insights → report generates a downloadable report from the analyzed data. The services are therefore separated by business stage rather than by UI/API tier.
12. For an architecture diagram, the most important boundaries are: client UI, ingestion/cleaning service, analytics service, report generation service, message broker, and data/storage backends. The key external technologies that materially shape the design are React, Spring Boot 3/Java 17, RabbitMQ, MongoDB, Docker/Docker Compose, and Kubernetes.
Main entry points: rabbitmq.yml RabbitMQ · InsightServiceImpl.java Insight Core · MainFrame.jsx Main Frame · CleaningServiceImpl.java Cleaning Core
Components 23
Frontend
React UI and API client
- App · Top-level React application composition
insighthub/src/App.js - Main Frame · Primary page workflow container
insighthub/src/components/MainFrame.jsx - Upload Section · Dataset upload entry component
insighthub/src/components/UploadSection.jsx - Result Section · Shows analysis and report outcomes
insighthub/src/components/ResultSection.jsx - API Client · Frontend integration point for backend calls
insighthub/src/api.js
Upload Clean
Ingestion and cleaning microservice
- Upload API · Handles file upload requests
uploadClean/src/main/java/com/insight/uploadclean/controllers/FileUploadController.java - Cleaning API · Exposes cleaning operations
uploadClean/src/main/java/com/insight/uploadclean/controllers/CleaningController.java - Cleaning Core · Parses, cleans, and emits downstream events
uploadClean/src/main/java/com/insight/uploadclean/service/ServiceImpl/CleaningServiceImpl.java - File Storage · Persists uploaded and cleaned files locally
uploadClean/src/main/java/com/insight/uploadclean/service/ServiceImpl/FileStorageServiceImpl.java - Cleaned Event · Message published after cleaning completes
uploadClean/src/main/java/com/insight/uploadclean/model/CleanedDataEvent.java
Analysis Insights
Analytics and persistence microservice
- Insight Listener · Consumes cleaned-data messages from RabbitMQ
analysisInsights/src/main/java/com/insight/analysisinsights/listener/InsightEventListener.java - Insight Core · Generates summaries, correlations, and findings
analysisInsights/src/main/java/com/insight/analysisinsights/services/serviceImpl/InsightServiceImpl.java - Insight Repo · Persists and retrieves analysis results
analysisInsights/src/main/java/com/insight/analysisinsights/repository/InsightResultRepository.java - Insight Models · Structured analytics outputs and supporting metrics
analysisInsights/src/main/java/com/insight/analysisinsights/models/InsightResult.java
Report Service
Report generation and download microservice
- Report Listener · Receives analysis-related events for report creation
report/src/main/java/com/insight/report/listener/ReportEventListener.java - Download API · Serves generated report downloads
report/src/main/java/com/insight/report/controller/ReportDownloadController.java - Report Core · Builds downloadable report artifacts
report/src/main/java/com/insight/report/service/ServiceImpl/ReportServiceImpl.java - Report Utils · Generates charts and CSV output for reports
report/src/main/java/com/insight/report/utils/GraphGenerator.java
Infrastructure
Broker, database, and deployment manifests
- RabbitMQ · Asynchronous handoff between microservices
k8s/rabbitmq.yml - MongoDB · Persistent store for analysis data
k8s/mongodb.yml - Upload Deploy · Kubernetes deployment manifest for upload-clean
k8s/upload-clean.yml - Analysis Deploy · Kubernetes deployment manifest for analysis-insights
k8s/analysis-insights.yml - Report Deploy · Kubernetes deployment manifest for report
k8s/report.yml
Connections 27
- App → Main Frame: composes · App assembles the main page shell
- Main Frame → Upload Section: hosts · Main frame contains upload flow
- Main Frame → Result Section: hosts · Main frame contains result display
- Upload Section → API Client: calls · Upload UI invokes backend API client
- Result Section → API Client: calls · Results UI fetches backend data
- API Client → Upload API: REST · Frontend starts the ingestion workflow
- Upload API → Cleaning API: delegates · Upload controller forwards cleaning actions
- Cleaning API → Cleaning Core: uses · Controller delegates to cleaning logic
- Cleaning Core → File Storage: writes · Cleaned or uploaded files are stored locally
- Cleaning Core → Cleaned Event: publishes · Cleaning completion emits a broker event
- Cleaned Event → RabbitMQ: sends · RabbitMQ carries the cleaned dataset message
- RabbitMQ → Insight Listener: delivers · Analytics service consumes the cleaned event
- Insight Listener → Insight Core: triggers · Listener hands off to insight generation
- Insight Core → Insight Models: produces · Service creates structured insight objects
- Insight Core → Insight Repo: persists · Generated insights are stored in MongoDB
- Insight Repo → MongoDB: stores · Repository writes to the database backend
- Insight Core → RabbitMQ: publishes · Analysis results can be forwarded downstream
- RabbitMQ → Report Listener: delivers · Report service consumes analysis-related events
- Report Listener → Report Core: triggers · Listener starts report assembly
- Report Core → Report Utils: renders · Utilities generate charts and tabular output
- Report Core → Download API: exposes · Controller serves generated reports for download
- Upload Deploy → Upload API: deploys · Kubernetes manifest defines the upload-clean service
- Analysis Deploy → Insight Listener: deploys · Kubernetes manifest defines the analysis-insights service
- Report Deploy → Download API: deploys · Kubernetes manifest defines the report service
- Upload Deploy → RabbitMQ: connects · Upload service depends on RabbitMQ
- Analysis Deploy → MongoDB: connects · Analysis service depends on MongoDB
- Report Deploy → RabbitMQ: connects · Report service depends on RabbitMQ