How nghiaxhh/boom works
Main Components
• Entry Point & Bootstrapping:
• App component (src/App.js) which acts as the central container.
• UI Structure:
• Layouts: Identify different layout components (e.g., “AppLayout”, “AuthLayout”, “MainLayout”) in the “src/layouts” directory. These manage the overall page structure and are often used by pages depending on user state (authenticated or not).
• Pages: Represent each major page (e.g., “Authentication”, “HomePage”, “PointSystem”, “Rewards”, “UserInfo”, “PageNotFound”, “RootPage”). Each page might compose several child components.
• Assets & Styling: Group directories like “public” (static HTML and manifest files), “src/assets” (images), “src/styles” (CSS/SCSS, Tailwind config file). These supply static resources and global styling.
• State Management:
• “src/store” module to highlight centralized state management. Note the “commonSlice.js” and “store.js”, which indicates a Redux slice implementation or similar.
• Routing & Navigation:
• “src/routes” which include route constants and route definitions. This layer handles navigation between the different pages and layout components.
• Services & Helpers:
• Modules like “src/services” (AuthServices, FileServices, Statistics, UserServices, apiRouter.js) to illustrate the API or business logic interactions.
• The “src/helper” directory contains constants and utility functions, which support various parts of the application.
• Hooks:
• “src/hook” directory (e.g., useQueryMe) as part of the custom hook system to interact with the state or perform side effects.
Relationships & Interactions
• Data Flow:
• Start from “index.js” where ReactDOM renders the App. The App component then loads the routing component which directs users to various pages based on the URL.
• Layout components wrap around page components, providing common UI framing (like navigation bars in “MainLayout/Navbar.jsx”).
• Each page uses UI components (from “components”) to render specific parts of the view. Pages might also invoke custom hooks and call service APIs.
• API & Service Integration:
• Utility Functions:
• That helper functions are used across components to maintain consistency (e.g., managing constants, data formatting, etc.)
Architectural Patterns & Design Principles
• Component-based development: Clearly indicate that UI is built from small, reusable pieces.
• Separation of Concerns: Illustrate how layouts, pages, components, services, and store are kept in separate modules.
• Use of Hooks: Represent the custom hooks acting as intermediaries to abstract logic from presentation components.