How ana-coahuila/metafit-application works
METAFIT is a React Native fitness and nutrition app. Users register or sign in, then enter tabbed screens for a dashboard, personalized plan, recipes, progress, and profile management. The shared auth context persists tokens and communicates with the authentication API; plan generation and event-based plan adaptation also call backend services. The supplied excerpts confirm navigation, authentication, profile updates, and selected plan requests. Other screen behavior is not detailed, so their internal data flows are omitted.
Main entry points: TabNavigator.tsx Feature tabs · styles Screen styles · AuthContext.tsx Auth state · login.tsx Login
Components 19
App shell
- App entry
App.tsx - Auth navigation
src/navigator/AuthNavigator.tsx - Feature tabs
src/navigator/TabNavigator.tsx
Identity
- Login
src/auth/login.tsx - Registration
src/auth/register.tsx - Auth state
src/context/AuthContext.tsx
Fitness features
- Dashboard
src/screens/Dashboard.tsx - Meal and exercise plan
src/screens/Plan.tsx - Recipes
src/screens/Recipe.tsx - Progress
src/screens/Progress.tsx - Profile
src/screens/Profile.tsx
Shared UI
- Button
src/components/Button.tsx - Input
src/components/Input.tsx - Screen styles
src/styles - Domain types
src/types/types.ts
Other components
- App user
- Auth service
- Plan backend
- Adaptation service
Connections 30
- App user → App entry: opens
- App entry → Auth state: provides auth
App.tsx - App entry → Auth navigation: renders
App.tsx - Auth navigation → Login: routes to
src/navigator/AuthNavigator.tsx - Auth navigation → Registration: routes to
src/navigator/AuthNavigator.tsx - Auth navigation → Feature tabs: routes to
src/navigator/AuthNavigator.tsx - Login → Auth state: calls login
src/auth/login.tsx - Registration → Auth state: calls register
src/auth/register.tsx - Auth state → Auth service: auth requests
src/context/AuthContext.tsx - Feature tabs → Dashboard: routes to
src/navigator/TabNavigator.tsx - Feature tabs → Meal and exercise plan: routes to
src/navigator/TabNavigator.tsx - Feature tabs → Recipes: routes to
src/navigator/TabNavigator.tsx - Feature tabs → Progress: routes to
src/navigator/TabNavigator.tsx - Feature tabs → Profile: routes to
src/navigator/TabNavigator.tsx - Profile → Auth state: updates account
src/screens/Profile.tsx - Meal and exercise plan → Plan backend: generates plan
src/screens/Plan.tsx - Meal and exercise plan → Adaptation service: adapts plan
src/screens/Plan.tsx - Login → Input: renders
src/auth/login.tsx - Login → Button: renders
src/auth/login.tsx - Registration → Input: renders
src/auth/register.tsx - Registration → Button: renders
src/auth/register.tsx - Login → Screen styles: uses styles
src/auth/login.tsx - Registration → Screen styles: uses styles
src/auth/register.tsx - Dashboard → Screen styles: uses styles
src/screens/Dashboard.tsx - Meal and exercise plan → Screen styles: uses styles
src/screens/Plan.tsx - Profile → Screen styles: uses styles
src/screens/Profile.tsx - Progress → Screen styles: uses styles
src/screens/Progress.tsx - Recipes → Screen styles: uses styles
src/screens/Recipe.tsx - Auth state → Domain types: uses user type
src/context/AuthContext.tsx - Recipes → Domain types: uses recipe types
src/screens/Recipe.tsx