The CSV Viewer & Report Generation System is an enterprise-grade Java web application created to simplify the management, ingestion, visualization, and reporting of large CSV datasets. Developed using a 3-tier architecture with Java Servlets, JSP, HikariCP, and MySQL, the system provides real-time asynchronous background report generation, dynamic status monitoring, in-browser dataset exploration, and direct exports to formatted CSV and Excel (.xlsx) workbooks.
- 📁 Folder & File Management: Create, organize, and search CSV datasets categorized into distinct folders.
- ⚡ Asynchronous CSV Processing: Non-blocking background thread execution for multi-thousand row files (
GenerateServlet). - 🔄 Real-Time Progress Monitoring: Dynamic AJAX polling tracking processing progress from
0%to100%(ProgressServlet). - 🔍 Interactive Data Viewer: Tabular data visualization featuring row/column statistics and live client-side record searching.
- 📥 Multi-Format Export: One-click downloading of generated datasets as formatted
.csvor.xlsxfiles. - 🛡️ High Availability & Fault Tolerance: Built-in
StatusStorein-memory fallback and HikariCP connection pool circuit breakers ensuring zero downtime even during database fluctuations.
The system follows a classic Three-Tier Architecture:
graph TD
subgraph Presentation Layer
UI[User / Admin Dashboard - JSP & JS]
end
subgraph Application Layer
Servlet1[FileListServlet]
Servlet2[FolderCsvServlet]
Servlet3[GenerateServlet - Async Thread]
Servlet4[ProgressServlet - Status Polling]
Servlet5[ViewCsvServlet]
Servlet6[DownloadServlet]
end
subgraph Data Layer
DB[(MySQL Database)]
Cache[StatusStore Memory Fallback]
FS[Server File Storage]
end
UI <--> Servlet1
UI <--> Servlet2
UI <--> Servlet3
UI <--> Servlet4
UI <--> Servlet5
UI <--> Servlet6
Servlet3 <--> Cache
Servlet4 <--> Cache
Servlet3 <--> FS
Servlet5 <--> FS
Servlet6 <--> FS
Servlet1 <--> DB
Servlet3 <--> DB
Servlet4 <--> DB
| Component | Type | Description |
|---|---|---|
FileListServlet.java |
Backend | Scans disk folders and aggregates generated report counts for the dashboard. |
FolderCsvServlet.java |
Backend | Lists CSV files within a folder and overlays generation statuses. |
GenerateServlet.java |
Backend | Reads CSV datasets asynchronously in background threads and updates progress. |
ProgressServlet.java |
Backend | Exposes real-time progress percentages via JSON endpoints. |
ViewCsvServlet.java |
Backend | Parses CSV files into structured JSON for tabular visualization. |
DownloadServlet.java |
Backend | Streams CSV and Excel (.xlsx) files securely to client browsers. |
StatusStore.java |
Cache | In-memory thread-safe status store for 100% uptime fallback. |
DbConnection.java |
Service | Shared HikariCP connection pool manager with fast fail-over. |
- JDK: Java 11 or higher
- Server: Apache Tomcat 9.0+
- Database: MySQL 8.0+
Configure database connection parameters in src/main/resources/db.properties:
db.url=jdbc:mysql://localhost:3306/csvgenerator_db?useSSL=false&serverTimezone=UTC
db.username=root
db.password=your_password
db.pool.size=10Note
Environment variables DB_URL, DB_USERNAME, and DB_PASSWORD will override db.properties automatically if present.
- Deploy the compiled web application to Tomcat's
webappsorwtpwebappsdirectory. - Start Apache Tomcat.
- Access the dashboard:
http://localhost:8080/apps/apps/csvgenerator/fileListServlet
Distributed under the MIT License.