How oks110/ssf works
This project is a monorepo for a React-based shopping mall service that includes both a customer-facing front end (client) and a Node.js/Express backend (server). The overall system is designed to support features such as product browsing, cart management, checkout (with KakaoPay integration), real‑time notifications through WebSocket, and a separate admin page for store management.
Key components
• Client (Frontend):
• Built with React, organized under the "/client" directory.
• Uses React Router for navigation, Context API and localStorage for state management.
• Contains UI components (found in client/src/components and client/src/commons), pages (e.g., Home, DetailProducts, Login, Signup, Carts, Order, Person), and hooks (client/src/hooks) that drive business logic.
• Integrates external services like KakaoPay API and handles real-time communications with WebSocket.
• Server (Backend):
• Found under the "/server" directory.
• Uses Node.js with Express to implement a RESTful API.
• Organized into controllers (business logic per feature), routers (defining endpoints), and repositories (database interactions).
• Implements JWT-based authentication, integrates with MySQL (see SQL files in the "db" folder), and manages real-time WebSocket connections.
• Database:
• MySQL is used for data persistence, with SQL scripts provided in the "db" directory for orders, products, customers, reviews, etc.
• External Services:
• KakaoPay API (for payment processing).
• WebSocket for real-time functionality (e.g., delivery updates, order notifications).
• Assets & Deployment:
• There are client assets (images, sample JSON data) and deployment artifacts for both customer and admin pages.
• The README includes deployment URLs for both customer and admin pages, indicating production environments hosted (e.g., on AWS S3).
Relationships and interactions
• The Client interacts with the Server through RESTful API calls (e.g., for login, fetching product details, cart and order management).
• The Client receives real-time updates via a WebSocket connection from the Server.
• The Server interacts with the MySQL database for CRUD operations, driven mainly by the repository layer.
• External interactions include the KakaoPay payment gateway (invoked by the Client via the Server) and WebSocket notifications from the admin side that inform the Client on state changes (e.g., delivery updates).
Architectural patterns and design principles
• Separation of concerns: Client and server sides are maintained separately within a monorepo.
• MVC-like structure on the backend: Controllers, routers, and repositories clearly separate request handling from business logic and data access.
• Component-based design on the frontend: React components, contexts, and hooks are organized to provide modular, reusable UI and state management.
• API-driven integration: The system uses RESTful endpoints to manage data flow between the client and server.
• Real-time data flow: WebSocket integration for live updates reflects an event-driven design principle.