How valen-dasilva/frontend_grupo3_desarrolloapps1 works
1. Overall shape
- This is an Expo + React Native + TypeScript app using Expo Router file-based navigation.
- The repo is split between the router layer in app/ and the actual feature implementation in src/.
- The app appears to be a travel itinerary app with authentication, itinerary discovery, favorites management, preferences, and profile settings.
2. Navigation and route boundaries
- app/_layout.tsx and app/(tabs)/_layout.tsx define the top-level navigation structure.
- The (tabs) group contains the main authenticated areas: home, explore, favorites, and profile.
- Nested route groups like app/(tabs)/(favorite) and app/(tabs)/inicioApp, explorarApp, perfilApp separate deeper screens from the top-level tab screens.
- The files in app/ are mostly thin route entry points that delegate to src/screens/....
3. Feature areas
- Auth: app/login.tsx, app/register.tsx, and src/screens/auth/* handle sign-in and registration.
- Home: src/screens/home/* contains preferences and recommendations flows.
- Explore: src/screens/explore/* covers browsing itineraries and itinerary detail.
- Favorites: src/screens/favorites/* handles saved itineraries, editing, and activity modification.
- Profile: src/screens/profile/* handles profile viewing, edit profile, and password change.
4. State and app-wide context
- src/context/AuthContext.tsx is the core authentication boundary; it likely owns logged-in user state and session transitions.
- src/context/ThemeContext.tsx handles visual theme mode across the app.
- These contexts feed the screen layer and likely determine whether the user is routed to auth or the tabbed app shell.
5. Data access and backend integration
- src/services/api.ts is the base API integration point.
- Feature services like authService.ts, userService.ts, itinerarioService.ts, and favoritosService.ts isolate backend calls by domain.
- src/services/storage.ts and itineraryStorage.ts handle persistence, suggesting a local offline or cached layer in addition to remote API access.
- src/services/queryClient.ts indicates use of a client-side query/cache layer, likely to keep server state consistent across screens.
6. Domain-specific data flow
- The app centers around itineraries and favorites.
- Explore screens fetch itinerary data, show details, and allow favoriting.
- Favorites screens read saved itineraries, drill into itinerary info, and support editing itinerary activities.
- Home preferences likely influence recommendation output, creating a flow from user inputs to itinerary suggestions.
7. Hooks as feature orchestration
- useFavoritos.ts, useFavoriteToggle.ts, and useItinerarioDetalle.ts encapsulate reusable feature logic and data loading.
- These hooks sit between UI and services, so screens remain relatively thin and declarative.
- This makes the architecture more “screen + hook + service” than “screen talks directly to API”.
8. Component organization
- src/components/common/ contains shared UI primitives used across the app: headers, buttons, badges, alerts, bottom navigation, offline indicator, and reusable card patterns.
- Feature folders under src/components/Explorar, Preferencias, Recomendaciones, and favorites hold screen-specific presentation components.
- This separation suggests a clean boundary between shared design system pieces and workflow-specific components.
9. Favorites editing workflow
- The favorites area has the richest internal structure, with dedicated components for itinerary cards, edit modals, editable activity cards, and activity creation.
- The edit flow is split across ItineraryEditScreen, EditActivityScreen, and components under src/components/favorites/itinerary_edit.
- This implies a multi-step interaction model: select itinerary, inspect it, edit activities, confirm changes.
10. Preferences and recommendations flow
- src/screens/home/PreferencesScreen.tsx and RecommendationsScreen.tsx represent a funnel from user preference selection to recommendation results.
- Supporting components such as destination input, date range selector, calendar, province selector, and category grid suggest a structured preference form.
- The recommendations screen uses dedicated header/empty-state components, indicating result-list behavior with explicit empty/loading-style states.
11. Visual and UI infrastructure
- Styles are split into *.styles.ts files next to many components and screens, indicating a style module pattern rather than inline-heavy styling.
- Constants in src/constants/ centralize colors, fonts, icons, paddings, and category metadata, which helps keep the UI consistent.
- src/components/SplashScreen.tsx, AuthLayout.tsx, and HeaderLogo.tsx support shared app-shell presentation.
12. Cross-cutting concerns
- src/components/common/OfflineBadge and related storage/query pieces suggest the app is designed to handle limited connectivity or cached state.
- src/screens/profile/passwordValidation.ts and its tests show that validation logic is kept near the profile feature, not embedded in UI only.
- Coverage and test files are present for multiple components, indicating the architecture is already decomposed enough for unit-level testing.
13. Diagramming takeaway
- A good architecture diagram should show:
- Expo Router/app shell at the top,
- Contexts for auth and theme spanning the app,
- Screens grouped by feature,
- Hooks as the orchestration layer,
- Services/storage/query client as the data layer,
- Shared/common components as a reusable UI layer.
- The main data flow is: user interaction in a feature screen → hook logic → service/storage/API → state/cache update → UI refresh.
Main entry points: _layout.tsx Tabs layout · itinerarioService.ts Itinerary service · favorites Favorites UI · api.ts API client
Components 32
Router
Expo Router navigation and route entrypoints
- App layout · Root Expo Router layout and app-wide shell
app/_layout.tsx - Tabs layout · Main tab navigator and nested route structure
app/(tabs)/_layout.tsx
State
Global app context and cache boundaries
- Auth context · Authentication state and session transitions
src/context/AuthContext.tsx - Theme context · Theme mode and color-scheme coordination
src/context/ThemeContext.tsx
Screens
Feature screens implemented under src/screens
- Login · Sign-in flow screen
src/screens/auth/LoginScreen.tsx - Register · Account creation screen
src/screens/auth/RegisterScreen.tsx - Home · Authenticated landing screen
src/screens/home/HomeScreen.tsx - Preferences · Travel preference collection screen
src/screens/home/PreferencesScreen.tsx - Recommendations · Itinerary recommendation results screen
src/screens/home/RecommendationsScreen.tsx - Explore · Itinerary discovery and browsing screen
src/screens/explore/ExploreScreen.tsx - Itinerary detail · Detailed itinerary view in explore
src/screens/explore/ExploreItineraryDetailScreen.tsx - Favorites · Saved itineraries overview
src/screens/favorites/FavoritesScreen.tsx - Saved detail · Favorite itinerary detail view
src/screens/favorites/ItineraryInfoScreen.tsx - Edit itinerary · Favorite itinerary editing screen
src/screens/favorites/ItineraryEditScreen.tsx - Edit activity · Activity-level editor for favorite itineraries
src/screens/favorites/EditActivityScreen.tsx - Profile · User profile overview screen
src/screens/profile/ProfileScreen.tsx - Edit profile · Profile editing screen
src/screens/profile/EditProfileScreen.tsx - Change password · Password update screen
src/screens/profile/ChangePasswordScreen.tsx
Hooks
Reusable feature orchestration hooks
- Favorite hooks · Favorite toggle and favorites data orchestration
src/hooks/useFavoriteToggle.ts - Itinerary hook · Itinerary detail loading and composition
src/hooks/useItinerarioDetalle.ts - Favorites hook · Saved itineraries data access and refresh logic
src/hooks/useFavoritos.ts
Data
API, storage, and query client services
- API client · Shared HTTP entry point
src/services/api.ts - Auth service · Login and registration backend calls
src/services/authService.ts - User service · Profile and user account backend calls
src/services/userService.ts - Itinerary service · Itinerary discovery and detail backend calls
src/services/itinerarioService.ts - Favorites service · Saved itinerary backend operations
src/services/favoritosService.ts - Storage · Shared persistence abstraction
src/services/storage.ts - Itinerary cache · Itinerary-specific persisted storage
src/services/itineraryStorage.ts - Query client · Client-side server-state cache configuration
src/services/queryClient.ts
UI
Shared components and feature-specific presentation
- Shared UI · Reusable app shell and common presentation components
src/components/common - Feature UI · Feature-specific screens and workflow components
src/components/Preferencias - Favorites UI · Favorites cards, edit modal, and activity editors
src/components/favorites
Connections 39
- App layout → Tabs layout: navigates · Root layout delegates into the main tab shell
- App layout → Auth context: provides · Authentication state is available across the app
- App layout → Theme context: provides · Theme state wraps the application UI
- Tabs layout → Home: routes · Tab entry to the home area
- Tabs layout → Explore: routes · Tab entry to itinerary browsing
- Tabs layout → Favorites: routes · Tab entry to saved itineraries
- Tabs layout → Profile: routes · Tab entry to user profile
- Login → Auth service: uses · Sign-in calls the auth backend
- Register → Auth service: uses · Registration calls the auth backend
- Home → Preferences: starts · Home leads into preference collection
- Preferences → Recommendations: feeds · Preferences generate recommendation results
- Preferences → Feature UI: renders · Preference form uses specialized inputs and selectors
- Recommendations → Itinerary service: queries · Recommendation results depend on itinerary data
- Explore → Itinerary service: queries · Browse screen loads itinerary listings
- Explore → Favorite hooks: toggles · Explore can favorite and unfavorite itineraries
- Itinerary detail → Itinerary hook: loads · Detail view is orchestrated by the itinerary hook
- Itinerary detail → Favorite hooks: toggles · Detail view can favorite the itinerary
- Favorites → Favorites hook: loads · Saved itineraries are fetched through a hook
- Favorites → Favorites UI: renders · Favorites overview uses itinerary cards and empty states
- Saved detail → Favorites service: reads · Saved detail pulls favorite itinerary data
- Saved detail → Favorites UI: renders · Detail view uses saved-itinerary presentation components
- Edit itinerary → Favorites UI: renders · Edit itinerary workflow relies on edit cards and modal UI
- Edit activity → Favorites UI: renders · Activity editor uses the editable activity form components
- Profile → User service: reads · Profile data comes from the user domain service
- Edit profile → User service: updates · Profile edits persist through the user service
- Change password → User service: updates · Password changes go through the user service
- Login → Shared UI: renders · Auth screens reuse shared buttons, inputs, and layout pieces
- Favorites hook → Favorites service: uses · Favorites hook coordinates favorite persistence
- Favorite hooks → Favorites service: uses · Favorite toggles depend on favorites backend operations
- Itinerary hook → Itinerary service: uses · Itinerary detail hook composes itinerary data
- Auth service → API client: builds on · Auth requests share the common API client
- User service → API client: builds on · User requests share the common API client
- Itinerary service → API client: builds on · Itinerary requests share the common API client
- Favorites service → API client: builds on · Favorite requests share the common API client
- Auth service → Storage: persists · Auth state likely relies on persisted session storage
- Itinerary service → Itinerary cache: caches · Itinerary data has a dedicated local persistence layer
- Query client → API client: caches · Query client sits in front of server requests
- Feature UI → Shared UI: composes · Feature forms build on shared UI primitives
- Favorites UI → Shared UI: composes · Favorites workflow components use the shared component layer