How hugobordier/meow works
Main Components
• Entry Point & Routing Layer: The project’s entry files are in the app directory with the main index.tsx and global _layout.tsx files. The file-based routing clearly segments the features into groups like authentication ((auth)), discussions ((discussion)), and home screens ((home)).
• Feature Modules:
• Authentication: Contains sign-in, sign-up, forgot-password pages, and an id_verification submodule for additional checks (e.g., ID card, insurance, RIB verification).
• Discussion Flow: Includes camera and chatScreen files.
• Home Screens: There are different layouts for petsitters and general users.
• Services & Business Logic: The services directory contains API integration and authentication service files. Additionally, context (e.g., AuthContext, ToastContext) and hooks (e.g., useAuth, useThemeColor) offer state management and utility functions.
• Configuration and Build Tools: Includes configuration files like tailwind.config.js, babel.config.js, metro.config.js, tsconfig.json, and scripts for project reset.
Relationships & Data Flow
• The application starts via the Expo entry point (app/index.tsx) and then routes users based on the URL paths determined by file-based routing.
• Each feature module (auth, discussion, home) has its own localized layout and screens. They may interact by transitioning between screens and passing state.
• Global contexts (e.g., AuthContext) are used by components throughout the app to manage user state and notifications (ToastContext), tying into the service layer.
• The services layer (api.ts, auth.service.ts) is used by various components to interact with backend APIs; these interactions support operations such as user authentication and other related data flows.
• Reusable hooks (like useAuth and useColorScheme) are integrated into UI components for state and theme management, enhancing the interactive experience.
• Assets and components are referenced by many screens for consistent styling and functionality.
Architectural Patterns & Technologies
• File-based Routing: Leveraged by the “app” directory where folders (and even parenthesized route groups such as (auth)) offer a clear structure.
• Component-Based UI: React components are used for modular, reusable UI (e.g., AnimatedButton, header.tsx, various layout files).
• Context API and Custom Hooks: These provide state management and side-effect logic without global state libraries, making the app more maintainable.
• Service Layer Abstraction: Modular service files separate API calls and business logic from the UI.
• Styling: Uses Tailwind (with a tailwind.config.js file) and possibly NativeWind for styling in a React Native environment.
• Expo & React Native: The project takes advantage of the Expo ecosystem for app development and deployment.
• Branch out to a “Routing” component node that uses file-based routing to connect to each major module:
• “Auth Module”: Highlight its internal structure with its own submodule (id_verification).
• “Discussion Module”: Illustrate screens like camera and chatScreen.
• “Home Module”: Show differentiation for different home views.
• A “Global State & Hooks” node to every feature module to illustrate shared context (AuthContext, ToastContext) and common hooks (useAuth, useThemeColor).
• An “Assets & UI Components” node that is referenced by multiple modules/screen layouts.
• A “Configuration/Build Tools” layer that shows the supporting files like tailwind.config.js, metro.config.js, etc.