How netrix4/adogtame works
Project type and purpose
• This is a mobile full-stack application built with Expo (React Native + TypeScript) acting as the frontend, while Supabase provides database, authentication and storage services as the backend.
• Its purpose is to connect potential adopters with at-risk dogs and cats via a mobile UI, handle user authentication, fetch/filter animal data, and record user favorites.
File structure
• Top-level files & folders:
• App.tsx / index.ts: application entry points
• Screens/: each “screen” in the navigation stack (Login, Register, Dashboard, Home, Profile, etc.)
• Components/: reusable UI building blocks (AnimalCard, AuthGate, CustomTabBar, etc.)
• hooks/: custom React hooks (useAuth for session management, useFiltroAnimales for data filtering)
• lib/supabase.ts: Supabase client instantiation
• app.json, package.json, tsconfig.json, requirements.txt: config & dependency manifests
• No custom backend code—Supabase is consumed as an external service via its JavaScript SDK.
Extract key architecture details from README
• Requires Expo SDK 52, Supabase JS client, Lodash.
• The app starts with npx expo start, runs on the user’s device/emulator, and communicates directly with Supabase over HTTPS.
Main components and their interactions
a. Mobile App (Expo Client)
• Entry (App.tsx) → sets up navigation and context providers.
• Screens (Screens/) render full‐screen views.
• Components (Components/) render UI pieces within each screen.
b. State & Data Layer (hooks/ & lib/)
• useAuth.ts: manages signup, login, session tokens via supabase.auth.
• useFiltroAnimales.ts: fetches and filters animal records via supabase.from('animals').
• lib/supabase.ts: initializes the Supabase client with URL and anon key.
c. External Service (Supabase)
• Authentication: sign up, login, password reset
• Database: tables for users, animals, favorites
• Storage (optional): images for animals
d. Supporting Tools
• Expo bundler & Metro server
• Third-party libraries (lodash, @supabase/supabase-js)
Architectural patterns & design principles
• Separation of concerns: UI (Screens/Components) vs data logic (hooks) vs service client (lib/supabase).
• Hooks for side effects: data fetching and auth logic is encapsulated in custom hooks for reusability.
• Component composition: atomic UI components (AnimalCard, LoginInputs) are combined in Screens.
Essential details
• Navigation flow if helpful (e.g., Login → Home → Profile).
• How favorites are written back to Supabase (useFiltroAnimales or another hook).