This is a full-stack web application that generates personalized fitness plans for users based on their age, goals, and experience level. The backend is built with Flask and the frontend is a React application.
This diagram illustrates the high-level architecture of the fitness application, showing the interaction between the frontend, backend services, AI/LLM components, and the database.
-
User profile creation and updates
-
Dynamic fitness options based on user's age
-
Personalized workout plan generation
-
Interactive dashboard to view workout plans
-
AI-Powered Fitness Options: The Fitness Options API leverages an intelligent agent to dynamically generate personalized fitness options (goals, equipment, workout types, experience levels) based on the user's age and previous selections. This ensures a highly customized onboarding experience.
-
Dynamic Workout Generation: Once a user's profile is set up, the Workout Generation API utilizes another intelligent agent to create a tailored 3-week workout plan. This plan is dynamically generated based on the user's specific fitness goals, available equipment, preferred workout types, and experience level, providing a truly personalized fitness journey.
-
Interactive Frontend: A responsive React frontend allows for easy profile setup and management.
-
RESTful API: A robust Flask backend provides a clear and scalable API for all application services.
This application leverages cutting-edge AI and Large Language Models (LLMs) to provide highly personalized experiences:
- Google Vertex AI: The backend agents are deployed and managed on Google Vertex AI, ensuring scalable and robust AI inference.
- Gemini 2.5: Utilized for complex reasoning and generation tasks, such as creating detailed workout plans and nuanced fitness options.
- Gemini 2.0 Flash Lite: Employed for tasks requiring low-latency responses, ensuring a snappy and responsive user experience, especially during interactive fitness option selections.
- Frontend: React, Vite,
react-router-dom, Tailwind CSS - Backend: Python, Flask, SQLAlchemy, Alembic, Pydantic, LangChain, Google GenAI
/fitness-app
├── backend/ # Flask API and business logic
│ ├── app/ # Core application files, including routes and agents
│ ├── migrations/ # Database migration scripts
│ ├── run.py # Application entry point
│ └── requirements.txt
├── src/ # React frontend source code
│ ├── components/ # Reusable React components
│ ├── App.jsx # Main application component with routing
│ └── main.jsx # Frontend entry point
├── package.json
└── README.md
- Node.js & npm
- Python 3.x & pip
-
Navigate to the backend directory:
cd backend -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Copy the example
.env.exampleto.envand fill in the required values. -
Run database migrations:
flask db upgrade
-
Start the backend server:
python run.py
-
Navigate to the root directory:
cd .. -
Install dependencies:
npm install
-
Start the frontend development server:
npm run dev
The application should now be running and accessible in your browser.
The backend exposes the following RESTful endpoints:
POST /api/profiles: Create a new user profile.GET /api/profiles/<uuid>: Retrieve a user profile by ID.PUT /api/profiles/<uuid>: Update an existing user profile.POST /api/profiles/<uuid>/workout-plan: Generate a new workout plan for a user.GET /api/profiles/<uuid>/workout-plan: Retrieve the latest workout plan for a user.
