https://github.com/manojtharindu11/nutrix
Nutrix is a cross platform mobile app that provides easy access to nutritional information from the Nutritionix API. It offers user login and registration, smooth navigation using Expo Router, and efficient data fetching with Axios. Nutrix uses context API for global state management.
https://github.com/manojtharindu11/nutrix
axios context-api expo mobile-app react-native
Last synced: 2 months ago
JSON representation
Nutrix is a cross platform mobile app that provides easy access to nutritional information from the Nutritionix API. It offers user login and registration, smooth navigation using Expo Router, and efficient data fetching with Axios. Nutrix uses context API for global state management.
- Host: GitHub
- URL: https://github.com/manojtharindu11/nutrix
- Owner: manojtharindu11
- License: mit
- Created: 2024-12-02T05:32:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-25T08:13:21.000Z (over 1 year ago)
- Last Synced: 2025-08-25T13:32:49.183Z (11 months ago)
- Topics: axios, context-api, expo, mobile-app, react-native
- Language: TypeScript
- Homepage:
- Size: 1.04 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nutrix: Nutrition Data Viewer
**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**.
---
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [API Integration](#api-integration)
- [Screens](#screens)
- [License](#license)
---
## Features
- **API Integration**: Fetch nutrition data from [Nutritionix API](https://trackapi.nutritionix.com/v2/search/instant/?query=nutritions).
- **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.
---
## Installation
### Prerequisites:
- Ensure **Node.js** and **npm** are installed.
- Install **Expo CLI** globally:
```bash
npm install -g expo-cli
```
### Steps:
1. Clone the repository:
```bash
git clone https://github.com/manojtharindu11/nutrix.git
```
2. Navigate to the project directory:
```bash
cd nutrix
```
3. Install dependencies:
```bash
npm install
```
4. Start the development server:
```bash
npx expo start
```
5. 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.
---
## API Integration
The app integrates with the Nutritionix API to fetch nutritional data.
### API Endpoint:
[https://trackapi.nutritionix.com/v2/search/instant/?query=nutritions](https://trackapi.nutritionix.com/v2/search/instant/?query=nutritions)
### API Keys Configuration:
Include your credentials in a `.env` file:
```env
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.
---
## Screens
### 1. **Registration Page**
Enables new user registration with real-time form validation for name, email, and password fields.
### 2. **Login Page**
Securely logs users in using validated credentials.
### 3. **Home Page**
Fetches and displays real-time nutrition data from the Nutritionix API in an easy-to-read format.
---
## License
This project is licensed under the [MIT License](LICENSE).