How kimchanho97/sunsuwedding_fe works
Main Components
• Frontend Application: Representing the overall React SPA. This includes:
• The “public” folder (manifest, service worker, PWA offline page) that enables PWA and mobile-like features.
• The “src” directory that contains all the core source code.
• UI / Presentation Layer: Include:
• Layouts (e.g., MainLayout, RequiredAuthLayout, etc.)
• Pages (organized under /pages like Chat, Login, Portfolio Detail, Quotation, Review, etc.)
• Components grouped by feature (chat, portfolio, review, etc.)
• Common components (atoms, modals, bottom sheets) that provide shared UI/UX.
• APIS & Data Layer:
• The APIs folder (modules for chat, favorite, payments, portfolio, quotation, review, user) which encapsulates interactions with backend REST endpoints.
• Integration with React Query for data fetching and caching.
• Global State Management:
• Redux store and slices (e.g., userSlice, bottomSheetSlice) to manage application state.
• Redux Persist ensuring state persistence.
• Custom Hooks & Utils:
• Several hooks (e.g., usePreventRefresh, useDefaultErrorHandler, useOpenBottomSheet) that control browser behavior and UI state.
• Utilities for common constant and conversion logic.
• External Services & Integrations:
• Payment Integration: Toss Payments integrated for transaction processing.
• File/Image Handling: Client-side image compression (using compressorjs) and direct uploads to AWS S3.
• Third-party libraries: Axios (for API requests), React Router (client routing), Tailwind CSS (styling), and Material UI.
Relationships and Interactions
• Data Flow:
• The UI components trigger actions (e.g., submitting a portfolio or initiating a chat) which then call API methods.
• API methods (in the “src/apis” folder) invoke backend endpoints and return results managed by React Query.
• External Integration Flow:
• File Upload flow: Image compression on client → Form data submission → Direct upload to S3.
• UI State & Feedback:
• Global bottom sheets and modals (managed via Redux and custom hooks) present error, confirmation and informational UIs triggered by various events.
Architectural Patterns
• Component-Based Design & Separation of Concerns:
• Clearly split into presentation (components), routing/layouts, business logic (API, hooks, utils), and state (Redux).
• PWA and Responsive Design:
• Leverage service worker and manifest from the “public” folder.
• Transactional Integrity:
• Payment processing and error handling strategies are built with transaction based operations (as discussed in the README).
Relevant Technologies and Libraries
• React (for rendering UI)
• Redux and Redux Persist (global state management)
• React Query (data fetching and caching)
• React Router (routing between pages)
• Tailwind CSS & Material UI (styling)
• Axios (network requests)
• CompressorJS (image compression)
• Toss Payments & AWS S3 (external services)