How mohitnamdev22/shelfsmart-frontend works
Main Components
• Client-Side Application (ShelfSmart Frontend)
• Routing & Page Components:
• Pages: Dashboard, Inventory, Login, Registration, Report, Suppliers, UserActivity – Each representing a separate view of the system.
• UI Components:
• Common components like Navbar, Sidebar, Layout, AIAccordion, and Skeleton which are reused across the pages.
• Assets & Static Files:
• Entry Points & Configurations:
• main.jsx and App.jsx: The starting point of the application and routing configuration.
• Configuration files (tailwind.config.js, vite.config.js, eslint.config.js) that set up project-specific tooling.
Relationships and Interactions
• The user interacts with the application UI (components like Navbar, Sidebar, and various pages).
• The App.jsx file manages routing between the different pages (using React Router).
• Pages communicate with the backend API via an API client (Axios), which uses the base URL defined in the environment variable (VITE_API_URL).
• Shared components (e.g., Layout) wrap pages to provide a consistent look and navigational structure.
• Data flows from the backend (handling inventory, user authentication, reports) into UI components for rendering, while user actions (like login, add/edit inventory) generate API calls.
Architectural Patterns and Design Principles
• Single Page Application (SPA): The application dynamically updates the UI without full page reloads.
• Component-Based Architecture: Components are grouped into reusable UI elements (under “src/components”) and page-specific components (under “src/pages”).
• Separation of Concerns: Clear delineation between static files (public) and application logic (src folder), plus build and configuration files at the root.
• Responsive and Modular Design: Use of Tailwind CSS and components promotes a responsive, modular approach.
Relevant Technologies, Frameworks, and Libraries
• React & React Router for building the SPA and handling routing.
• Vite for rapid development and build tooling.
• Tailwind CSS for styling.
• Axios for API requests.
• Chart.js (via react-chartjs-2) for generating charts in the Dashboard.
• React-Toastify for notifications.
• React-Select for dropdowns and enhanced select elements.
• PapaParse for CSV parsing tasks.