How minhwuan1309/techstore works
Major Components
• Frontend Application: Built with ReactJS. It is clearly structured into pages (client, admin, public), components (e.g., headers, footers, products, charts), state management (Redux slices for products and user), and various utilities. The frontend is responsible for displaying the UI on both client and admin sides.
• Backend API Server: Implemented with Express.js. Within the backend, you have a clear separation of controllers (handling business logic), models (Mongoose schemas for Product, User, Order, etc.), routes (mapping endpoints), services (business logic that may be shared), and utilities/middleware (JWT, error handling, socket configurations).
• Database: MongoDB is used for persistent data storage (customers, orders, products, blogs). It connects through Mongoose.
• Cloud Services: Cloudinary is integrated for media (image) storage; MongoDB Atlas for hosting the database; and external APIs like TinyMCE for rich text editing.
• Real-time Communication: Socket.IO is integrated on both frontend and backend to support chat functionality.
• Security & Authentication: Uses JWT (access/refresh) with middleware to enforce role-based access (admin, member).
Relationships & Data Flow
• JWT tokens are exchanged during user authentication. This flow should be depicted by showing an authentication process (login) between the frontend and the backend.
• A live chat feature utilizing Socket.IO runs between the frontend’s Socket.IO Client and the backend’s Socket.IO server (configured under backend/config/socket.js). Represent this as a bidirectional communication channel.
• Email notifications are managed via Nodemailer, so you might include a small component for “Email Service,” triggered by backend events.