TriConnect is a comprehensive web platform designed to help athletes master triathlon training across all three disciplines: swimming, cycling, and running. The platform combines personalized training plans, performance tracking, community forums, and sports science education to provide an optimized training experience.
- π Multi-Sport Training: Dedicated modules for swimming, cycling, and running
- π Strava Integration: Automatic activity sync and performance tracking
- π₯ Community Forums: Sport-specific discussion boards and knowledge sharing
- π― Personalized Plans: AI-generated training programs based on fitness level and goals
- π Performance Analytics: Track your progress with detailed metrics and insights
- 𧬠Sports Science: Educational content on exercise physiology and training methodology
- Customized Training Plans: Generate personalized workout schedules based on your fitness level, goals, and current health status
- Multi-Sport Coverage: Separate training modules for swimming, cycling, and running
- Progress Tracking: Monitor your improvement across all three disciplines
- Strava Integration: Seamless OAuth authentication and automatic activity synchronization
- Activity Dashboard: View your latest workouts, distances, and performance metrics
- Physical Stats Management: Track VO2 max, FTP, heart rate zones, and more
- Sport-Specific Forums: Dedicated discussion boards for each discipline
- Expert Knowledge Base: Educational resources on sports science and anatomy
- Social Features: Connect with fellow triathletes and share experiences
- Secure Authentication: Password hashing with industry-standard security
- Profile Customization: Manage your personal information and athletic stats
- OAuth Integration: Connect third-party services like Strava
- HTML5 - Semantic markup
- CSS3 - Modern styling with custom properties
- JavaScript (ES6+) - Interactive UI components
- Responsive Design - Mobile-first approach
- PHP 7.4+ - Server-side logic
- MySQL 5.7+ - Relational database
- PDO - Secure database interactions
- Session Management - User authentication
- Strava API v3 - Activity tracking and athlete data
- OAuth 2.0 - Secure third-party authentication
Ensure you have the following installed:
- PHP >= 7.4 with extensions:
pdo_mysqlcurljson
- MySQL >= 5.7 or MariaDB >= 10.2
- Web Server: Apache or Nginx
- Composer (optional, for dependency management)
- Clone the Repository
git clone https://github.com/vincehhh/triconnect.git
cd triconnect- Database Configuration
Import the database schema:
mysql -u your_username -p < sql/triconnect_dbOr manually create the database:
CREATE DATABASE triconnect_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Then import the schema from sql/triconnect_db.
- Configure Database Connection
Edit assets/php/db_connect.php with your credentials:
$host = 'localhost';
$dbname = 'triconnect_db';
$username = 'your_username';
$password = 'your_password';- Strava API Setup
To enable Strava integration:
- Create a Strava application at Strava Developers
- Create
assets/php/config_strava.php:
<?php
define('STRAVA_CLIENT_ID', 'your_client_id');
define('STRAVA_CLIENT_SECRET', 'your_client_secret');
define('STRAVA_REDIRECT_URI', 'http://yourdomain.com/assets/php/callback_strava.php');
?>- Set Permissions
chmod 755 assets/php/
chmod 644 assets/php/*.php- Start Development Server
Using PHP built-in server:
php -S localhost:8000Or configure your Apache/Nginx virtual host to point to the project root.
- Access the Application
Navigate to http://localhost:8000 in your browser.
-
Create an Account
- Visit the registration page at
/inscription.html - Fill in your details and create a secure password
- Verify your email address
- Visit the registration page at
-
Complete Your Profile
- Add your physical stats (weight, height, VO2 max, etc.)
- Set your training goals and current fitness level
-
Connect Strava (Optional)
- Navigate to your profile
- Click "Connect Strava"
- Authorize TriConnect to access your activities
-
Generate Training Plans
- Select your sport (swimming, cycling, or running)
- Input your current level and goals
- Receive a personalized training program
-
Join the Community
- Browse sport-specific forums
- Ask questions and share knowledge
- Connect with fellow athletes
- User: Basic access to training features and forums
- Moderator: Forum moderation capabilities
- Admin: Full platform management access
TriConnect integrates with Strava to automatically sync your activities:
// 1. Initiate OAuth
$authUrl = "https://www.strava.com/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&response_type=code&scope=read,activity:read_all";
// 2. Handle callback (callback_strava.php)
// Exchanges authorization code for access token
// Stores tokens in oauth_tokens table
// 3. Fetch athlete data (infos_strava.php)
$athleteInfo = callStravaAPI('https://www.strava.com/api/v3/athlete', $token);- Athlete Profile:
/api/v3/athlete - Activities:
/api/v3/athlete/activities - Stats:
/api/v3/athletes/{id}/stats
users
- Primary user information and authentication
- Roles: user, moderator, admin
user_physical_stats
- Athletic metrics (VO2 max, FTP, heart rate zones)
- One-to-one relationship with users
oauth_tokens
- Third-party service credentials
- Supports Strava and Garmin
activities
- Synced workout data
- Linked to external activity IDs
forum_threads & forum_posts
- Community discussion content
- Categorized by sport
triconnect/
βββ assets/
β βββ css/ # Stylesheets
β β βββ style.css
β β βββ connexion.css
β β βββ inscription.css
β βββ js/ # JavaScript modules
β β βββ carousel.js
β β βββ fichier.js
β βββ img/ # Images and logos
β βββ php/ # Backend logic
β βββ db_connect.php
β βββ login.php
β βββ register.php
β βββ callback_strava.php
β βββ infos_strava.php
βββ sql/
β βββ triconnect_db # Database schema
βββ connexion.html # Login page
βββ inscription.html # Registration page
βββ profil.php # User profile
βββ sport.html # Main dashboard
βββ natation.html # Swimming module
βββ velo.html # Cycling module
βββ running.html # Running module
βββ README.md
TriConnect implements several security best practices:
- Password Hashing: Using
PASSWORD_DEFAULTalgorithm (bcrypt) - Prepared Statements: All database queries use PDO prepared statements
- Input Sanitization:
htmlspecialchars()on user inputs - Session Management: Secure session handling for authenticated users
- HTTPS Required: OAuth redirects require HTTPS in production
- SQL Injection Prevention: Parameterized queries throughout
For production deployment:
- Enable HTTPS/SSL
- Set secure session cookie flags
- Implement CSRF protection
- Add rate limiting on authentication endpoints
- Use environment variables for sensitive credentials
- Regular security audits and dependency updates
We welcome contributions from the community! Here's how you can help:
- Check existing issues to avoid duplicates
- Use the issue template
- Include detailed reproduction steps
- Attach screenshots if applicable
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PSR-12 coding standards for PHP
- Write meaningful commit messages
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation as needed
- Garmin Connect integration
- Mobile responsive improvements
- Advanced analytics dashboard
- Training plan marketplace
- Video tutorial library
- Nutrition tracking module
- Race calendar integration
- Coach-athlete messaging system
- Group training challenges
- Export training data (CSV, PDF)
This project is licensed under the MIT License - see the LICENSE file for details.
- Vincent - Initial work - @vincehhh
- Strava API for activity tracking integration
- The triathlon community for inspiration and feedback
- Open source contributors and libraries used in this project
Made with β€οΈ by the TriConnect Team
Website β’ Documentation β’ Community