How modern-agile-team/8term-coko-front works
Main Components
• Frontend Application Shell: This includes the entry point (main.tsx), the router configuration (src/route/Router.tsx), and the global styles (src/style).
• Feature Modules: The project is organized into clear “features” directories (auth, error, intro, learn, profile, progress, quest, quiz, ranking, store, and user). Each feature typically contains submodules like APIs, queries/services, UI components, hooks, and types.
• Shared/Common Components: The common layout and UI components under src/common, such as Header, MenuBar, Modal, Loader, and others that are reused across pages.
• API & State Management: Components responsible for network communication (using Axios defined in src/axios) and data fetching/caching (via @tanstack/react-query). Additionally, state management is handled with Zustand, with store-related code found in src/store.
• Routing & Page Layouts: The pages directory contains distinct pages (login, intro, quest, quiz, ranking, store, etc.) that are tied together via the router.
• Build & Configuration: The configuration files (Vite config, Dockerfile, GitHub actions, ESLint, Prettier, tsconfig files) that give insight into the build pipeline and development environment.
Relationships and Interactions
• Flow from the Application Shell to Page Components:
• The App (src/App.tsx) integrates the Router (src/route/Router.tsx), which then loads various pages (inside src/pages) based on user navigation.
• Within Each Page, Demonstrate the Composition:
• Data Fetching and State Management:
• From the UI components, show calls to the API layer (using the Axios instance and specific API functions placed in the features’ apis.ts files).
• Shared Utilities and Common Components:
• Components from various features to common UI elements and utility functions (under src/common and src/utils).
Architectural Patterns and Design Principles
• Modular Feature-Based Structure:
• The clear separation of functionality into “features” folders follows a domain-driven design which makes it easy to spot where functionality lives and how it is organized.
• Separation of Concerns:
• Distinct directories for API calls, UI components, hooks, and even style-related files under each feature demonstrate clear layering.
• Client-Side Routing:
• The use of React Router (as seen in src/route) shows that the application is structured around different views/pages that interact via navigation logic.
• State Management:
• The combination of React Query (for server state) and Zustand (for local/global state) emphasizes a deliberate split between asynchronous data retrieval and app-level state management.