How manuelpacheco108/mercado-libree works
Project Type and Purpose
• This is a React Native cross-platform mobile client (iOS + Android).
• It provides browsing, searching, and purchasing features for a MercadoLibre-like marketplace.
• It uses React Navigation (Stack + Drawer), Context API for state, local data modules, and calls out to external REST APIs.
Main Components
a. Presentation Layer (JS)
– Screens (Home, Category, ProductDetail, Cart, Profile, Login, Register, etc.)
– Reusable Components (Cards, Buttons, NavBar, DrawerNavigation)
– Styles (globalStyles, per-component style modules)
b. Navigation Layer
– Stack Navigator
– Drawer Navigator
– gesture-handler and reanimated plugins
c. State/Business Logic Layer
– React Context Providers (AppDataContext, UserContext)
– Local “database” module (src/bd/Products.js) or AsyncStorage
d. Data Layer
– Remote REST API (MercadoLibre endpoints)
– Network module (fetch/axios calls from context or directly in screens)
e. Native Runtime & Build
– JavaScript bundle (Metro bundler)
– React Native bridge
– Android (Gradle project, MainActivity.kt, AndroidManifest.xml)
– iOS (Xcode project, AppDelegate.mm, Info.plist)
Relationships & Data Flows
• User interacts with a Screen → dispatches an action into Context → Context reads/writes local data or invokes network fetch → updates Context state → Screen re-renders → if it’s a purchase, Context triggers API call to payment endpoint.
• Navigation events flow from UI components to React Navigation stacks/drawers.
• JS code runs in Metro-served JS runtime, bridged to native modules (gesture-handler, SafeArea, reanimated).
• Native projects wrap the JS bundle and expose modules to JS via the React Native Bridge.
Architectural Patterns & Design Principles
• Component-based UI (React components + hooks)
• Context API for shared state (avoiding prop drilling)
• Modular folder structure (bd, components, context, navigation, screens, styles)
• Declarative navigation (Stack/Drawer)
• Separation of concerns: UI vs State vs Data vs Native runtime
Final Checklist
– Callouts for critical libraries and config files.
– Native platform boundaries clearly drawn around JS runtime.