How shubnimkar/tracealyzer-log-parser works
Project Type and Purpose
• Full-stack web application (MERN) for universal log parsing, storage, querying, and visualization.
• Extensible “plugin” architecture for multiple log formats (Nginx, JSON, Syslog, Docker, Kernel).
• Dockerized deployment via Docker Compose, with MongoDB Atlas as the cloud datastore.
Main Components
A. Frontend Container
– React app (frontend/src) served via Nginx (frontend/nginx.conf).
– UI components: Upload, Logs Viewer, Stats, ThemeSwitcher.
– Context providers for FileContext and ThemeContext.
B. Reverse Proxy (optional)
C. Backend Container
– Node.js + Express server (backend/app.js).
– Routes (backend/routes/logRoutes.js) → Controllers (backend/controllers/logController.js) → Models (backend/models/Log.js).
– Parser subsystem (backend/parser/*.js), plus detectLogType utility (backend/utils/detectLogType.js).
– Uploads storage (backend/uploads/…) for temporary file storage.
D. Database
– MongoDB Atlas cluster (cloud).
E. Orchestration
– Docker Compose network linking frontend, backend, and any other services.
Relationships & Data Flows
• User in Browser → HTTP(s) → Frontend Container (React + Nginx)
• Frontend → REST API calls → Backend (Express)
– POST /upload → upload file → detectLogType → select appropriate parser → parse → construct Log document → save to MongoDB → respond with stored entries or a status code
• Backend → MongoDB Atlas (CRUD operations)
Architectural Patterns & Design Principles
• Modular Parser Architecture: each apacheParser.js, jsonParser.js, etc., implements a common interface. This is a plugin pattern.
• MVC-style segregation in the backend: Routes → Controllers → Models.
• Context API in React for global state (files, theme).
• Docker Compose for environment consistency and network isolation.
Relevant Technologies & Frameworks
• Frontend: React, Tailwind, Chart.js.
• Backend: Node.js, Express.
• Database: MongoDB Atlas (Mongoose implied by model files).
• Parsing Logic: Custom JS modules under backend/parser.
• Deployment: Docker, Docker Compose, Nginx (for static assets).