How aaditya-5281/stcmp works
Main Components
• Frontend Interface:
• React.js application with Redux for state management and React Router for navigation.
• Contains various UI components such as Login, Home, Attendance, Trainings, and Audit Inspection.
• Utilizes libraries like Chart.js for data visualization and React PDF for generating reports.
• Backend API Layer:
• Node.js server built with Express.js.
• Contains API endpoints grouped under directories like "APIs" (e.g., faculty-api.js and trainings-api.js) that handle business logic such as managing trainings, certifications, and faculty information.
• Database:
• MongoDB serves as the database for storing training records, faculty data, certifications, and other relevant information.
• External Services/Configuration:
• Environment variables (using Dotenv) to configure database connection strings and port settings.
• Cross-Origin Resource Sharing middleware (Cors) ensuring the frontend can communicate with the backend.
Relationships and Interactions
• The Frontend sends HTTP requests (likely via RESTful endpoints) to the Backend for data operations.
• The Backend processes these requests and interacts with MongoDB to store, retrieve, and update training and user data.
• Data Flow:
• User actions (such as logging in or querying training details) trigger API calls from React.
• API endpoints in the Express server receive the requests, perform business logic (including generating PDF reports or preparing data for charts), and return JSON responses.
• The frontend then updates the UI accordingly.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Clear distinction between the frontend (UI/UX and state management) and backend (API logic and data management).
• Modularization:
• The file structure is organized with dedicated directories for frontend components and backend APIs, which promotes scalability and maintainability.
• Client-Server Communication:
• Defined interactions via HTTP (or potentially WebSocket for real-time updates) between the client and server.
Technologies Highlight
• Frontend:
• React.js, Redux, React Router, Bootstrap, Chart.js, React PDF.
• Backend:
• Node.js, Express.js, MongoDB, Cors, Dotenv.