├── assets ├── images │ ├── icon.png │ ├── logo.png │ ├── splash.png │ ├── favicon.png │ ├── react-logo.png │ ├── adaptive-icon.png │ ├── react-logo@2x.png │ ├── react-logo@3x.png │ └── partial-react-logo.png └── fonts │ └── SpaceMono-Regular.ttf ├── babel.config.js ├── services └── api.ts ├── constants └── Colors.ts ├── tsconfig.json ├── types └── data.ts ├── .gitignore ├── store └── data.ts ├── app.json ├── app-example ├── +not-found.tsx ├── (tabs) │ ├── _layout.tsx │ ├── index.tsx │ └── explore.tsx ├── _layout.tsx └── +html.tsx ├── app ├── _layout.tsx ├── index.tsx ├── step │ └── index.tsx ├── create │ └── index.tsx └── nutrition │ └── index.tsx ├── components ├── input │ ├── index.tsx │ └── select.tsx └── header │ └── index.tsx ├── package.json ├── README.md └── scripts └── reset-project.js /assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/icon.png -------------------------------------------------------------------------------- /assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/logo.png -------------------------------------------------------------------------------- /assets/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/splash.png -------------------------------------------------------------------------------- /assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/favicon.png -------------------------------------------------------------------------------- /assets/images/react-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/react-logo.png -------------------------------------------------------------------------------- /assets/images/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/adaptive-icon.png -------------------------------------------------------------------------------- /assets/images/react-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/react-logo@2x.png -------------------------------------------------------------------------------- /assets/images/react-logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/react-logo@3x.png -------------------------------------------------------------------------------- /assets/fonts/SpaceMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/fonts/SpaceMono-Regular.ttf -------------------------------------------------------------------------------- /assets/images/partial-react-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfraga/dietaapp-mobile/HEAD/assets/images/partial-react-logo.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /services/api.ts: -------------------------------------------------------------------------------- 1 | 2 | import axios from "axios"; 3 | 4 | // http://192.168.0.12:3333 /create 5 | export const api = axios.create({ 6 | baseURL: "http://192.168.0.12:3333" 7 | }) -------------------------------------------------------------------------------- /constants/Colors.ts: -------------------------------------------------------------------------------- 1 | 2 | export const colors = { 3 | background: '#0F232C', 4 | white: '#FFF', 5 | green: '#1EB500', 6 | orange: '#F79600', 7 | blue: '#009AD6', 8 | black: '#000' 9 | }; 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo/tsconfig.base", 3 | "compilerOptions": { 4 | "strict": true, 5 | "paths": { 6 | "@/*": [ 7 | "./*" 8 | ] 9 | } 10 | }, 11 | "include": [ 12 | "**/*.ts", 13 | "**/*.tsx", 14 | ".expo/types/**/*.ts", 15 | "expo-env.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /types/data.ts: -------------------------------------------------------------------------------- 1 | interface RefeicoesProps{ 2 | horario: string; 3 | nome: string; 4 | alimentos: string[]; 5 | } 6 | 7 | export interface Data { 8 | nome: string; 9 | sexo: string; 10 | idade: number; 11 | altura: number; 12 | peso: number; 13 | objetivo: number; 14 | refeicoes: RefeicoesProps[]; 15 | suplementos: string[]; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | 13 | # macOS 14 | .DS_Store 15 | 16 | # @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb 17 | # The following patterns were generated by expo-cli 18 | 19 | expo-env.d.ts 20 | # @end expo-cli -------------------------------------------------------------------------------- /store/data.ts: -------------------------------------------------------------------------------- 1 | import { create } from 'zustand' 2 | 3 | export type User = { 4 | name: string; 5 | weight: string; 6 | age: string; 7 | height: string; 8 | level: string; 9 | objective: string; 10 | gender: string; 11 | } 12 | 13 | type DataState = { 14 | user: User; 15 | setPageOne: (data: Omit) => void; 16 | setPageTwo: (data: Pick) => void; 17 | } 18 | 19 | export const useDataStore = create((set) => ({ 20 | user: { 21 | name: "", 22 | age: "", 23 | level: "", 24 | objective: "", 25 | gender: "", 26 | height: "", 27 | weight: "" 28 | }, 29 | setPageOne: (data) => set((state) => ({ user: {...state.user, ...data} }) ), 30 | setPageTwo: (data) => set((state) => ({ user: {...state.user, ...data} }) ), 31 | })) 32 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "mobile", 4 | "slug": "mobile", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/images/icon.png", 8 | "scheme": "myapp", 9 | "userInterfaceStyle": "automatic", 10 | "splash": { 11 | "image": "./assets/images/splash.png", 12 | "resizeMode": "contain", 13 | "backgroundColor": "#ffffff" 14 | }, 15 | "ios": { 16 | "supportsTablet": true 17 | }, 18 | "android": { 19 | "adaptiveIcon": { 20 | "foregroundImage": "./assets/images/adaptive-icon.png", 21 | "backgroundColor": "#ffffff" 22 | } 23 | }, 24 | "web": { 25 | "bundler": "metro", 26 | "output": "static", 27 | "favicon": "./assets/images/favicon.png" 28 | }, 29 | "plugins": [ 30 | "expo-router" 31 | ], 32 | "experiments": { 33 | "typedRoutes": true 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app-example/+not-found.tsx: -------------------------------------------------------------------------------- 1 | import { Link, Stack } from 'expo-router'; 2 | import { StyleSheet } from 'react-native'; 3 | 4 | import { ThemedText } from '@/components/ThemedText'; 5 | import { ThemedView } from '@/components/ThemedView'; 6 | 7 | export default function NotFoundScreen() { 8 | return ( 9 | <> 10 | 11 | 12 | This screen doesn't exist. 13 | 14 | Go to home screen! 15 | 16 | 17 | 18 | ); 19 | } 20 | 21 | const styles = StyleSheet.create({ 22 | container: { 23 | flex: 1, 24 | alignItems: 'center', 25 | justifyContent: 'center', 26 | padding: 20, 27 | }, 28 | link: { 29 | marginTop: 15, 30 | paddingVertical: 15, 31 | }, 32 | }); 33 | -------------------------------------------------------------------------------- /app/_layout.tsx: -------------------------------------------------------------------------------- 1 | import { Stack } from "expo-router"; 2 | import { QueryClientProvider, QueryClient } from '@tanstack/react-query' 3 | 4 | export default function RootLayout() { 5 | const queryClient = new QueryClient(); 6 | 7 | return ( 8 | 9 | 10 | 16 | 22 | 28 | 34 | 35 | 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /app-example/(tabs)/_layout.tsx: -------------------------------------------------------------------------------- 1 | import { Tabs } from 'expo-router'; 2 | import React from 'react'; 3 | 4 | import { TabBarIcon } from '@/components/navigation/TabBarIcon'; 5 | import { Colors } from '@/constants/Colors'; 6 | import { useColorScheme } from '@/hooks/useColorScheme'; 7 | 8 | export default function TabLayout() { 9 | const colorScheme = useColorScheme(); 10 | 11 | return ( 12 | 17 | ( 22 | 23 | ), 24 | }} 25 | /> 26 | ( 31 | 32 | ), 33 | }} 34 | /> 35 | 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /app-example/_layout.tsx: -------------------------------------------------------------------------------- 1 | import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'; 2 | import { useFonts } from 'expo-font'; 3 | import { Stack } from 'expo-router'; 4 | import * as SplashScreen from 'expo-splash-screen'; 5 | import { useEffect } from 'react'; 6 | import 'react-native-reanimated'; 7 | 8 | import { useColorScheme } from '@/hooks/useColorScheme'; 9 | 10 | // Prevent the splash screen from auto-hiding before asset loading is complete. 11 | SplashScreen.preventAutoHideAsync(); 12 | 13 | export default function RootLayout() { 14 | const colorScheme = useColorScheme(); 15 | const [loaded] = useFonts({ 16 | SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), 17 | }); 18 | 19 | useEffect(() => { 20 | if (loaded) { 21 | SplashScreen.hideAsync(); 22 | } 23 | }, [loaded]); 24 | 25 | if (!loaded) { 26 | return null; 27 | } 28 | 29 | return ( 30 | 31 | 32 | 33 | 34 | 35 | 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /components/input/index.tsx: -------------------------------------------------------------------------------- 1 | import { View, StyleSheet, Text, TextInput, KeyboardTypeOptions } from 'react-native'; 2 | import { Controller } from 'react-hook-form' 3 | import { colors } from '../../constants/colors' 4 | 5 | interface InputProps{ 6 | name: string; 7 | control: any; 8 | placeholder?: string; 9 | rules?: object; 10 | error?: string; 11 | keyboardType: KeyboardTypeOptions; 12 | } 13 | 14 | export function Input({ name, control, placeholder, rules, error, keyboardType }: InputProps) { 15 | return ( 16 | 17 | ( 23 | 31 | )} 32 | /> 33 | 34 | {error && {error}} 35 | 36 | ); 37 | } 38 | 39 | const styles = StyleSheet.create({ 40 | container:{ 41 | marginBottom: 16, 42 | }, 43 | input:{ 44 | height: 44, 45 | backgroundColor: colors.white, 46 | paddingHorizontal: 10, 47 | borderRadius: 4, 48 | }, 49 | errorText:{ 50 | color: 'red', 51 | marginTop: 4, 52 | } 53 | }) -------------------------------------------------------------------------------- /app-example/+html.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollViewStyleReset } from 'expo-router/html'; 2 | import { type PropsWithChildren } from 'react'; 3 | 4 | /** 5 | * This file is web-only and used to configure the root HTML for every web page during static rendering. 6 | * The contents of this function only run in Node.js environments and do not have access to the DOM or browser APIs. 7 | */ 8 | export default function Root({ children }: PropsWithChildren) { 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | {/* 17 | Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. 18 | However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. 19 | */} 20 | 21 | 22 | {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */} 23 |