This guide will walk you through cloning, setting up PHP and Composer, installing dependencies (without committing vendor), and importing the database for the BeFit AI project.
This project requires PHP 8.2 or higher and Composer to install dependencies. Make sure the PHP zip extension and unzip/7-Zip are enabled/installed to avoid download issues during setup. If you don’t have PHP installed, download XAMPP and ensure PHP is added to your system PATH.
- Download from: https://www.apachefriends.org/download.html
- Use version 8.2.5 or later to ensure compatibility.
- Make sure to include Apache and MySQL during installation.
💡 You can verify PHP version via:
php -v- Download and install from: https://git-scm.com/downloads
After installation, restart your terminal and verify:
git --version- Download from: https://getcomposer.org/download/
- If you're using XAMPP, make sure to point Composer to
C:\xampp\php\php.exeduring installation.
Check it's working:
composer --versionOpen C:\xampp\php\php.ini and make sure these lines are uncommented (remove the ; if present):
extension=zip
extension=mysqliThen restart Apache via the XAMPP Control Panel.
git clone https://github.com/your-repo/BeFit-AI.git
cd BeFit-AIIf you're a developer or user cloning the project (without the vendor folder), run:
composer_setup.batThis runs
composer installautomatically.
composer install
⚠️ Requires internet and Composer set up properly (see prerequisites).
Run the bundled setup script:
cd scripts
setup.batThis will:
- Create the
befit_dbdatabase - Import the schema and sample data from
database/dump.sql
📌 If your MySQL uses a password, edit setup.bat and update:
mysql -u root -pYOURPASSWORD ...- Open phpMyAdmin: http://localhost/phpmyadmin
- Click New, name it
befit_db, then click Create. - Go to the Import tab.
- Select
database/dump.sqland run the import.
If you make schema changes (new tables/columns), update dump.sql:
cd scripts
publish.batThen commit database/dump.sql to version control so others can sync your changes.
| Issue | Fix |
|---|---|
| "Class 'GeminiAPI\Client' not found" | Run composer install to generate the vendor folder |
| "git not found" error | Install Git and ensure it’s in your system PATH |
| Composer fails due to missing ZIP support | Enable extension=zip in php.ini, or install 7-Zip |
MySQL connection errors in setup.bat |
Ensure MySQL is running and credentials are correct |
| php not recognized | Add C:\xampp\php to your system PATH |
To prevent this:
- Add this to
.gitignore:
/vendor/
- Remove it from Git if already committed:
git rm -r --cached vendor
git commit -m "Remove vendor folder from repo"All users should now run
composer installorcomposer_setup.batafter cloning.
| Task | File/Command |
|---|---|
| Clone project | git clone ... |
| Install dependencies | composer_setup.bat |
| Set up database | scripts/setup.bat |
| Start XAMPP services | Apache & MySQL |
| Launch site | http://localhost/BeFit-Folder |