How nitin272/e_commerce_capstone works
Main Components
• Frontend (Client):
• Built with modern React (using Vite as the build tool) and organized under the “client/” directory.
• Contains multiple subcomponents like Admin views (Dashboard, ProductList, user management), public pages (Login, Signup, Home, Profile, etc.), and specialized modules including validations, animations, and state management using Zustand.
• Uses libraries and utilities for Firebase integration (for messaging and potentially notifications) and custom hooks for message handling.
• Static assets (CSS, animations, images) used for UI/UX improvements.
• Backend (Server):
• Built with Node.js (typically using Express.js given the structure of controllers, models, routes, and middleware).
• Controllers for handling message, product, and user-related operations.
• Models mapping to database entities such as User, Product, Conversation, and Message; note that the README specifies MongoDB usage (MONGO_URI).
• Routes dedicated to authentication, messages, and product operations.
• Middleware for security functionalities including token verification, role-based access (admin checking), file management, and Firebase Cloud Messaging handling.
• Util modules for integrating external services like Cloudinary for image management, NodeMailer for sending emails, and Firebase Admin for server-based Firebase operations.
• External Services and Integration Points:
• Authentication services (Google OAuth, Email, OTP).
• Cloud services (Cloudinary for image storage, Firebase for messaging and notifications).
• Possibly a payment gateway, given the secure payment integration mentioned in the README.
• Database – likely MongoDB, as implied by the configuration.
Relationships & Interactions
• Submission of form data from client-side pages to backend APIs.
• Backend response (data retrieval, success or error messages) returning to the client.
• Communication with external services (e.g., when the server contacts Cloudinary or Firebase).
Architectural Patterns & Design Principles
• Separation of concerns: front-end versus back-end layers.
• MVC pattern on the server-side: Models, Views (if server-rendered content exists) and Controllers, though mostly the API controller logic is encapsulated.
• Use of middleware for authentication, authorization, and additional pre-processing of requests.
• Client-side state management using Zustand.
• Modularity: Clearly split directories for controllers, models, middleware, routes, and utilities, which favors a microservice-like design even within a single server.
Relevant Technologies & Frameworks
• Frontend: React, Vite, Tailwind CSS (as indicated by tailwind.config.js), Zustand, Firebase integration.
• Backend: Node.js, Express (inferred from directory structure including controllers/models/routes), MongoDB (environment variable MONGO_URI), Cloudinary, NodeMailer, Firebase Admin, Socket (real-time messaging feature).