How yuri-val/symmetric-dashboard works
Project Type & Purpose
• This is a full-stack application that splits front-end and back-end concerns. The purpose is to provide a dashboard for real-time monitoring and management of database synchronization (nodes, batches, configuration).
• The README clearly specifies different sections like Dashboard Overview, Node Management, Batch Monitoring, and Configuration, which can be represented as key features/components in the design.
Main Components
• Frontend (Client):
• Built with React (using Vite for build tooling).
• Uses Material UI for UI components, React Router for navigation, and Recharts for data visualization.
• Communicates with the server using Axios and is enhanced with TanStack React Query for data fetching/caching.
• Backend (Server):
• A Node.js Express application structured with controllers, services, and repositories.
• Provides RESTful API endpoints (e.g., /health, /api/node/status, /api/node/nodes, /api/engine/config, /api/batch/status) to serve data to the frontend.
• Connects to a SymmetricDS meta database (MySQL) using MySQL2 and manages environment configuration via Dotenv.
• Database:
• The external SymmetricDS meta database, which the server connects to for retrieving node, batch, and configuration data.
• Deployment & Infrastructure:
• Docker and Docker Compose for containerized deployment.
• Nginx is used (as per nginx.conf) to serve the frontend and proxy API requests.
• GitHub workflows & start.sh suggest CI/CD integration along with process management in production (potentially via PM2).
Relationships & Interactions
• The Frontend communicates with the Backend using REST API calls.
• The Backend’s layered architecture (controllers → services → repositories) interacts with the Database.
• In production, Nginx acts as a reverse proxy, ensuring that API requests (forwarded from client requests) reach the appropriate server endpoints.
• Docker and Docker Compose manage the containers, indicating that both client and server are built and run as separate microservices (or containers) that interact with each other.
Architectural Patterns & Design Principles
• Separation of concerns: The client and server are clearly separated, with the server further divided into controllers, services, and repositories.
• Layered architecture on the backend helps in isolating business logic (services) from data access (repositories).
• Use of environment variables for sensitive configuration emphasizes secure design principles.
• A modular approach on the frontend with dedicated directories for API, components, pages, and context helps maintain readability and extensibility.