How slightfoot/wow_shopping works
Main Components
• Mobile Application Frontend:
• The “app” directory contains a complete Flutter project with its “lib/app” code and feature modules (e.g., Account, Cart, Home, Login, Wishlist, Product Details, etc.).
• Separate modules are used to build various pages and UI widgets, along with dedicated backend service calls (inside app/lib/backend) that handle API interactions.
• There are two entry points (main_dev.dart, main_prod.dart) to support different environments.
• Backend Server:
• The “server” directory holds the backend application written in Dart. It includes API endpoints for authentication, products, and other services.
• The server uses middleware for exception handling (exception_middleware.dart) and has dedicated API segments (e.g., auth, products) to process mobile client requests.
• There are distinct entry points (main_dev.dart, main_prod.dart) in the server's “bin” directory.
• Shared/Common Library:
• The “common” folder contains shared code—API models, request/response DTOs, and possibly utility functions—that both the mobile app and server can use, ensuring consistency in data definitions.
Relationships and Interactions
• The “common” module acts as a shared dependency. Represent this with a central component that both the mobile app and server link to for data models and API requests/responses.
• In the mobile client, components such as the “features” modules call methods in “backend” services to obtain data (e.g., product listings, authentication results). Represent these internal flows by grouping them under “Frontend – Presentation Layer”, “Business Logic”, and “API Service”.
• The server’s API endpoints and middleware (for authentication, exception handling, etc.) should also display how they process incoming requests and send responses back to the client.
Architectural Patterns and Design Principles
• The project follows a modular pattern – with a clear separation of concerns between feature UI components, business logic (using repository classes), and API services.
• The mobile code uses a widget-based UI and likely an MV* or BLoC-like pattern (even if not explicit, best practices are often followed in Flutter projects).
• The server code illustrates a layered architecture using middleware for cross-cutting concerns (authentication, exception-handing, etc.).
• Environmental configurations (development vs. production) for both the mobile app and server components.
Relevant Technologies
• Flutter framework for cross-platform mobile development.
• Dart language for both mobile and backend (server and common modules).
• Gradle and Xcode configuration files indicate that the application is built to run on Android and iOS respectively.
• Docker support in the “server” folder (Dockerfile) for containerized deployment.