How teojiesern/shuttlestop-fe works
Project Type and Purpose
• This is a frontend-only, single page application focused on multiple domains such as customer interactions, checkout processes, CIAM (Customer Identity & Access Management), seller center functionalities, marketing, and the main landing experience.
• The codebase is structured around modular features, where each domain (e.g., checkout, ciam, customer, marketing, sellerCenter) contains its own data repository implementations, UI views, components, hooks, navigation, and modals.
Analyzing the File Structure
• Top Level: Files such as index.html, package.json, and configuration files (e.g., .eslintrc.json, .prettierrc.json) indicate a standard React/Vite project.
• src Directory: Contains an “app” folder which is broken out by domain-specific subdirectories (checkout, ciam, customer, main, marketing, sellerCenter) and a “platform” folder.
• Each module subfolder further divides into layers such as data (repositories and static data), navigation (screens dedicated to routing within the module), view (presentation components and screens), modal (pop-up UI components), hooks (custom React hooks for business logic), and sometimes styles.
• The “platform” folder gathers cross-cutting concerns such as shared layouts, global styling, theming, network configuration, common components (headers, footers, modal managers), contexts, and utilities. This acts like a “base layer” that reinforces the overall design and functionality across the various domain modules.
Key Components
a. Main Application Container:
• Overall application as “ShuttleStop-FE (React SPA)” which is orchestrated by Vite.
• That React Router (with components like AuthenticatedRoute and SellerCenterAuthenticatedRoute) routes user navigation between modules.
b. Domain-Specific Modules:
• Data Layer: Repositories and data sources (e.g., CheckoutRepositoryImpl.js, CIAMRepositoryImpl.js)
• Navigation Layer: Screens and routes (e.g., CheckoutScreens.jsx, CustomerScreens.jsx)
• View / UI Layer: Presentation components (e.g., CheckoutScreen, Login, Signup, etc.), modals, and components
• Hooks: Custom hooks that handle the business logic (e.g., useOrder.js, useLogin.js)
c. Platform / Shared Components:
• A central “Platform” component that includes shared components (Header, Footer), context providers (CustomerInfoContext, SellerInfoContext), layouts (AuthLayout, MainLayout, SellerCenterLayout), global styles, animations, and network configuration.
• That shared cross-cutting utilities like styling (globalStyles, theme) are provided by this layer.
Relationships and Interactions
• All modules interact with the shared “Platform” for global state management via Contexts, theming, and common UI components.
Architectural Patterns and Technologies
• Modular design and separation of concerns: Each module is self-contained with its own UI, business logic, and data handling.
• Use of Repository Pattern: All backend interactions seem encapsulated in repository implementations.
• Component-Driven UI: Reusable components, layouts, and modals provided by both modules and shared in the platform.
• Integration with third-party libraries: Material-UI for design, Styled Components for styling, React Router for navigation, and tooling support (ESLint, Prettier, Husky) for developer experience.