React¶
React is the UI framework used for building the single-page application. The app uses functional components, React Router for navigation, and a component hierarchy that follows an atoms/molecules pattern.
Key aspects in this project¶
- Entry point:
app/frontend/src/index.tsxmounts the React app and wraps it in a Material UIThemeProviderand a customConfirmationProvider. - Routing:
react-router-domis used for client-side routing — routes and pages are implemented underapp/frontend/src/pages. - Components:
app/frontend/src/componentsis organized intoatomsandmolecules(small reusable UI elements and composed widgets). Examples: - Atoms:
Button,TextField,Loader,GlobalDialog,GlobalConfirmationDialog,DropdownSelection, etc. - Molecules:
Sidebar,DashboardLayout,CalendarTable,EventCreationDialog, etc. - State management: lightweight stores implemented with
zustandlive underapp/frontend/src/stores(e.g.EventsStore.tsx,RoomsStore.tsx,useAuthStore.tsx). These encapsulate API interactions and local state. - API:
app/frontend/src/helpers/ApiHelper.tsxcentralizes HTTPS calls to the backend API (configured viaVITE_API_URLinapp/frontend/src/config.tsx).
Testing¶
- Unit tests use
vitestand testing-library for React (tests are underapp/frontend/src/tests).