How cis3296s25/tuquiet works
Main Components
• Frontend:
• Represented by the frontend directory.
• Uses ReactJS (App.jsx, various component files like BuildingCard.jsx, ReportingForm.jsx, Sidebar.jsx, etc.) and Vite for development.
• Serves the user interface where students can view study space data and submit reports.
• Backend:
• Represented by the backend directory.
• Implemented in Java using Spring Boot. Key elements include:
◦ Main application class (App.java) indicating the entry point.
◦ Controller package (with ReportController.java) which exposes RESTful endpoints for receiving and serving reports.
◦ Configuration package (with WebConfig.java) that sets cross-cutting settings for the web layer.
• Includes test classes and configuration files (e.g., application.properties).
• Database:
• While not explicitly visible as a running service in the file tree, the presence of SQL files (createTables.sql) indicates that a relational database is used for storing study space reports and possibly other user data.
• Deployment/Execution Elements:
• The README explains how to run the backend (via a Spring Boot jar file) and the frontend (npm-driven development server), which implies that the system is deployed as two separate services that interact via HTTP calls (likely REST APIs).
Relationships and Interactions
• User Interaction:
• Users interact with the frontend (React application) through browser-based interfaces.
• API Communication:
• The frontend sends HTTP requests (e.g., via fetch or axios) to the backend’s REST endpoints, handled by controllers like ReportController.
• Data Persistence:
• The backend manages state/data (e.g., noise levels, crowdedness reports) and persists them in a relational database (set up using the provided SQL scripts).
• Configuration and Environment:
• There is a clear separation of concerns. Backend components (controller, configuration, and tests) and frontend components (views, pages, components) are modularized, reflecting common best practices in web app architecture.
Architectural Patterns & Key Design Principles
• Separation of Concerns:
• Distinct responsibilities are maintained for the frontend (presentation/UI) and backend (business logic & API layer).
• MVC (Model-View-Controller) in the Backend:
• Although simplified, the backend organizes code in a structure typical of MVC: controllers handling HTTP requests, configuration handling application-wide settings, and (likely) service/model classes managing data.
• Component-based Architecture in the Frontend:
• The React application is built using individual components (e.g., BuildingCard, ReportingForm, Sidebar) that encapsulate specific UI functionalities.
• Real-time Nature:
• While not explicitly using real-time technologies like websockets, the web app is designed to update study locations based on current reports, hinting at either polling or a dynamic refresh mechanism.