# Abbas FIT - Personal Training Management System

![Abbas FIT](https://img.shields.io/badge/Abbas-FIT-orange?style=for-the-badge)
![FastAPI](https://img.shields.io/badge/FastAPI-009688?style=for-the-badge&logo=fastapi&logoColor=white)
![MongoDB](https://img.shields.io/badge/MongoDB-47A248?style=for-the-badge&logo=mongodb&logoColor=white)
![React Native](https://img.shields.io/badge/React_Native-61DAFB?style=for-the-badge&logo=react&logoColor=black)

A comprehensive personal training management system for gym trainer Abbas, featuring AI-powered meal analysis, progress tracking, and client management.

## Features

### For Admin (Trainer Abbas)
- 👥 **Client Management** - Add, edit, delete clients with auto-generated passwords
- 📊 **Dashboard Insights** - Track adherence rates, active users, pending sessions
- 🍽️ **Diet Plans** - Create and assign customized diet plans
- 💪 **Workout Plans** - Design workout routines with exercises, sets, reps
- 📬 **Contact Management** - View and respond to access requests
- 📈 **User Analytics** - View individual client progress and history

### For Clients (Users)
- 📱 **Personal Dashboard** - BMI display, daily macro progress
- 🥗 **Meal Logging** - Log meals with AI-powered nutritional analysis
- 🏋️ **Activity Tracking** - Log workouts with RPE, sets, reps
- 📉 **Progress Tracking** - Weight history, body measurements
- 🤖 **AI Goal Predictions** - Personalized fitness goals based on data
- 👤 **Profile Management** - View targets and personal info

### AI Features (Gemini Integration)
- 🔍 **Meal Analysis** - Analyze Indian foods from text/photo
- 🎯 **Goal Predictions** - AI-generated fitness milestones
- 💡 **Smart Suggestions** - Dietary recommendations

## Tech Stack

- **Backend:** FastAPI (Python)
- **Database:** MongoDB
- **Mobile App:** Expo (React Native)
- **AI:** Google Gemini 2.5 Flash
- **Auth:** JWT

## Quick Start

### Using Docker (Recommended)

```bash
# Clone repository
git clone https://github.com/yourusername/abbasfit.git
cd abbasfit

# Configure environment
cp backend/.env.example backend/.env
# Edit backend/.env with your settings

# Start services
docker-compose up -d

# Initialize database
docker-compose exec backend python init_db.py
```

### Manual Setup

See [DEPLOYMENT.md](DEPLOYMENT.md) for detailed instructions.

## Default Credentials

| Role | Email | Password |
|------|-------|----------|
| Admin | admin@abbasfit.com | admin |

⚠️ **Change the password after first login!**

## API Documentation

Once running, access the API docs at:
- Swagger UI: `http://localhost:8001/docs`
- ReDoc: `http://localhost:8001/redoc`

## Mobile App

### Development
```bash
cd frontend
npm install
npx expo start
```

### Build APK
```bash
npx eas build --platform android --profile preview
```

## Project Structure

```
abbasfit/
├── backend/
│   ├── server.py          # Main FastAPI application
│   ├── config.py          # Configuration management
│   ├── init_db.py         # Database initialization
│   ├── requirements.txt   # Python dependencies
│   └── Dockerfile
├── frontend/
│   ├── app/               # Expo Router screens
│   │   ├── (admin)/       # Admin screens
│   │   ├── (user)/        # User screens
│   │   ├── index.tsx      # Landing page
│   │   └── login.tsx      # Login screen
│   ├── src/
│   │   ├── context/       # Auth context
│   │   ├── services/      # API service
│   │   └── constants/     # Theme colors
│   └── app.json
├── docker-compose.yml
├── DEPLOYMENT.md
└── README.md
```

## License

MIT License - feel free to use for your own projects!

## Support

For questions or issues, please open a GitHub issue.

---

Built with ❤️ for fitness enthusiasts
