@rizwan-org/react-native-gymrec
v0.1.5
Published
react native library for recommending gym excercices
Readme
@rizwan92/react-native-gymrec
A React Native TurboModule for AI-powered gym exercise recommendations.
Installation
Install the package from npm:
yarn add @rizwan92/react-native-gymrec
# or
npm install @rizwan92/react-native-gymrec --saveThen install iOS pods:
cd ios && pod install && cd ..React Native 0.60+ supports auto-linking for native modules.
Usage
Import the module and use its async methods:
import {
listBodyParts,
listGoals,
listGenders,
listLevels,
listMedicalTags,
listWeekTags,
recommendExercises,
type GymRecInput,
type ExerciseRec,
} from '@rizwan92/react-native-gymrec';
async function example() {
// Fetch available options
const [bodyParts, genders, levels, medicalTags, weekTags, goals] =
await Promise.all([
listBodyParts(),
listGenders(),
listLevels(),
listMedicalTags(),
listWeekTags(),
listGoals(),
]);
// Prepare input
const input: GymRecInput = {
age: 30,
gender: genders[0],
weight: 70,
height: 175,
goal: goals[0],
fitness_level: levels[0],
medical_condition: medicalTags[0],
week_day: weekTags[0],
body_parts: [bodyParts[0]],
};
// Get recommendations
const result = await recommendExercises(input);
const recs: ExerciseRec[] = result.recommendations;
console.log('Recommendations:', recs);
}Example App
A complete sample is available at:
packages/example/App.tsxOpen it to see how state is managed, UI is built and how the TurboModule is used end-to-end.
Development
If editing the native Rust model or RN bindings:
- Rebuild the Rust model and bundle native libraries:
yarn build:model - Re-run pods (iOS) or Gradle (Android) if necessary.
- Run the example app:
yarn workspace example react-native run-ios # or run-android
Publishing
To publish a new version to npm:
- Ensure the
versionfield inpackages/react-native-gymrec/package.jsonis updated. - From the repository root, run:
This will read the version and publish underyarn publish:gymrec@rizwan92scope with that version tag.
Make sure
NPM_TOKENis set in your environment or CI secrets for authentication.
License
MIT
