Nutrix is a lightweight React-Native cross-platform application focused on mobile devices that fetch and display nutrition data using the Nutritionix API. It also integrates navigation using Expo Router, global state management via Context API, and data fetching with Axios.
- API Integration: Fetch nutrition data from Nutritionix API.
- Three Core Pages:
- Login: User authentication with form validation.
- Register: New user registration with secure form validation.
- Home: Displays nutrition data fetched from the API.
- Global State Management: Use Context API for managing the app state.
- Axios Integration: Fetch data from the Nutritionix API using Axios.
- Expo Router: Navigation between different pages.
- Ensure Node.js and npm are installed.
- Install Expo CLI globally:
npm install -g expo-cli
-
Clone the repository:
git clone https://github.com/manojtharindu11/nutrix.git
-
Navigate to the project directory:
cd nutrix
-
Install dependencies:
npm install
-
Start the development server:
npx expo start
-
Use the Expo Go app or an emulator to view the app:
- Scan the QR Code: Open Expo Go and scan the QR code displayed in the terminal.
- Run on Emulator: Follow Expo's setup instructions for iOS or Android simulators.
The app integrates with the Nutritionix API to fetch nutritional data.
https://trackapi.nutritionix.com/v2/search/instant/?query=nutritions
Include your credentials in a .env
file:
EXPO_PUBLIC_API_URL=https://trackapi.nutritionix.com/v2/search/instant/?query=nutritions
EXPO_PUBLIC_X_APP_ID=your-app-id-get-from-nutritionix
EXPO_PUBLIC_X_APP_KEY=your-app-key-get-from-nutritionix
An .env.example
file is provided to guide the structure of the .env
file.
Enables new user registration with real-time form validation for name, email, and password fields.
Securely logs users in using validated credentials.
Fetches and displays real-time nutrition data from the Nutritionix API in an easy-to-read format.
This project is licensed under the MIT License.