How nirajanmahato/revivereads-frontend works
Project type and purpose
• This is a single-page, full-stack-style front-end application built with React and Vite. It serves as a marketplace for books with user authentication, admin dashboards, real-time messaging, notifications, and product listing features. Although the repository only contains front-end code, it clearly depends on external back-end APIs (for auth, data persistence, messaging) and a WebSocket service for real-time updates.
File structure
• Top-level:
• public/ contains static assets (fonts, images, logos) served by the web server or CDN.
• src/ is the React application. Within src/:
– core/ separates public (unauthenticated) flows under core/public from private (authenticated/admin) flows under core/private.
– components/ holds shared UI components (Navbar, Footer, Modals, Map).
– context/ provides React Context providers (UserContext for auth state, SocketContext for real-time, NotificationContext).
– store/ and zustand/ implement client-side state management for auth and conversations.
– hooks/ define custom hooks that wrap API calls (useLogin, useBooks, useSendMessage, etc.).
• config files (vite.config.js, tailwind.config.js, eslint.config.js, playwright.config.js) define build, linting, styling, and end-to-end testing setups.
• Patterns:
• The “core” folder suggests an MVVM or feature-based modular structure.
• Routes are guarded via AdminRoute, ProtectedRoute, PublicRoute.
• Real-time via SocketContext.
• API interactions encapsulated in hooks and state stores.
Extract insights from README
• The README only describes the baseline React+Vite template. It does not detail the domain-specific architecture. All domain details must come from the file tree.