Personalized Workout Plans Powered by Google Gemini AI
TrainHub is a web application designed to help users create personalized weekly workout plans using the power of AI (Google Gemini). It features a comprehensive dashboard for managing plans, an interactive calendar for tracking workouts, detailed statistics, and an AI-powered plan generator.
- AI Workout Generator: Create personalized 7-day workout templates based on your profile (goals, level, equipment).
- AI Coach Chatbot: Interactive chat with an AI personal trainer for advice on workouts, nutrition, and motivation.
- Weekly Template Model: Save a weekly template and apply it for a user-defined duration (e.g., 4, 8, 12 weeks).
- Interactive Calendar: View daily workouts, mark them as complete, and see details in a modal.
- Workout Tracking: Track your progress by marking workouts as done.
- Stats Dashboard: Monitor your current streak, total workouts, and 30-day activity graph.
- Mobile Responsive: Fully responsive design for seamless use on all devices.
- Secure Authentication: Robust login and registration system.
- HTML5 & JavaScript
- Tailwind CSS (Dashboard & App Pages)
- Bootstrap 5.3.2 (Landing Page)
- Chart.js (Statistics Visualization)
- PHP (Native)
- Python (FastAPI for AI Services)
- MySQL
- Google Gemini 2.5 Flash & Google Gemini 2.0 Flash
git clone https://github.com/TangRmdhn/TrainHub.git
cd trainhub- Import the database schema:
mysql -u root -p < trainhub_db.sql - Update
koneksi.phpwith your credentials:$host = "localhost"; $user = "root"; $password = "your_password"; $database = "trainhub_db";
cd AIpython -m venv .venv- Windows (PowerShell):
.\.venv\Scripts\activate
- Windows (CMD):
.venv\Scripts\activate.bat
- macOS/Linux:
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file in the AI directory:
GOOGLE_API_KEY=your_api_key_hereuvicorn main:app --reloadThe AI service will run at http://localhost:8000.
- Host PHP files on a local server (XAMPP, Apache, Nginx).
- Ensure the server runs on
http://localhost.
Build the CSS before running the app.
# Windows
.\tailwindcss.exe -i .\src\input.css -o .\views\css\tailwind.css --minifynpm install -D tailwindcss
npx tailwindcss -i ./src/input.css -o ./views/css/tailwind.css --minifyOpen http://localhost/trainhub in your browser.
trainhub/
├── AI/ # Python FastAPI Service
├── views/ # Frontend Views
│ ├── css/ # Stylesheets
│ ├── app.php # Dashboard
│ └── ...
├── controllers/ # Backend Logic
├── index.php # Landing Page
├── config.php # Configuration
├── koneksi.php # Database Connection
├── trainhub_db.sql # Database Schema
└── README.md # Documentation
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Distributed under the GNU General Public License v3.0. See LICENSE for more information.